h8300.h: Fix comment formatting.
[gcc.git] / gcc / config / ia64 / linux.h
1 /* Definitions for ia64-linux target. */
2
3 /* This macro is a C statement to print on `stderr' a string describing the
4 particular machine description choice. */
5
6 #define TARGET_VERSION fprintf (stderr, " (IA-64) Linux");
7
8 /* This is for -profile to use -lc_p instead of -lc. */
9 #undef CC1_SPEC
10 #define CC1_SPEC "%{profile:-p} %{G*}"
11
12 /* ??? Maybe this should be in sysv4.h? */
13 #define CPP_PREDEFINES "\
14 -D__ia64 -D__ia64__ -D__linux -D__linux__ -D_LONGLONG -Dlinux -Dunix \
15 -D__LP64__ -D__ELF__ -Asystem=linux -Acpu=ia64 -Amachine=ia64"
16
17 /* ??? ia64 gas doesn't accept standard svr4 assembler options? */
18 #undef ASM_SPEC
19 #define ASM_SPEC "-x %{mconstant-gp} %{mauto-pic}"
20
21 /* Need to override linux.h STARTFILE_SPEC, since it has crtbeginT.o in. */
22 #undef STARTFILE_SPEC
23 #define STARTFILE_SPEC \
24 "%{!shared: \
25 %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
26 %{!p:%{profile:gcrt1.o%s} \
27 %{!profile:crt1.o%s}}}} \
28 crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
29
30 /* Similar to standard Linux, but adding -ffast-math support. */
31 #undef ENDFILE_SPEC
32 #define ENDFILE_SPEC \
33 "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
34 %{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
35
36 /* Define this for shared library support because it isn't in the main
37 linux.h file. */
38
39 #undef LINK_SPEC
40 #define LINK_SPEC "\
41 %{shared:-shared} \
42 %{!shared: \
43 %{!static: \
44 %{rdynamic:-export-dynamic} \
45 %{!dynamic-linker:-dynamic-linker /lib/ld-linux-ia64.so.2}} \
46 %{static:-static}}"
47
48
49 #define DONT_USE_BUILTIN_SETJMP
50 #define JMP_BUF_SIZE 76
51
52 /* Output any profiling code before the prologue. */
53
54 #undef PROFILE_BEFORE_PROLOGUE
55 #define PROFILE_BEFORE_PROLOGUE 1
56
57 /* Override linux.h LINK_EH_SPEC definition.
58 Signalize that because we have fde-glibc, we don't need all C shared libs
59 linked against -lgcc_s. */
60 #undef LINK_EH_SPEC
61 #define LINK_EH_SPEC ""
62
63 /* Do code reading to identify a signal frame, and set the frame
64 state data appropriately. See unwind-dw2.c for the structs. */
65
66 #ifdef IN_LIBGCC2
67 #include <signal.h>
68 #include <sys/ucontext.h>
69
70 #define IA64_GATE_AREA_START 0xa000000000000100LL
71 #define IA64_GATE_AREA_END 0xa000000000010000LL
72
73 #define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \
74 if ((CONTEXT)->rp >= IA64_GATE_AREA_START \
75 && (CONTEXT)->rp < IA64_GATE_AREA_END) \
76 { \
77 struct sigframe { \
78 char scratch[16]; \
79 unsigned long sig_number; \
80 struct siginfo *info; \
81 struct sigcontext *sc; \
82 } *frame_ = (struct sigframe *)(CONTEXT)->psp; \
83 struct sigcontext *sc_ = frame_->sc; \
84 \
85 /* Restore scratch registers in case the unwinder needs to \
86 refer to a value stored in one of them. */ \
87 { \
88 int i_; \
89 \
90 for (i_ = 2; i_ < 4; i_++) \
91 (CONTEXT)->ireg[i_ - 2].loc = &sc_->sc_gr[i_]; \
92 for (i_ = 8; i_ < 12; i_++) \
93 (CONTEXT)->ireg[i_ - 2].loc = &sc_->sc_gr[i_]; \
94 for (i_ = 14; i_ < 32; i_++) \
95 (CONTEXT)->ireg[i_ - 2].loc = &sc_->sc_gr[i_]; \
96 } \
97 \
98 (CONTEXT)->pfs_loc = &(sc_->sc_ar_pfs); \
99 (CONTEXT)->lc_loc = &(sc_->sc_ar_lc); \
100 (CONTEXT)->unat_loc = &(sc_->sc_ar_unat); \
101 (CONTEXT)->pr = sc_->sc_pr; \
102 (CONTEXT)->psp = sc_->sc_gr[12]; \
103 \
104 /* Don't touch the branch registers. The kernel doesn't \
105 pass the preserved branch registers in the sigcontext but \
106 leaves them intact, so there's no need to do anything \
107 with them here. */ \
108 \
109 { \
110 unsigned long sof = sc_->sc_cfm & 0x7f; \
111 (CONTEXT)->bsp = (unsigned long) \
112 ia64_rse_skip_regs ((unsigned long *)(sc_->sc_ar_bsp), -sof); \
113 } \
114 \
115 (FS)->curr.reg[UNW_REG_RP].where = UNW_WHERE_SPREL; \
116 (FS)->curr.reg[UNW_REG_RP].val \
117 = (unsigned long)&(sc_->sc_ip) - (CONTEXT)->psp; \
118 (FS)->curr.reg[UNW_REG_RP].when = -1; \
119 \
120 goto SUCCESS; \
121 }
122 #endif /* IN_LIBGCC2 */