From 09e967c2d732783b2579e4e120cd9b608404cb00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwenol=C3=A9=20Beauchesne?= Date: Wed, 4 Jun 2003 18:31:57 +0000 Subject: Merge from R9_0-AMD64, most notably: - AMD64 support to insmod-busybox, minilibc, et al. - Sync with insmod-modutils 2.4.19 something but everyone should use dietlibc nowadays - Factor out compilation and prefix with $(DIET) for dietlibc builds - 64-bit & varargs fixes --- mdk-stage1/dietlibc/include/setjmp.h | 152 ++++++++++++++++++++++++++++++----- 1 file changed, 130 insertions(+), 22 deletions(-) (limited to 'mdk-stage1/dietlibc/include/setjmp.h') diff --git a/mdk-stage1/dietlibc/include/setjmp.h b/mdk-stage1/dietlibc/include/setjmp.h index 66fc288f4..b591936ac 100644 --- a/mdk-stage1/dietlibc/include/setjmp.h +++ b/mdk-stage1/dietlibc/include/setjmp.h @@ -16,6 +16,42 @@ typedef int __jmp_buf[6]; # define JB_SIZE 24 #endif +#ifdef __x86_64__ +#ifndef __ASSEMBLER__ +typedef long __jmp_buf[8]; +#endif +# define JB_RBX 0 +# define JB_RBP 1 +# define JB_R12 2 +# define JB_R13 3 +# define JB_R14 4 +# define JB_R15 5 +# define JB_RSP 6 +# define JB_PC 7 +# define JB_SIZE 64 +#endif + +#ifdef __s390__ +#ifndef __ASSEMBLER__ +typedef struct { + long int gregs[10]; + long fpregs[4]; +} __jmp_buf[1]; +#endif +#define __JB_GPR6 0 +#define __JB_GPR7 1 +#define __JB_GPR8 2 +#define __JB_GPR9 3 +#define __JB_GPR10 4 +#define __JB_GPR11 5 +#define __JB_GPR12 6 +#define __JB_GPR13 7 +#define __JB_GPR14 8 +#define __JB_GPR15 9 + +#define _JMPBUF_UNWINDS(jmpbuf, address) ((int) (address) < (jmpbuf)->gregs[__JB_GPR15]) +#endif + #ifdef __alpha__ #define JB_S0 0 #define JB_S1 1 @@ -55,18 +91,80 @@ typedef struct #endif #ifdef __sparc__ +#ifdef __arch64__ + +#define MC_TSTATE 0 +#define MC_PC 1 +#define MC_NPC 2 +#define MC_Y 3 +#define MC_G1 4 +#define MC_G2 5 +#define MC_G3 6 +#define MC_G4 7 +#define MC_G5 8 +#define MC_G6 9 +#define MC_G7 10 +#define MC_O0 11 +#define MC_O1 12 +#define MC_O2 13 +#define MC_O3 14 +#define MC_O4 15 +#define MC_O5 16 +#define MC_O6 17 +#define MC_O7 18 +#define MC_NGREG 19 + +#define FLAG_SAVEMASK 512 +#ifndef __ASSEMBLER__ +#include + +/* this equal to ucontext from "include/asm-sparc64/uctx.h" */ +typedef struct __sparc64_jmp_buf { + struct __sparc64_jmp_buf *uc_link; + unsigned long uc_flags; + sigset_t uc_sigmask; + struct { + unsigned long mc_gregs[MC_NGREG]; + unsigned long mc_fp; + unsigned long mc_i7; + struct { + union { + unsigned int sregs[32]; + unsigned long dregs[32]; + long double qregs[16]; + } mcfpu_fregs; + unsigned long mcfpu_fsr; + unsigned long mcfpu_fprs; + unsigned long mcfpu_gsr; + struct { + unsigned long *mcfq_addr; + unsigned int mcfq_insn; + } *mcfpu_fq; + unsigned char mcfpu_qcnt; + unsigned char mcfpu_qentsz; + unsigned char mcfpu_enab; + } mc_fpregs; + } uc_mcontext; +} __jmp_buf[1]; + +#endif + +#else + #define JB_SP 0 #define JB_FP 1 #define JB_PC 2 #ifndef __ASSEMBLER__ typedef int __jmp_buf[3]; +#endif + #endif #endif #ifdef __arm__ #define __JMP_BUF_SP 8 #ifndef __ASSEMBLER__ -typedef int __jmp_buf[10]; +typedef int __jmp_buf[24]; #endif #endif @@ -83,39 +181,49 @@ typedef long int __jmp_buf[58]; #endif #endif +#ifdef __hppa__ #ifndef __ASSEMBLER__ +typedef double __jmp_buf[21]; +#endif +#endif -typedef int sig_atomic_t; -#define __sig_atomic_t sig_atomic_t +#ifdef __ia64__ +#ifndef __ASSEMBLER__ +typedef long __jmp_buf[70] __attribute__ ((aligned(16))); +#endif +#endif -# define _SIGSET_NWORDS (1024 / (8 * sizeof (unsigned long int))) -typedef struct - { - unsigned long int __val[_SIGSET_NWORDS]; - } __sigset_t; +#ifndef __ASSEMBLER__ +#include + +/* typedef int sig_atomic_t; */ +#define __sig_atomic_t sig_atomic_t /* Calling environment, plus possibly a saved signal mask. */ -typedef struct __jmp_buf_tag /* C++ doesn't like tagless structs. */ - { - /* NOTE: The machine-dependent definitions of `__sigsetjmp' - assume that a `jmp_buf' begins with a `__jmp_buf'. - Do not move this member or add others before it. */ - __jmp_buf __jmpbuf; /* Calling environment. */ - int __mask_was_saved; /* Saved the signal mask? */ - __sigset_t __saved_mask; /* Saved signal mask. */ - } jmp_buf[1]; +typedef struct __jmp_buf_tag { /* C++ doesn't like tagless structs. */ +/* NOTE: The machine-dependent definitions of `__sigsetjmp' + * assume that a `jmp_buf' begins with a `__jmp_buf'. + * Do not move this member or add others before it. */ + __jmp_buf __jmpbuf; /* Calling environment. */ + int __mask_was_saved; /* Saved the signal mask? */ + sigset_t __saved_mask; /* Saved signal mask. */ +} jmp_buf[1]; -extern int __sigsetjmp (jmp_buf __env, int __savemask) __THROW; +extern int __sigsetjmp(jmp_buf __env,int __savemask) __THROW; -extern void longjmp (jmp_buf __env, int __val) - __THROW __attribute__ ((__noreturn__)); +extern void longjmp(jmp_buf __env,int __val) + __THROW __attribute__((__noreturn__)); typedef jmp_buf sigjmp_buf; -extern void siglongjmp (sigjmp_buf __env, int __val) - __THROW __attribute__ ((__noreturn__)); +extern void siglongjmp(sigjmp_buf __env,int __val) + __THROW __attribute__((__noreturn__)); +#ifdef _BSD_SOURCE +#define setjmp(env) __sigsetjmp(env,1) +#else #define setjmp(env) __sigsetjmp(env,0) +#endif #define sigsetjmp(a,b) __sigsetjmp(a,b) #endif -- cgit v1.2.1