• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include "symbol.h"
2 #include "target.h"
3 #include "machine.h"
4 
5 
init_arm(const struct target * self)6 static void init_arm(const struct target *self)
7 {
8 	fast16_ctype = &int_ctype;
9 	ufast16_ctype = &uint_ctype;
10 	fast32_ctype = &int_ctype;
11 	ufast32_ctype = &uint_ctype;
12 
13 	if (arch_os == OS_NONE) {
14 		int32_ctype = &long_ctype;
15 		uint32_ctype = &ulong_ctype;
16 		fast8_ctype = &int_ctype;
17 		ufast8_ctype = &uint_ctype;
18 	}
19 }
20 
predefine_arm(const struct target * self)21 static void predefine_arm(const struct target *self)
22 {
23 	predefine("__arm__", 1, "1");
24 	predefine("__VFP_FP__", 1, "1");
25 
26 	switch (arch_fp_abi) {
27 	case FP_ABI_HARD:
28 		predefine("__ARM_PCS_VFP", 1, "1");
29 		break;
30 	case FP_ABI_SOFT:
31 		predefine("__SOFTFP__", 1, "1");
32 		/* fall-through */
33 	case FP_ABI_HYBRID:
34 		predefine("__ARM_PCS", 1, "1");
35 		break;
36 	}
37 
38 	if (arch_big_endian)
39 		predefine("__ARMEB__", 0, "1");
40 	else
41 		predefine("__ARMEL__", 0, "1");
42 }
43 
44 const struct target target_arm = {
45 	.mach = MACH_ARM,
46 	.bitness = ARCH_LP32,
47 	.big_endian = 0,
48 	.unsigned_char = 1,
49 
50 	.wchar = &uint_ctype,
51 
52 	.bits_in_longdouble = 64,
53 	.max_fp_alignment = 8,
54 
55 	.init = init_arm,
56 	.predefine = predefine_arm,
57 };
58