2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / config / alpha / linux.h
bloba4bc3d3e4a4bcf12e1308addc4aee3d63dfb2fd9
1 /* Definitions of target machine for GNU compiler,
2 for Alpha Linux-based GNU systems.
3 Copyright (C) 1996, 1997, 1998, 2002, 2003 Free Software Foundation, Inc.
4 Contributed by Richard Henderson.
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
13 GCC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING. If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
23 #undef TARGET_DEFAULT
24 #define TARGET_DEFAULT (MASK_FP | MASK_FPREGS | MASK_GAS)
26 #define TARGET_OS_CPP_BUILTINS() \
27 do { \
28 builtin_define ("__gnu_linux__"); \
29 builtin_define ("_LONGLONG"); \
30 builtin_define_std ("linux"); \
31 builtin_define_std ("unix"); \
32 builtin_assert ("system=linux"); \
33 builtin_assert ("system=unix"); \
34 builtin_assert ("system=posix"); \
35 /* The GNU C++ standard library requires this. */ \
36 if (c_dialect_cxx ()) \
37 builtin_define ("_GNU_SOURCE"); \
38 } while (0)
40 #undef LIB_SPEC
41 #define LIB_SPEC \
42 "%{pthread:-lpthread} \
43 %{shared:-lc} \
44 %{!shared: %{profile:-lc_p}%{!profile:-lc}}"
46 /* Show that we need a GP when profiling. */
47 #undef TARGET_PROFILING_NEEDS_GP
48 #define TARGET_PROFILING_NEEDS_GP 1
50 /* Don't care about faults in the prologue. */
51 #undef TARGET_CAN_FAULT_IN_PROLOGUE
52 #define TARGET_CAN_FAULT_IN_PROLOGUE 1
54 /* OS fixes up EV5 data fault on prefetch. */
55 #undef TARGET_FIXUP_EV5_PREFETCH
56 #define TARGET_FIXUP_EV5_PREFETCH 1
58 #undef WCHAR_TYPE
59 #define WCHAR_TYPE "int"
61 /* Define this so that all GNU/Linux targets handle the same pragmas. */
62 #define HANDLE_PRAGMA_PACK_PUSH_POP
64 /* Determine whether the the entire c99 runtime is present in the
65 runtime library. */
66 #define TARGET_C99_FUNCTIONS 1
68 #define TARGET_HAS_F_SETLKW
70 #define LINK_GCC_C_SEQUENCE_SPEC \
71 "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
73 /* Do code reading to identify a signal frame, and set the frame
74 state data appropriately. See unwind-dw2.c for the structs. */
76 #ifdef IN_LIBGCC2
77 #include <signal.h>
78 #include <sys/ucontext.h>
79 #endif
81 #define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \
82 do { \
83 unsigned int *pc_ = (CONTEXT)->ra; \
84 struct sigcontext *sc_; \
85 long new_cfa_, i_; \
87 if (pc_[0] != 0x47fe0410 /* mov $30,$16 */ \
88 || pc_[2] != 0x00000083 /* callsys */) \
89 break; \
90 if ((CONTEXT)->cfa == 0) \
91 break; \
92 if (pc_[1] == 0x201f0067) /* lda $0,NR_sigreturn */ \
93 sc_ = (CONTEXT)->cfa; \
94 else if (pc_[1] == 0x201f015f) /* lda $0,NR_rt_sigreturn */ \
95 { \
96 struct rt_sigframe { \
97 struct siginfo info; \
98 struct ucontext uc; \
99 } *rt_ = (CONTEXT)->cfa; \
100 sc_ = &rt_->uc.uc_mcontext; \
102 else \
103 break; \
104 new_cfa_ = sc_->sc_regs[30]; \
105 (FS)->cfa_how = CFA_REG_OFFSET; \
106 (FS)->cfa_reg = 30; \
107 (FS)->cfa_offset = new_cfa_ - (long) (CONTEXT)->cfa; \
108 for (i_ = 0; i_ < 30; ++i_) \
110 (FS)->regs.reg[i_].how = REG_SAVED_OFFSET; \
111 (FS)->regs.reg[i_].loc.offset \
112 = (long)&sc_->sc_regs[i_] - new_cfa_; \
114 for (i_ = 0; i_ < 31; ++i_) \
116 (FS)->regs.reg[i_+32].how = REG_SAVED_OFFSET; \
117 (FS)->regs.reg[i_+32].loc.offset \
118 = (long)&sc_->sc_fpregs[i_] - new_cfa_; \
120 (FS)->regs.reg[64].how = REG_SAVED_OFFSET; \
121 (FS)->regs.reg[64].loc.offset = (long)&sc_->sc_pc - new_cfa_; \
122 (FS)->retaddr_column = 64; \
123 goto SUCCESS; \
124 } while (0)