]>
git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/config/rs6000/linux64.h
1 /* Definitions of target machine for GNU compiler,
2 for 64 bit PowerPC linux.
3 Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published
9 by the Free Software Foundation; either version 2, or (at your
10 option) any later version.
12 GCC is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
15 License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING. If not, write to the
19 Free Software Foundation, 59 Temple Place - Suite 330, Boston,
20 MA 02111-1307, USA. */
22 #ifndef RS6000_BI_ARCH
25 #define DEFAULT_ABI ABI_AIX
28 #define TARGET_64BIT 1
30 #define DEFAULT_ARCH64_P 1
31 #define RS6000_BI_ARCH_P 0
35 #define DEFAULT_ARCH64_P (TARGET_DEFAULT & MASK_64BIT)
36 #define RS6000_BI_ARCH_P 1
43 #define TARGET_64BIT 1
45 #define TARGET_64BIT 0
50 #define TARGET_AIX TARGET_64BIT
52 #undef PROCESSOR_DEFAULT64
53 #define PROCESSOR_DEFAULT64 PROCESSOR_PPC630
55 #undef TARGET_RELOCATABLE
56 #define TARGET_RELOCATABLE (!TARGET_64BIT && (target_flags & MASK_RELOCATABLE))
58 #undef RS6000_ABI_NAME
59 #define RS6000_ABI_NAME (TARGET_64BIT ? "aixdesc" : "sysv")
61 #define INVALID_64BIT "-m%s not supported in this configuration"
62 #define INVALID_32BIT INVALID_64BIT
64 #undef SUBSUBTARGET_OVERRIDE_OPTIONS
65 #define SUBSUBTARGET_OVERRIDE_OPTIONS \
70 if (DEFAULT_ABI != ABI_AIX) \
72 DEFAULT_ABI = ABI_AIX; \
73 error (INVALID_64BIT, "call"); \
75 if (TARGET_RELOCATABLE) \
77 target_flags &= ~MASK_RELOCATABLE; \
78 error (INVALID_64BIT, "relocatable"); \
82 target_flags &= ~MASK_EABI; \
83 error (INVALID_64BIT, "eabi"); \
85 if (TARGET_PROTOTYPE) \
87 target_flags &= ~MASK_PROTOTYPE; \
88 error (INVALID_64BIT, "prototype"); \
93 if (!RS6000_BI_ARCH_P) \
94 error (INVALID_32BIT, "32"); \
101 #undef OVERRIDE_OPTIONS
102 #define OVERRIDE_OPTIONS \
103 rs6000_override_options (((TARGET_DEFAULT ^ target_flags) & MASK_64BIT) \
104 ? (char *) 0 : TARGET_CPU_DEFAULT)
106 #undef ASM_FILE_START
107 #define ASM_FILE_START(FILE) \
110 output_file_directive ((FILE), main_input_filename); \
111 rs6000_file_start (FILE, (((TARGET_DEFAULT ^ target_flags) \
113 ? (char *) 0 : TARGET_CPU_DEFAULT)); \
119 #undef ASM_DEFAULT_SPEC
121 #undef LINK_OS_LINUX_SPEC
123 #ifndef RS6000_BI_ARCH
124 #define ASM_DEFAULT_SPEC "-mppc64"
125 #define ASM_SPEC "%(asm_spec64) %(asm_spec_common)"
126 #define LINK_OS_LINUX_SPEC "%(link_os_linux_spec64)"
129 #define ASM_DEFAULT_SPEC "-mppc%{!m32:64}"
130 #define ASM_SPEC "%{m32:%(asm_spec32)}%{!m32:%(asm_spec64)} %(asm_spec_common)"
131 #define LINK_OS_LINUX_SPEC "%{m32:%(link_os_linux_spec32)}%{!m32:%(link_os_linux_spec64)}"
133 #define ASM_DEFAULT_SPEC "-mppc%{m64:64}"
134 #define ASM_SPEC "%{!m64:%(asm_spec32)}%{m64:%(asm_spec64)} %(asm_spec_common)"
135 #define LINK_OS_LINUX_SPEC "%{!m64:%(link_os_linux_spec32)}%{m64:%(link_os_linux_spec64)}"
139 #define ASM_SPEC32 "-a32 %{n} %{T} %{Ym,*} %{Yd,*} \
140 %{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} \
141 %{memb} %{!memb: %{msdata: -memb} %{msdata=eabi: -memb}} \
142 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
143 %{mcall-freebsd: -mbig} \
144 %{mcall-i960-old: -mlittle} \
145 %{mcall-linux: -mbig} \
146 %{mcall-gnu: -mbig} \
147 %{mcall-netbsd: -mbig} \
150 #define ASM_SPEC64 "-a64"
152 #define ASM_SPEC_COMMON "%(asm_cpu) \
153 %{.s: %{mregnames} %{mno-regnames}} %{.S: %{mregnames} %{mno-regnames}} \
154 %{v:-V} %{Qy:} %{!Qn:-Qy} %{Wa,*:%*} \
155 %{mlittle} %{mlittle-endian} %{mbig} %{mbig-endian}"
157 #undef SUBSUBTARGET_EXTRA_SPECS
158 #define SUBSUBTARGET_EXTRA_SPECS \
159 { "asm_spec_common", ASM_SPEC_COMMON }, \
160 { "asm_spec32", ASM_SPEC32 }, \
161 { "asm_spec64", ASM_SPEC64 }, \
162 { "link_os_linux_spec32", LINK_OS_LINUX_SPEC32 }, \
163 { "link_os_linux_spec64", LINK_OS_LINUX_SPEC64 },
165 #undef MULTILIB_DEFAULTS
167 #define MULTILIB_DEFAULTS { "m64" }
169 #define MULTILIB_DEFAULTS { "m32" }
172 #ifndef RS6000_BI_ARCH
174 /* 64-bit PowerPC Linux always has a TOC. */
178 /* Some things from sysv4.h we don't do when 64 bit. */
179 #undef TARGET_RELOCATABLE
180 #define TARGET_RELOCATABLE 0
182 #define TARGET_EABI 0
183 #undef TARGET_PROTOTYPE
184 #define TARGET_PROTOTYPE 0
188 #define MASK_PROFILE_KERNEL 0x00080000
190 /* Non-standard profiling for kernels, which just saves LR then calls
191 _mcount without worrying about arg saves. The idea is to change
192 the function prologue as little as possible as it isn't easy to
193 account for arg save/restore code added just for _mcount. */
194 #define TARGET_PROFILE_KERNEL (target_flags & MASK_PROFILE_KERNEL)
196 /* Override sysv4.h. */
197 #undef EXTRA_SUBTARGET_SWITCHES
198 #define EXTRA_SUBTARGET_SWITCHES \
199 {"profile-kernel", MASK_PROFILE_KERNEL, \
200 N_("Call mcount for profiling before a function prologue") }, \
201 {"no-profile-kernel", -MASK_PROFILE_KERNEL, \
202 N_("Call mcount for profiling after a function prologue") },
204 /* We use glibc _mcount for profiling. */
205 #define NO_PROFILE_COUNTERS TARGET_64BIT
206 #define PROFILE_HOOK(LABEL) \
207 do { if (TARGET_64BIT) output_profile_hook (LABEL); } while (0)
209 /* We don't need to generate entries in .fixup. */
210 #undef RELOCATABLE_NEEDS_FIXUP
212 /* This now supports a natural alignment mode. */
213 /* AIX word-aligns FP doubles but doubleword-aligns 64-bit ints. */
214 #undef ADJUST_FIELD_ALIGN
215 #define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
216 ((TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE) \
219 && TARGET_ALIGN_NATURAL == 0 \
220 && TYPE_MODE (TREE_CODE (TREE_TYPE (FIELD)) == ARRAY_TYPE \
221 ? get_inner_array_type (FIELD) \
222 : TREE_TYPE (FIELD)) == DFmode) \
223 ? MIN ((COMPUTED), 32) \
226 /* AIX increases natural record alignment to doubleword if the first
227 field is an FP double while the FP fields remain word aligned. */
228 #undef ROUND_TYPE_ALIGN
229 #define ROUND_TYPE_ALIGN(STRUCT, COMPUTED, SPECIFIED) \
230 ((TARGET_ALTIVEC && TREE_CODE (STRUCT) == VECTOR_TYPE) \
231 ? MAX (MAX ((COMPUTED), (SPECIFIED)), 128) \
233 && (TREE_CODE (STRUCT) == RECORD_TYPE \
234 || TREE_CODE (STRUCT) == UNION_TYPE \
235 || TREE_CODE (STRUCT) == QUAL_UNION_TYPE) \
236 && TYPE_FIELDS (STRUCT) != 0 \
237 && TARGET_ALIGN_NATURAL == 0 \
238 && DECL_MODE (TYPE_FIELDS (STRUCT)) == DFmode) \
239 ? MAX (MAX ((COMPUTED), (SPECIFIED)), 64) \
240 : MAX ((COMPUTED), (SPECIFIED)))
242 /* Indicate that jump tables go in the text section. */
243 #undef JUMP_TABLES_IN_TEXT_SECTION
244 #define JUMP_TABLES_IN_TEXT_SECTION TARGET_64BIT
246 /* __throw will restore its own return address to be the same as the
247 return address of the function that the throw is being made to.
248 This is unfortunate, because we want to check the original
249 return address to see if we need to restore the TOC.
250 So we have to squirrel it away with this. */
251 #define SETUP_FRAME_ADDRESSES() \
252 do { if (TARGET_64BIT) rs6000_aix_emit_builtin_unwind_init (); } while (0)
254 /* Override svr4.h */
255 #undef MD_EXEC_PREFIX
256 #undef MD_STARTFILE_PREFIX
258 /* Override sysv4.h */
260 #define CPP_SYSV_SPEC ""
262 #undef TARGET_OS_CPP_BUILTINS
263 #define TARGET_OS_CPP_BUILTINS() \
268 builtin_define ("__PPC__"); \
269 builtin_define ("__PPC64__"); \
270 builtin_define ("__powerpc__"); \
271 builtin_define ("__powerpc64__"); \
272 builtin_define ("__PIC__"); \
273 builtin_assert ("cpu=powerpc64"); \
274 builtin_assert ("machine=powerpc64"); \
278 builtin_define_std ("PPC"); \
279 builtin_define_std ("powerpc"); \
280 builtin_assert ("cpu=powerpc"); \
281 builtin_assert ("machine=powerpc"); \
282 TARGET_OS_SYSV_CPP_BUILTINS (); \
287 #undef CPP_OS_DEFAULT_SPEC
288 #define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)"
290 /* The GNU C++ standard library currently requires _GNU_SOURCE being
291 defined on glibc-based systems. This temporary hack accomplishes this,
292 it should go away as soon as libstdc++-v3 has a real fix. */
293 #undef CPLUSPLUS_CPP_SPEC
294 #define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
296 #undef LINK_SHLIB_SPEC
297 #define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}}"
299 #undef LIB_DEFAULT_SPEC
300 #define LIB_DEFAULT_SPEC "%(lib_linux)"
302 #undef STARTFILE_DEFAULT_SPEC
303 #define STARTFILE_DEFAULT_SPEC "%(startfile_linux)"
305 #undef ENDFILE_DEFAULT_SPEC
306 #define ENDFILE_DEFAULT_SPEC "%(endfile_linux)"
308 #undef LINK_START_DEFAULT_SPEC
309 #define LINK_START_DEFAULT_SPEC "%(link_start_linux)"
311 #undef LINK_OS_DEFAULT_SPEC
312 #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
314 #define LINK_OS_LINUX_SPEC32 "-m elf32ppclinux %{!shared: %{!static: \
315 %{rdynamic:-export-dynamic} \
316 %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
318 #define LINK_OS_LINUX_SPEC64 "-m elf64ppc %{!shared: %{!static: \
319 %{rdynamic:-export-dynamic} \
320 %{!dynamic-linker:-dynamic-linker /lib64/ld64.so.1}}}"
322 #undef TOC_SECTION_ASM_OP
323 #define TOC_SECTION_ASM_OP \
325 ? "\t.section\t\".toc\",\"aw\"" \
326 : "\t.section\t\".got\",\"aw\"")
328 #undef MINIMAL_TOC_SECTION_ASM_OP
329 #define MINIMAL_TOC_SECTION_ASM_OP \
331 ? "\t.section\t\".toc1\",\"aw\"" \
332 : ((TARGET_RELOCATABLE || flag_pic) \
333 ? "\t.section\t\".got2\",\"aw\"" \
334 : "\t.section\t\".got1\",\"aw\""))
336 #undef TARGET_VERSION
337 #define TARGET_VERSION fprintf (stderr, " (PowerPC64 GNU/Linux)");
339 /* Must be at least as big as our pointer type. */
341 #define SIZE_TYPE (TARGET_64BIT ? "long unsigned int" : "unsigned int")
344 #define PTRDIFF_TYPE (TARGET_64BIT ? "long int" : "int")
347 #define WCHAR_TYPE (TARGET_64BIT ? "int" : "long int")
348 #undef WCHAR_TYPE_SIZE
349 #define WCHAR_TYPE_SIZE 32
351 /* Override rs6000.h definition. */
353 #define ASM_APP_ON "#APP\n"
355 /* Override rs6000.h definition. */
357 #define ASM_APP_OFF "#NO_APP\n"
359 /* PowerPC no-op instruction. */
360 #undef RS6000_CALL_GLUE
361 #define RS6000_CALL_GLUE (TARGET_64BIT ? "nop" : "cror 31,31,31")
364 #define RS6000_MCOUNT "_mcount"
367 /* _init and _fini functions are built from bits spread across many
368 object files, each potentially with a different TOC pointer. For
369 that reason, place a nop after the call so that the linker can
370 restore the TOC pointer if a TOC adjusting call stub is needed. */
371 #define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \
372 asm (SECTION_OP "\n" \
378 /* FP save and restore routines. */
379 #undef SAVE_FP_PREFIX
380 #define SAVE_FP_PREFIX (TARGET_64BIT ? "._savef" : "_savefpr_")
381 #undef SAVE_FP_SUFFIX
382 #define SAVE_FP_SUFFIX (TARGET_64BIT ? "" : "_l")
383 #undef RESTORE_FP_PREFIX
384 #define RESTORE_FP_PREFIX (TARGET_64BIT ? "._restf" : "_restfpr_")
385 #undef RESTORE_FP_SUFFIX
386 #define RESTORE_FP_SUFFIX (TARGET_64BIT ? "" : "_l")
388 /* Dwarf2 debugging. */
389 #undef PREFERRED_DEBUGGING_TYPE
390 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
392 /* This is how to declare the size of a function. */
393 #undef ASM_DECLARE_FUNCTION_SIZE
394 #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
397 if (!flag_inhibit_size_directive) \
399 fputs ("\t.size\t", (FILE)); \
401 putc ('.', (FILE)); \
402 assemble_name ((FILE), (FNAME)); \
403 fputs (",.-", (FILE)); \
405 putc ('.', (FILE)); \
406 assemble_name ((FILE), (FNAME)); \
407 putc ('\n', (FILE)); \
412 /* Return nonzero if this entry is to be written into the constant
413 pool in a special way. We do so if this is a SYMBOL_REF, LABEL_REF
414 or a CONST containing one of them. If -mfp-in-toc (the default),
415 we also do this for floating-point constants. We actually can only
416 do this if the FP formats of the target and host machines are the
417 same, but we can't check that since not every file that uses
418 GO_IF_LEGITIMATE_ADDRESS_P includes real.h. We also do this when
419 we can write the entry into the TOC and the entry is not larger
422 #undef ASM_OUTPUT_SPECIAL_POOL_ENTRY_P
423 #define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X, MODE) \
425 && (GET_CODE (X) == SYMBOL_REF \
426 || (GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS \
427 && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF) \
428 || GET_CODE (X) == LABEL_REF \
429 || (GET_CODE (X) == CONST_INT \
430 && GET_MODE_BITSIZE (MODE) <= GET_MODE_BITSIZE (Pmode)) \
431 || (GET_CODE (X) == CONST_DOUBLE \
433 && (TARGET_POWERPC64 \
434 || TARGET_MINIMAL_TOC \
435 || (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \
436 && ! TARGET_NO_FP_IN_TOC))) \
438 && !TARGET_NO_FP_IN_TOC \
439 && !TARGET_RELOCATABLE \
440 && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \
441 && BITS_PER_WORD == HOST_BITS_PER_INT)))))
443 /* This is the same as the dbxelf.h version, except that we need to
444 use the function code label, not the function descriptor. */
445 #undef ASM_OUTPUT_SOURCE_LINE
446 #define ASM_OUTPUT_SOURCE_LINE(FILE, LINE) \
449 static int sym_lineno = 1; \
451 ASM_GENERATE_INTERNAL_LABEL (temp, "LM", sym_lineno); \
452 fprintf (FILE, "\t.stabn 68,0,%d,", LINE); \
453 assemble_name (FILE, temp); \
457 assemble_name (FILE, \
458 XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0));\
460 (*targetm.asm_out.internal_label) (FILE, "LM", sym_lineno); \
465 /* Similarly, we want the function code label here. */
466 #define DBX_OUTPUT_BRAC(FILE, NAME, BRAC) \
470 fprintf (FILE, "%s%d,0,0,", ASM_STABN_OP, BRAC); \
471 assemble_name (FILE, NAME); \
473 if (current_function_func_begin_label != NULL_TREE) \
474 flab = IDENTIFIER_POINTER (current_function_func_begin_label); \
479 flab = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0); \
481 assemble_name (FILE, flab); \
486 #define DBX_OUTPUT_LBRAC(FILE, NAME) DBX_OUTPUT_BRAC (FILE, NAME, N_LBRAC)
487 #define DBX_OUTPUT_RBRAC(FILE, NAME) DBX_OUTPUT_BRAC (FILE, NAME, N_RBRAC)
489 /* Another case where we want the dot name. */
490 #define DBX_OUTPUT_NFUN(FILE, LSCOPE, DECL) \
493 fprintf (FILE, "%s\"\",%d,0,0,", ASM_STABS_OP, N_FUN); \
494 assemble_name (FILE, LSCOPE); \
498 assemble_name (FILE, XSTR (XEXP (DECL_RTL (DECL), 0), 0)); \
503 /* Select a format to encode pointers in exception handling data. CODE
504 is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is
505 true if the symbol may be affected by dynamic relocations. */
506 #undef ASM_PREFERRED_EH_DATA_FORMAT
507 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \
508 ((TARGET_64BIT || flag_pic || TARGET_RELOCATABLE) \
509 ? (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel \
510 | (TARGET_64BIT ? DW_EH_PE_udata8 : DW_EH_PE_sdata4)) \
513 /* For backward compatibility, we must continue to use the AIX
514 structure return convention. */
515 #undef DRAFT_V4_STRUCT_RET
516 #define DRAFT_V4_STRUCT_RET (!TARGET_64BIT)
518 #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
520 /* Do code reading to identify a signal frame, and set the frame
521 state data appropriately. See unwind-dw2.c for the structs. */
525 #include <sys/ucontext.h>
528 enum { SIGNAL_FRAMESIZE
= 128 };
530 enum { SIGNAL_FRAMESIZE
= 64 };
536 #define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \
538 unsigned char *pc_ = (CONTEXT)->ra; \
539 struct sigcontext *sc_; \
543 /* addi r1, r1, 128; li r0, 0x0077; sc (sigreturn) */ \
544 /* addi r1, r1, 128; li r0, 0x00AC; sc (rt_sigreturn) */ \
545 if (*(unsigned int *) (pc_+0) != 0x38210000 + SIGNAL_FRAMESIZE \
546 || *(unsigned int *) (pc_+8) != 0x44000002) \
548 if (*(unsigned int *) (pc_+4) == 0x38000077) \
551 char gap[SIGNAL_FRAMESIZE]; \
552 struct sigcontext sigctx; \
553 } *rt_ = (CONTEXT)->cfa; \
554 sc_ = &rt_->sigctx; \
556 else if (*(unsigned int *) (pc_+4) == 0x380000AC) \
558 struct rt_sigframe { \
560 struct siginfo *pinfo; \
561 struct ucontext *puc; \
562 } *rt_ = (struct rt_sigframe *) pc_; \
563 sc_ = &rt_->puc->uc_mcontext; \
568 new_cfa_ = sc_->regs->gpr[STACK_POINTER_REGNUM]; \
569 (FS)->cfa_how = CFA_REG_OFFSET; \
570 (FS)->cfa_reg = STACK_POINTER_REGNUM; \
571 (FS)->cfa_offset = new_cfa_ - (long) (CONTEXT)->cfa; \
573 for (i_ = 0; i_ < 32; i_++) \
574 if (i_ != STACK_POINTER_REGNUM) \
576 (FS)->regs.reg[i_].how = REG_SAVED_OFFSET; \
577 (FS)->regs.reg[i_].loc.offset \
578 = (long)&(sc_->regs->gpr[i_]) - new_cfa_; \
581 (FS)->regs.reg[LINK_REGISTER_REGNUM].how = REG_SAVED_OFFSET; \
582 (FS)->regs.reg[LINK_REGISTER_REGNUM].loc.offset \
583 = (long)&(sc_->regs->link) - new_cfa_; \
585 /* The unwinder expects the IP to point to the following insn, \
586 whereas the kernel returns the address of the actual \
587 faulting insn. We store NIP+4 in an unused register slot to \
588 get the same result for multiple evaluation of the same signal \
590 sc_->regs->gpr[47] = sc_->regs->nip + 4; \
591 (FS)->regs.reg[CR0_REGNO].how = REG_SAVED_OFFSET; \
592 (FS)->regs.reg[CR0_REGNO].loc.offset \
593 = (long)&(sc_->regs->gpr[47]) - new_cfa_; \
594 (FS)->retaddr_column = CR0_REGNO; \
600 #define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \
602 unsigned char *pc_ = (CONTEXT)->ra; \
603 struct sigcontext *sc_; \
607 /* li r0, 0x7777; sc (sigreturn old) */ \
608 /* li r0, 0x0077; sc (sigreturn new) */ \
609 /* li r0, 0x6666; sc (rt_sigreturn old) */ \
610 /* li r0, 0x00AC; sc (rt_sigreturn new) */ \
611 if (*(unsigned int *) (pc_+4) != 0x44000002) \
613 if (*(unsigned int *) (pc_+0) == 0x38007777 \
614 || *(unsigned int *) (pc_+0) == 0x38000077) \
617 char gap[SIGNAL_FRAMESIZE]; \
618 struct sigcontext sigctx; \
619 } *rt_ = (CONTEXT)->cfa; \
620 sc_ = &rt_->sigctx; \
622 else if (*(unsigned int *) (pc_+0) == 0x38006666 \
623 || *(unsigned int *) (pc_+0) == 0x380000AC) \
625 struct rt_sigframe { \
626 char gap[SIGNAL_FRAMESIZE]; \
627 unsigned long _unused[2]; \
628 struct siginfo *pinfo; \
630 struct siginfo info; \
631 struct ucontext uc; \
632 } *rt_ = (CONTEXT)->cfa; \
633 sc_ = &rt_->uc.uc_mcontext; \
638 new_cfa_ = sc_->regs->gpr[STACK_POINTER_REGNUM]; \
639 (FS)->cfa_how = CFA_REG_OFFSET; \
640 (FS)->cfa_reg = STACK_POINTER_REGNUM; \
641 (FS)->cfa_offset = new_cfa_ - (long) (CONTEXT)->cfa; \
643 for (i_ = 0; i_ < 32; i_++) \
644 if (i_ != STACK_POINTER_REGNUM) \
646 (FS)->regs.reg[i_].how = REG_SAVED_OFFSET; \
647 (FS)->regs.reg[i_].loc.offset \
648 = (long)&(sc_->regs->gpr[i_]) - new_cfa_; \
651 (FS)->regs.reg[LINK_REGISTER_REGNUM].how = REG_SAVED_OFFSET; \
652 (FS)->regs.reg[LINK_REGISTER_REGNUM].loc.offset \
653 = (long)&(sc_->regs->link) - new_cfa_; \
655 /* The unwinder expects the IP to point to the following insn, \
656 whereas the kernel returns the address of the actual \
657 faulting insn. We store NIP+4 in an unused register slot to \
658 get the same result for multiple evaluation of the same signal \
660 sc_->regs->gpr[47] = sc_->regs->nip + 4; \
661 (FS)->regs.reg[CR0_REGNO].how = REG_SAVED_OFFSET; \
662 (FS)->regs.reg[CR0_REGNO].loc.offset \
663 = (long)&(sc_->regs->gpr[47]) - new_cfa_; \
664 (FS)->retaddr_column = CR0_REGNO; \