summaryrefslogtreecommitdiff
path: root/gcc/config/ia64/linux.h
diff options
context:
space:
mode:
authoramodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-08 00:17:19 +0000
committeramodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-08 00:17:19 +0000
commitaebd6cb6ec855cc4f9a07a694847b4a19fe5759a (patch)
treef6927bd90fe84c682dd04619d255d6355aac36d5 /gcc/config/ia64/linux.h
parent97307e4d7dc6478c0d70de1816c9009a100f5542 (diff)
downloadgcc-aebd6cb6ec855cc4f9a07a694847b4a19fe5759a.tar.gz
* doc/tm.texi (MD_UNWIND_SUPPORT): Document.
(MD_FALLBACK_FRAME_STATE_FOR): Update. * unwind-dw2.c (MD_UNWIND_SUPPORT): #include if defined. (uw_frame_state_for): Adjust MD_FALLBACK_FRAME_STATE_FOR invocation. (MD_FROB_UPDATE_CONTEXT): Remove default. (uw_update_context_1): Instead #ifdef invocation. * config/ia64/unwind-ia64.c (MD_UNWIND_SUPPORT): #include if defined. (uw_frame_state_for): Adjust MD_FALLBACK_FRAME_STATE_FOR invocation. * config/alpha/gnu.h (MD_FALLBACK_FRAME_STATE_FOR): Don't undef. (MD_UNWIND_SUPPORT): Undefine this instead. * config/i386/gnu.h: Likewise. * config/alpha/linux-unwind.h: New file, macro converted to function, extracted from.. * config/alpha/linux.h (MD_FALLBACK_FRAME_STATE_FOR): ..this. (MD_UNWIND_SUPPORT): Define. * config/alpha/vms-unwind.h, config/alpha/vms.h: Likewise. * config/i386/linux-unwind.h, config/i386/linux.h, config/i386/linux64.h: Likewise. * config/ia64/linux-unwind.h, config/ia64/linux.h: Likewise. MD_HANDLE_UNWABI too. * config/mips/linux-unwind.h, config/mips/linux.h: Likewise. * config/pa/linux-unwind.h, config/pa/pa32-linux.h: Likewise. * config/rs6000/darwin-unwind.h, config/rs6000/darwin.h: Likewise. * config/s390/linux-unwind.h, config/s390/linux.h: Likewise. * config/sparc/linux-unwind.h, config/sparc/linux.h, config/sparc/linux64.h: Likewise. * config/sh/linux-unwind.h, config/sh/linux.h: Likewise, but merge SH_FALLBACK_FRAME_FLOAT_STATE into sh_fallback_frame_state. * config/rs6000/linux-unwind.h, config/rs6000/linux.h, config/rs6000/linux64.h: Likewise. Split out get_sigcontext function. Use ARG_POINTER_REGNUM for 32-bit temp reg too. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87167 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/ia64/linux.h')
-rw-r--r--gcc/config/ia64/linux.h159
1 files changed, 1 insertions, 158 deletions
diff --git a/gcc/config/ia64/linux.h b/gcc/config/ia64/linux.h
index 5c73b0c25ef..3d585609f61 100644
--- a/gcc/config/ia64/linux.h
+++ b/gcc/config/ia64/linux.h
@@ -55,161 +55,4 @@ do { \
#undef LINK_EH_SPEC
#define LINK_EH_SPEC ""
-/* Do code reading to identify a signal frame, and set the frame
- state data appropriately. See unwind-dw2.c for the structs. */
-
-/* This works only for glibc-2.3 and later, because sigcontext is different
- in glibc-2.2.4. */
-
-#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)
-
-#ifdef IN_LIBGCC2
-#include <signal.h>
-#include <sys/ucontext.h>
-
-#define IA64_GATE_AREA_START 0xa000000000000100LL
-#define IA64_GATE_AREA_END 0xa000000000030000LL
-
-#define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \
- if ((CONTEXT)->rp >= IA64_GATE_AREA_START \
- && (CONTEXT)->rp < IA64_GATE_AREA_END) \
- { \
- struct sigframe { \
- char scratch[16]; \
- unsigned long sig_number; \
- struct siginfo *info; \
- struct sigcontext *sc; \
- } *frame_ = (struct sigframe *)(CONTEXT)->psp; \
- struct sigcontext *sc_ = frame_->sc; \
- \
- /* Restore scratch registers in case the unwinder needs to \
- refer to a value stored in one of them. */ \
- { \
- int i_; \
- \
- for (i_ = 2; i_ < 4; i_++) \
- (CONTEXT)->ireg[i_ - 2].loc = &sc_->sc_gr[i_]; \
- for (i_ = 8; i_ < 12; i_++) \
- (CONTEXT)->ireg[i_ - 2].loc = &sc_->sc_gr[i_]; \
- for (i_ = 14; i_ < 32; i_++) \
- (CONTEXT)->ireg[i_ - 2].loc = &sc_->sc_gr[i_]; \
- } \
- \
- (CONTEXT)->fpsr_loc = &(sc_->sc_ar_fpsr); \
- (CONTEXT)->pfs_loc = &(sc_->sc_ar_pfs); \
- (CONTEXT)->lc_loc = &(sc_->sc_ar_lc); \
- (CONTEXT)->unat_loc = &(sc_->sc_ar_unat); \
- (CONTEXT)->br_loc[0] = &(sc_->sc_br[0]); \
- (CONTEXT)->br_loc[6] = &(sc_->sc_br[6]); \
- (CONTEXT)->br_loc[7] = &(sc_->sc_br[7]); \
- (CONTEXT)->pr = sc_->sc_pr; \
- (CONTEXT)->psp = sc_->sc_gr[12]; \
- (CONTEXT)->gp = sc_->sc_gr[1]; \
- /* Signal frame doesn't have an associated reg. stack frame \
- other than what we adjust for below. */ \
- (FS) -> no_reg_stack_frame = 1; \
- \
- if (sc_->sc_rbs_base) \
- { \
- /* Need to switch from alternate register backing store. */ \
- long ndirty, loadrs = sc_->sc_loadrs >> 16; \
- unsigned long alt_bspstore = (CONTEXT)->bsp - loadrs; \
- unsigned long bspstore; \
- unsigned long *ar_bsp = (unsigned long *)(sc_->sc_ar_bsp); \
- \
- ndirty = ia64_rse_num_regs ((unsigned long *) alt_bspstore, \
- (unsigned long *) (CONTEXT)->bsp);\
- bspstore = (unsigned long) \
- ia64_rse_skip_regs (ar_bsp, -ndirty); \
- ia64_copy_rbs ((CONTEXT), bspstore, alt_bspstore, loadrs, \
- sc_->sc_ar_rnat); \
- } \
- \
- /* Don't touch the branch registers o.t. b0, b6 and b7. \
- The kernel doesn't pass the preserved branch registers \
- in the sigcontext but leaves them intact, so there's no \
- need to do anything with them here. */ \
- { \
- unsigned long sof = sc_->sc_cfm & 0x7f; \
- (CONTEXT)->bsp = (unsigned long) \
- ia64_rse_skip_regs ((unsigned long *)(sc_->sc_ar_bsp), -sof); \
- } \
- \
- (FS)->curr.reg[UNW_REG_RP].where = UNW_WHERE_SPREL; \
- (FS)->curr.reg[UNW_REG_RP].val \
- = (unsigned long)&(sc_->sc_ip) - (CONTEXT)->psp; \
- (FS)->curr.reg[UNW_REG_RP].when = -1; \
- \
- goto SUCCESS; \
- }
-
-#define MD_HANDLE_UNWABI(CONTEXT, FS) \
- if ((FS)->unwabi == ((3 << 8) | 's') \
- || (FS)->unwabi == ((0 << 8) | 's')) \
- { \
- struct sigframe { \
- char scratch[16]; \
- unsigned long sig_number; \
- struct siginfo *info; \
- struct sigcontext *sc; \
- } *frame_ = (struct sigframe *)(CONTEXT)->psp; \
- struct sigcontext *sc_ = frame_->sc; \
- \
- /* Restore scratch registers in case the unwinder needs to \
- refer to a value stored in one of them. */ \
- { \
- int i_; \
- \
- for (i_ = 2; i_ < 4; i_++) \
- (CONTEXT)->ireg[i_ - 2].loc = &sc_->sc_gr[i_]; \
- for (i_ = 8; i_ < 12; i_++) \
- (CONTEXT)->ireg[i_ - 2].loc = &sc_->sc_gr[i_]; \
- for (i_ = 14; i_ < 32; i_++) \
- (CONTEXT)->ireg[i_ - 2].loc = &sc_->sc_gr[i_]; \
- } \
- \
- (CONTEXT)->pfs_loc = &(sc_->sc_ar_pfs); \
- (CONTEXT)->lc_loc = &(sc_->sc_ar_lc); \
- (CONTEXT)->unat_loc = &(sc_->sc_ar_unat); \
- (CONTEXT)->br_loc[0] = &(sc_->sc_br[0]); \
- (CONTEXT)->br_loc[6] = &(sc_->sc_br[6]); \
- (CONTEXT)->br_loc[7] = &(sc_->sc_br[7]); \
- (CONTEXT)->pr = sc_->sc_pr; \
- (CONTEXT)->gp = sc_->sc_gr[1]; \
- /* Signal frame doesn't have an associated reg. stack frame \
- other than what we adjust for below. */ \
- (FS) -> no_reg_stack_frame = 1; \
- \
- if (sc_->sc_rbs_base) \
- { \
- /* Need to switch from alternate register backing store. */ \
- long ndirty, loadrs = sc_->sc_loadrs >> 16; \
- unsigned long alt_bspstore = (CONTEXT)->bsp - loadrs; \
- unsigned long bspstore; \
- unsigned long *ar_bsp = (unsigned long *)(sc_->sc_ar_bsp); \
- \
- ndirty = ia64_rse_num_regs ((unsigned long *) alt_bspstore, \
- (unsigned long *) (CONTEXT)->bsp);\
- bspstore = (unsigned long) \
- ia64_rse_skip_regs (ar_bsp, -ndirty); \
- ia64_copy_rbs ((CONTEXT), bspstore, alt_bspstore, loadrs, \
- sc_->sc_ar_rnat); \
- } \
- \
- /* Don't touch the branch registers o.t. b0, b6 and b7. \
- The kernel doesn't pass the preserved branch registers \
- in the sigcontext but leaves them intact, so there's no \
- need to do anything with them here. */ \
- { \
- unsigned long sof = sc_->sc_cfm & 0x7f; \
- (CONTEXT)->bsp = (unsigned long) \
- ia64_rse_skip_regs ((unsigned long *)(sc_->sc_ar_bsp), -sof); \
- } \
- \
- /* pfs_loc already set above. Without this pfs_loc would point \
- incorrectly to sc_cfm instead of sc_ar_pfs. */ \
- (FS)->curr.reg[UNW_REG_PFS].where = UNW_WHERE_NONE; \
- }
-
-#endif /* IN_LIBGCC2 */
-#endif /* glibc-2.3 or better */
+#define MD_UNWIND_SUPPORT "config/ia64/linux-unwind.h"