Mercurial > hg > CbC > CbC_gcc
annotate gcc/config/arm/netbsd.h @ 90:99e7b6776dd1
implemeted __rectype expression. add CbC-exanples/fact-rectype.s
author | Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 25 Dec 2011 04:04:42 +0900 |
parents | f6334be47118 |
children |
rev | line source |
---|---|
0 | 1 /* NetBSD/arm a.out version. |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2 Copyright (C) 1993, 1994, 1997, 1998, 2003, 2004, 2005, 2007, 2008, 2010 |
0 | 3 Free Software Foundation, Inc. |
4 Contributed by Mark Brinicombe (amb@physig.ph.kcl.ac.uk) | |
5 | |
6 This file is part of GCC. | |
7 | |
8 GCC is free software; you can redistribute it and/or modify it | |
9 under the terms of the GNU General Public License as published | |
10 by the Free Software Foundation; either version 3, or (at your | |
11 option) any later version. | |
12 | |
13 GCC is distributed in the hope that it will be useful, but WITHOUT | |
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | |
15 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public | |
16 License for more details. | |
17 | |
18 You should have received a copy of the GNU General Public License | |
19 along with GCC; see the file COPYING3. If not see | |
20 <http://www.gnu.org/licenses/>. */ | |
21 | |
22 /* Run-time Target Specification. */ | |
23 #undef TARGET_VERSION | |
24 #define TARGET_VERSION fputs (" (ARM/NetBSD)", stderr); | |
25 | |
26 /* Unsigned chars produces much better code than signed. */ | |
27 #define DEFAULT_SIGNED_CHAR 0 | |
28 | |
29 /* Since we always use GAS as our assembler we support stabs. */ | |
30 #define DBX_DEBUGGING_INFO 1 | |
31 | |
32 /*#undef ASM_DECLARE_FUNCTION_NAME*/ | |
33 | |
34 /* ARM6 family default cpu. */ | |
35 #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6 | |
36 | |
37 #undef TARGET_DEFAULT | |
38 #define TARGET_DEFAULT (MASK_APCS_FRAME) | |
39 | |
40 /* Some defines for CPP. | |
41 arm32 is the NetBSD port name, so we always define arm32 and __arm32__. */ | |
42 #define TARGET_OS_CPP_BUILTINS() \ | |
43 do { \ | |
44 NETBSD_OS_CPP_BUILTINS_AOUT(); \ | |
45 builtin_define_std ("arm32"); \ | |
46 builtin_define_std ("unix"); \ | |
47 builtin_define_std ("riscbsd"); \ | |
48 } while (0) | |
49 | |
50 #undef SUBTARGET_EXTRA_SPECS | |
51 #define SUBTARGET_EXTRA_SPECS \ | |
52 { "netbsd_cpp_spec", NETBSD_CPP_SPEC }, \ | |
53 { "netbsd_link_spec", NETBSD_LINK_SPEC_AOUT }, | |
54 | |
55 #undef CPP_SPEC | |
56 #define CPP_SPEC "\ | |
57 %(cpp_cpu_arch) %(cpp_float) %(cpp_endian) %(netbsd_cpp_spec) \ | |
58 " | |
59 | |
60 /* Because TARGET_DEFAULT sets MASK_SOFT_FLOAT */ | |
61 #undef CPP_FLOAT_DEFAULT_SPEC | |
62 #define CPP_FLOAT_DEFAULT_SPEC "-D__SOFTFP__" | |
63 | |
64 /* Pass -X to the linker so that it will strip symbols starting with 'L' */ | |
65 #undef LINK_SPEC | |
66 #define LINK_SPEC "-X %(netbsd_link_spec)" | |
67 | |
68 #undef SIZE_TYPE | |
69 #define SIZE_TYPE "unsigned int" | |
70 | |
71 #undef PTRDIFF_TYPE | |
72 #define PTRDIFF_TYPE "int" | |
73 | |
74 /* We don't have any limit on the length as out debugger is GDB. */ | |
75 #undef DBX_CONTIN_LENGTH | |
76 | |
77 /* NetBSD does its profiling differently to the Acorn compiler. We | |
78 don't need a word following the mcount call; and to skip it | |
79 requires either an assembly stub or use of fomit-frame-pointer when | |
80 compiling the profiling functions. Since we break Acorn CC | |
81 compatibility below a little more won't hurt. */ | |
82 | |
83 #undef ARM_FUNCTION_PROFILER | |
84 #define ARM_FUNCTION_PROFILER(STREAM,LABELNO) \ | |
85 { \ | |
86 fprintf(STREAM, "\tmov\t%sip, %slr\n", REGISTER_PREFIX, REGISTER_PREFIX); \ | |
87 fprintf(STREAM, "\tbl\tmcount\n"); \ | |
88 } | |
89 | |
90 /* On the ARM `@' introduces a comment, so we must use something else | |
91 for .type directives. */ | |
92 #undef TYPE_OPERAND_FMT | |
93 #define TYPE_OPERAND_FMT "%%%s" | |
94 | |
95 /* NetBSD uses the old PCC style aggregate returning conventions. */ | |
96 #undef DEFAULT_PCC_STRUCT_RETURN | |
97 #define DEFAULT_PCC_STRUCT_RETURN 1 | |
98 | |
99 /* Although not normally relevant (since by default, all aggregates | |
100 are returned in memory) compiling some parts of libc requires | |
101 non-APCS style struct returns. */ | |
102 #undef TARGET_RETURN_IN_MEMORY | |
103 | |
104 /* VERY BIG NOTE : Change of structure alignment for RiscBSD. | |
105 There are consequences you should be aware of... | |
106 | |
107 Normally GCC/arm uses a structure alignment of 32 for compatibility | |
108 with armcc. This means that structures are padded to a word | |
109 boundary. However this causes problems with bugged NetBSD kernel | |
110 code (possibly userland code as well - I have not checked every | |
111 binary). The nature of this bugged code is to rely on sizeof() | |
112 returning the correct size of various structures rounded to the | |
113 nearest byte (SCSI and ether code are two examples, the vm system | |
114 is another). This code breaks when the structure alignment is 32 | |
115 as sizeof() will report a word=rounded size. By changing the | |
116 structure alignment to 8. GCC will conform to what is expected by | |
117 NetBSD. | |
118 | |
119 This has several side effects that should be considered. | |
120 1. Structures will only be aligned to the size of the largest member. | |
121 i.e. structures containing only bytes will be byte aligned. | |
122 structures containing shorts will be half word aligned. | |
123 structures containing ints will be word aligned. | |
124 | |
125 This means structures should be padded to a word boundary if | |
126 alignment of 32 is required for byte structures etc. | |
127 | |
128 2. A potential performance penalty may exist if strings are no longer | |
129 word aligned. GCC will not be able to use word load/stores to copy | |
130 short strings. | |
131 | |
132 This modification is not encouraged but with the present state of the | |
133 NetBSD source tree it is currently the only solution that meets the | |
134 requirements. */ | |
135 #undef DEFAULT_STRUCTURE_SIZE_BOUNDARY | |
136 #define DEFAULT_STRUCTURE_SIZE_BOUNDARY 8 | |
137 | |
138 /* Clear the instruction cache from `BEG' to `END'. This makes a | |
139 call to the ARM32_SYNC_ICACHE architecture specific syscall. */ | |
140 #define CLEAR_INSN_CACHE(BEG, END) \ | |
141 { \ | |
142 extern int sysarch(int number, void *args); \ | |
143 struct { \ | |
144 unsigned int addr; \ | |
145 int len; \ | |
146 } s; \ | |
147 s.addr = (unsigned int)(BEG); \ | |
148 s.len = (END) - (BEG); \ | |
149 (void)sysarch(0, &s); \ | |
150 } |