diff options
-rw-r--r-- | lib/libc/ia64/gen/_setjmp.S | 14 | ||||
-rw-r--r-- | lib/libc/ia64/gen/setjmp.S | 14 | ||||
-rw-r--r-- | lib/libc/ia64/gen/sigsetjmp.S | 16 | ||||
-rw-r--r-- | sys/ia64/include/setjmp.h | 47 |
4 files changed, 23 insertions, 68 deletions
diff --git a/lib/libc/ia64/gen/_setjmp.S b/lib/libc/ia64/gen/_setjmp.S index e4e90b2..1357cfa 100644 --- a/lib/libc/ia64/gen/_setjmp.S +++ b/lib/libc/ia64/gen/_setjmp.S @@ -69,13 +69,6 @@ // ENTRY(_setjmp, 1) - // - // Make sure buffer is aligned at 16byte boundary - // - add r10 = -0x10,r0 ;; // mask the lower 4 bits - and r32 = r32, r10;; - add r32 = 0x10, r32;; // move to next 16 byte boundary - add r10 = J_PREDS, r32 // skip Unats & pfs save area add r11 = J_BSP, r32 // @@ -200,13 +193,6 @@ END(_setjmp) WEAK_ALIAS(_longjmp,___longjmp) ENTRY(___longjmp, 2) // - // Make sure buffer is aligned at 16byte boundary - // - add r10 = -0x10,r0 ;; // mask the lower 4 bits - and r32 = r32, r10;; - add r32 = 0x10, r32;; // move to next 16 byte boundary - - // // caching the return value as we do invala in the end // mov r8 = r33 // return value diff --git a/lib/libc/ia64/gen/setjmp.S b/lib/libc/ia64/gen/setjmp.S index 0ba630b..817e333 100644 --- a/lib/libc/ia64/gen/setjmp.S +++ b/lib/libc/ia64/gen/setjmp.S @@ -46,14 +46,10 @@ ENTRY(setjmp, 1) alloc loc0=ar.pfs,1,2,3,0 mov loc1=rp - // - // Compensate for the pointer twiddling that setjmp does. - // - dep r14=r0,r32,0,4 - ;; + ;; mov out0=1 // how = SIG_BLOCK mov out1=0 // set = NULL - add out2=J_SIG0+0x10,r14 // oset = &jb[J_SIG0] + add out2=J_SIG0,in0 // oset = &jb[J_SIG0] br.call.sptk.few rp=__sys_sigprocmask ;; mov rp=loc1 @@ -69,13 +65,9 @@ END(setjmp) ENTRY(__longjmp, 2) alloc loc0=ar.pfs,2,2,3,0 mov loc1=rp - // - // Compensate for the pointer twiddling that setjmp does. - // - dep r14=r0,r32,0,4 ;; mov out0=3 // how = SIG_SETMASK - add out1=J_SIG0+0x10,r14 // set = &jb[J_SIG0] + add out1=J_SIG0,in0 // set = &jb[J_SIG0] mov out2=0 // oset = NULL br.call.sptk.few rp=__sys_sigprocmask ;; diff --git a/lib/libc/ia64/gen/sigsetjmp.S b/lib/libc/ia64/gen/sigsetjmp.S index e3a9768..37e6f95 100644 --- a/lib/libc/ia64/gen/sigsetjmp.S +++ b/lib/libc/ia64/gen/sigsetjmp.S @@ -45,27 +45,17 @@ */ ENTRY(sigsetjmp, 2) - // - // Compensate for the pointer twiddling that setjmp does. - // - dep r14=r0,r32,0,4 - ;; - add r14=J_SIGMASK+0x10,r14 // place to save mask + add r14=J_SIGMASK,in0 // place to save mask + cmp.ne p6,p7=0,in1 // save signal state? ;; st8 [r14]=in1 // save mask value - cmp.ne p6,p7=0,in1 // save signal state? (p6) br.cond.dptk.many setjmp (p7) br.cond.dpnt.many _setjmp END(sigsetjmp) WEAK_ALIAS(siglongjmp,__siglongjmp) ENTRY(__siglongjmp, 2) - // - // Compensate for the pointer twiddling that setjmp does. - // - dep r14=r0,r32,0,4 - ;; - add r14=J_SIGMASK+0x10,r14 // address of mask value + add r14=J_SIGMASK,in0 // address of mask value ;; ld8 r14=[r14] ;; diff --git a/sys/ia64/include/setjmp.h b/sys/ia64/include/setjmp.h index ac4f35a..c74cbad 100644 --- a/sys/ia64/include/setjmp.h +++ b/sys/ia64/include/setjmp.h @@ -44,26 +44,8 @@ #include <sys/cdefs.h> -/* - * IA64 assembler doesn't like C style comments. This also means we can't - * include other include files to get things like the roundup2() macro. - * - * NOTE: Actual register storage must start on a 16 byte boundary. Both - * setjmp and longjmp make that adjustment before referencing the contents - * of jmp_buf. The macro JMPBUF_ADDR_OF() allows someone to get the address - * of an individual item saved in jmp_buf. - */ - -#if __BSD_VISIBLE -#define our_roundup(x, y) (((x)+((y)-1))&(~((y)-1))) -#endif - -#define _JMPBUF_ALIGNMENT 0x10 - #if __BSD_VISIBLE -#define JMPBUF_ALIGNMENT _JMPBUF_ALIGNMENT -#define JMPBUF_ADDR_OF(buf, item) \ - ((size_t)((our_roundup((size_t)buf, JMPBUF_ALIGNMENT)) + item)) +#define JMPBUF_ADDR_OF(buf, item) ((unsigned long)((char *)buf + item)) #define J_UNAT 0 #define J_NATS 0x8 @@ -109,10 +91,11 @@ #define J_SIGMASK 0x1e8 #endif /* __BSD_VISIBLE */ -#define _J_END 0x1f0 -#if __BSD_VISIBLE -#define J_END _J_END -#endif +/* + * We have 16 bytes left for future use, but it's a nice round, + * but above all large number. Size is in bytes. + */ +#define _JMPBUFSZ 0x200 /* * XXX this check is wrong, since LOCORE is in the application namespace and @@ -123,20 +106,24 @@ * implementation. */ #ifndef LOCORE + /* * jmp_buf and sigjmp_buf are encapsulated in different structs to force * compile-time diagnostics for mismatches. The structs are the same * internally to avoid some run-time errors for mismatches. */ #if __BSD_VISIBLE || __POSIX_VISIBLE || __XSI_VISIBLE -typedef struct _sigjmp_buf { - char _Buffer[_J_END + _JMPBUF_ALIGNMENT]; -} sigjmp_buf[1]; +struct _sigjmp_buf { + char _Buffer[_JMPBUFSZ]; +} __aligned(16); +typedef struct _sigjmp_buf sigjmp_buf[1]; #endif -typedef struct _jmp_buf { - char _Buffer[ _J_END + _JMPBUF_ALIGNMENT ]; -} jmp_buf[1]; -#endif +struct _jmp_buf { + char _Buffer[_JMPBUFSZ]; +} __aligned(16); +typedef struct _jmp_buf jmp_buf[1]; + +#endif /* !LOCORE */ #endif /* !_MACHINE_SETJMP_H_ */ |