]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/config/alpha/linux.h
alpha.h (TARGET_FIXUP_EV5_PREFETCH): New.
[thirdparty/gcc.git] / gcc / config / alpha / linux.h
1 /* Definitions of target machine for GNU compiler,
2 for Alpha Linux-based GNU systems.
3 Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
4 Contributed by Richard Henderson.
5
6 This file is part of GNU CC.
7
8 GNU CC 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.
12
13 GNU CC 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.
17
18 You should have received a copy of the GNU General Public License
19 along with GNU CC; see the file COPYING. If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
22
23 #undef TARGET_DEFAULT
24 #define TARGET_DEFAULT (MASK_FP | MASK_FPREGS | MASK_GAS)
25
26 #undef CPP_PREDEFINES
27 #define CPP_PREDEFINES \
28 "-Dlinux -Dunix -Asystem=linux -D_LONGLONG -D__alpha__ " \
29 SUB_CPP_PREDEFINES
30
31 /* The GNU C++ standard library requires that these macros be defined. */
32 #undef CPLUSPLUS_CPP_SPEC
33 #define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
34
35 #undef LIB_SPEC
36 #define LIB_SPEC \
37 "%{shared: -lc} \
38 %{!shared: %{pthread:-lpthread} \
39 %{profile:-lc_p} %{!profile: -lc}}"
40
41 /* Show that we need a GP when profiling. */
42 #undef TARGET_PROFILING_NEEDS_GP
43 #define TARGET_PROFILING_NEEDS_GP 1
44
45 /* Don't care about faults in the prologue. */
46 #undef TARGET_CAN_FAULT_IN_PROLOGUE
47 #define TARGET_CAN_FAULT_IN_PROLOGUE 1
48
49 /* OS fixes up EV5 data fault on prefetch. */
50 #undef TARGET_FIXUP_EV5_PREFETCH
51 #define TARGET_FIXUP_EV5_PREFETCH 1
52
53 #undef WCHAR_TYPE
54 #define WCHAR_TYPE "int"
55
56 /* Define this so that all GNU/Linux targets handle the same pragmas. */
57 #define HANDLE_PRAGMA_PACK_PUSH_POP
58
59 /* Do code reading to identify a signal frame, and set the frame
60 state data appropriately. See unwind-dw2.c for the structs. */
61
62 #ifdef IN_LIBGCC2
63 #include <signal.h>
64 #include <sys/ucontext.h>
65 #endif
66
67 #define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \
68 do { \
69 unsigned int *pc_ = (CONTEXT)->ra; \
70 struct sigcontext *sc_; \
71 long new_cfa_, i_; \
72 \
73 if (pc_[0] != 0x47fe0410 /* mov $30,$16 */ \
74 || pc_[2] != 0x00000083 /* callsys */) \
75 break; \
76 if (pc_[1] == 0x201f0067) /* lda $0,NR_sigreturn */ \
77 sc_ = (CONTEXT)->cfa; \
78 else if (pc_[1] == 0x201f015f) /* lda $0,NR_rt_sigreturn */ \
79 { \
80 struct rt_sigframe { \
81 struct siginfo info; \
82 struct ucontext uc; \
83 } *rt_ = (CONTEXT)->cfa; \
84 sc_ = &rt_->uc.uc_mcontext; \
85 } \
86 else \
87 break; \
88 new_cfa_ = sc_->sc_regs[30]; \
89 (FS)->cfa_how = CFA_REG_OFFSET; \
90 (FS)->cfa_reg = 30; \
91 (FS)->cfa_offset = new_cfa_ - (long) (CONTEXT)->cfa; \
92 for (i_ = 0; i_ < 30; ++i_) \
93 { \
94 (FS)->regs.reg[i_].how = REG_SAVED_OFFSET; \
95 (FS)->regs.reg[i_].loc.offset \
96 = (long)&sc_->sc_regs[i_] - new_cfa_; \
97 } \
98 for (i_ = 0; i_ < 31; ++i_) \
99 { \
100 (FS)->regs.reg[i_+32].how = REG_SAVED_OFFSET; \
101 (FS)->regs.reg[i_+32].loc.offset \
102 = (long)&sc_->sc_fpregs[i_] - new_cfa_; \
103 } \
104 (FS)->regs.reg[31].how = REG_SAVED_OFFSET; \
105 (FS)->regs.reg[31].loc.offset = (long)&sc_->sc_pc - new_cfa_; \
106 (FS)->retaddr_column = 31; \
107 goto SUCCESS; \
108 } while (0)