Deleted Added
full compact
linux.h (110611) linux.h (117395)
1/* Definitions of target machine for GNU compiler,
1/* Definitions of target machine for GNU compiler,
2 for powerpc machines running Linux.
3 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003
2 for PowerPC machines running Linux.
3 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
4 Free Software Foundation, Inc.
5 Contributed by Michael Meissner (meissner@cygnus.com).
6
7This file is part of GNU CC.
8
9GNU CC is free software; you can redistribute it and/or modify
10it under the terms of the GNU General Public License as published by
11the Free Software Foundation; either version 2, or (at your option)

--- 4 unchanged lines hidden (view full) ---

16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with GNU CC; see the file COPYING. If not, write to
21the Free Software Foundation, 59 Temple Place - Suite 330,
22Boston, MA 02111-1307, USA. */
23
4 Free Software Foundation, Inc.
5 Contributed by Michael Meissner (meissner@cygnus.com).
6
7This file is part of GNU CC.
8
9GNU CC is free software; you can redistribute it and/or modify
10it under the terms of the GNU General Public License as published by
11the Free Software Foundation; either version 2, or (at your option)

--- 4 unchanged lines hidden (view full) ---

16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with GNU CC; see the file COPYING. If not, write to
21the Free Software Foundation, 59 Temple Place - Suite 330,
22Boston, MA 02111-1307, USA. */
23
24/* Don't assume anything about the header files. */
25#define NO_IMPLICIT_EXTERN_C
26
27#undef MD_EXEC_PREFIX
28#undef MD_STARTFILE_PREFIX
29
24#undef MD_EXEC_PREFIX
25#undef MD_STARTFILE_PREFIX
26
30#undef CPP_PREDEFINES
31#define CPP_PREDEFINES \
32 "-DPPC -D__ELF__ -Dpowerpc -Acpu=powerpc -Amachine=powerpc"
27#undef TARGET_OS_CPP_BUILTINS
28#define TARGET_OS_CPP_BUILTINS() \
29 do \
30 { \
31 builtin_define_std ("PPC"); \
32 builtin_define ("__ELF__"); \
33 builtin_define_std ("powerpc"); \
34 builtin_assert ("cpu=powerpc"); \
35 builtin_assert ("machine=powerpc"); \
36 } \
37 while (0)
33
34#undef CPP_OS_DEFAULT_SPEC
35#define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)"
36
37/* The GNU C++ standard library currently requires _GNU_SOURCE being
38 defined on glibc-based systems. This temporary hack accomplishes this,
39 it should go away as soon as libstdc++-v3 has a real fix. */
40#undef CPLUSPLUS_CPP_SPEC

--- 33 unchanged lines hidden (view full) ---

74#undef DRAFT_V4_STRUCT_RET
75#define DRAFT_V4_STRUCT_RET 1
76
77/* Do code reading to identify a signal frame, and set the frame
78 state data appropriately. See unwind-dw2.c for the structs. */
79
80#ifdef IN_LIBGCC2
81#include <signal.h>
38
39#undef CPP_OS_DEFAULT_SPEC
40#define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)"
41
42/* The GNU C++ standard library currently requires _GNU_SOURCE being
43 defined on glibc-based systems. This temporary hack accomplishes this,
44 it should go away as soon as libstdc++-v3 has a real fix. */
45#undef CPLUSPLUS_CPP_SPEC

--- 33 unchanged lines hidden (view full) ---

79#undef DRAFT_V4_STRUCT_RET
80#define DRAFT_V4_STRUCT_RET 1
81
82/* Do code reading to identify a signal frame, and set the frame
83 state data appropriately. See unwind-dw2.c for the structs. */
84
85#ifdef IN_LIBGCC2
86#include <signal.h>
82#include <sys/ucontext.h>
83
87
88/* During the 2.5 kernel series the kernel ucontext was changed, but
89 the new layout is compatible with the old one, so we just define
90 and use the old one here for simplicity and compatibility. */
91
92struct kernel_old_ucontext {
93 unsigned long uc_flags;
94 struct ucontext *uc_link;
95 stack_t uc_stack;
96 struct sigcontext_struct uc_mcontext;
97 sigset_t uc_sigmask;
98};
99
84enum { SIGNAL_FRAMESIZE = 64 };
85#endif
86
87#define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \
88 do { \
89 unsigned char *pc_ = (CONTEXT)->ra; \
90 struct sigcontext *sc_; \
91 long new_cfa_; \

--- 18 unchanged lines hidden (view full) ---

110 || *(unsigned int *) (pc_+0) == 0x380000AC) \
111 { \
112 struct rt_sigframe { \
113 char gap[SIGNAL_FRAMESIZE]; \
114 unsigned long _unused[2]; \
115 struct siginfo *pinfo; \
116 void *puc; \
117 struct siginfo info; \
100enum { SIGNAL_FRAMESIZE = 64 };
101#endif
102
103#define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \
104 do { \
105 unsigned char *pc_ = (CONTEXT)->ra; \
106 struct sigcontext *sc_; \
107 long new_cfa_; \

--- 18 unchanged lines hidden (view full) ---

126 || *(unsigned int *) (pc_+0) == 0x380000AC) \
127 { \
128 struct rt_sigframe { \
129 char gap[SIGNAL_FRAMESIZE]; \
130 unsigned long _unused[2]; \
131 struct siginfo *pinfo; \
132 void *puc; \
133 struct siginfo info; \
118 struct ucontext uc; \
134 struct kernel_old_ucontext uc; \
119 } *rt_ = (CONTEXT)->cfa; \
120 sc_ = &rt_->uc.uc_mcontext; \
121 } \
122 else \
123 break; \
124 \
125 new_cfa_ = sc_->regs->gpr[STACK_POINTER_REGNUM]; \
126 (FS)->cfa_how = CFA_REG_OFFSET; \

--- 7 unchanged lines hidden (view full) ---

134 (FS)->regs.reg[i_].loc.offset \
135 = (long)&(sc_->regs->gpr[i_]) - new_cfa_; \
136 } \
137 \
138 (FS)->regs.reg[LINK_REGISTER_REGNUM].how = REG_SAVED_OFFSET; \
139 (FS)->regs.reg[LINK_REGISTER_REGNUM].loc.offset \
140 = (long)&(sc_->regs->link) - new_cfa_; \
141 \
135 } *rt_ = (CONTEXT)->cfa; \
136 sc_ = &rt_->uc.uc_mcontext; \
137 } \
138 else \
139 break; \
140 \
141 new_cfa_ = sc_->regs->gpr[STACK_POINTER_REGNUM]; \
142 (FS)->cfa_how = CFA_REG_OFFSET; \

--- 7 unchanged lines hidden (view full) ---

150 (FS)->regs.reg[i_].loc.offset \
151 = (long)&(sc_->regs->gpr[i_]) - new_cfa_; \
152 } \
153 \
154 (FS)->regs.reg[LINK_REGISTER_REGNUM].how = REG_SAVED_OFFSET; \
155 (FS)->regs.reg[LINK_REGISTER_REGNUM].loc.offset \
156 = (long)&(sc_->regs->link) - new_cfa_; \
157 \
142 /* The unwinder expects the IP to point to the following insn, \
143 whereas the kernel returns the address of the actual \
144 faulting insn. We store NIP+4 in an unused register slot to \
145 get the same result for multiple evaluation of the same signal \
146 frame. */ \
147 sc_->regs->gpr[47] = sc_->regs->nip + 4; \
148 (FS)->regs.reg[CR0_REGNO].how = REG_SAVED_OFFSET; \
149 (FS)->regs.reg[CR0_REGNO].loc.offset \
158 (FS)->regs.reg[CR0_REGNO].how = REG_SAVED_OFFSET; \
159 (FS)->regs.reg[CR0_REGNO].loc.offset \
150 = (long)&(sc_->regs->gpr[47]) - new_cfa_; \
160 = (long)&(sc_->regs->nip) - new_cfa_; \
151 (FS)->retaddr_column = CR0_REGNO; \
152 goto SUCCESS; \
153 } while (0)
154
161 (FS)->retaddr_column = CR0_REGNO; \
162 goto SUCCESS; \
163 } while (0)
164