From e3726b056b3b1cfde7019e29d5d3c50ce70e08e9 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Thu, 31 Aug 1995 17:33:01 +0000 Subject: Rewrote i386 setjmp in assembly. Thu Aug 31 13:23:35 1995 Roland McGrath * sysdeps/unix/i386/brk.S [PIC]: Set __curbrk through the GOT. Rewrote i386 setjmp code in assembly, so as to avoid fighting with the compiler for the register values. * sysdeps/i386/setjmp.S, sysdeps/i386/__longjmp.S: New files. * sysdeps/i386/setjmp.c, sysdeps/i386/__longjmp.c: Files removed. * sysdeps/i386/jmp_buf.h [! _ASM] (__jmp_buf): Define as array of ints. [__USE_MISC || _ASM] (JB_*): New macros, for indices therein. (_JMPBUF_UNWINDS): Use JB_SP. --- sysdeps/i386/jmp_buf.h | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'sysdeps/i386/jmp_buf.h') diff --git a/sysdeps/i386/jmp_buf.h b/sysdeps/i386/jmp_buf.h index 7949883b60..0c03073b36 100644 --- a/sysdeps/i386/jmp_buf.h +++ b/sysdeps/i386/jmp_buf.h @@ -1,14 +1,19 @@ /* Define the machine-dependent type `jmp_buf'. Intel 386 version. */ -typedef struct - { - long int __bx, __si, __di; - __ptr_t __bp; - __ptr_t __sp; - __ptr_t __pc; - } __jmp_buf[1]; +#if defined (__USE_MISC) || defined (_ASM) +#define JB_BX 0 +#define JB_SI 1 +#define JB_DI 2 +#define JB_BP 3 +#define JB_SP 4 +#define JB_PC 5 +#endif + +#ifndef _ASM +typedef int __jmp_buf[6]; +#endif /* Test if longjmp to JMPBUF would unwind the frame containing a local variable at ADDRESS. */ #define _JMPBUF_UNWINDS(jmpbuf, address) \ - ((__ptr_t) (address) < (jmpbuf)[0].__sp) + ((int) (address) < (jmpbuf)[JB_SP]) -- cgit v1.2.3