diff options
author | Per Fogelstrom <pefo@cvs.openbsd.org> | 2004-09-09 16:59:22 +0000 |
---|---|---|
committer | Per Fogelstrom <pefo@cvs.openbsd.org> | 2004-09-09 16:59:22 +0000 |
commit | e91cc6723df7f95e8a014cdea13b5d2f3629e82d (patch) | |
tree | e0986061fff176f4fb3f6edc61a003c612477d2a | |
parent | 9d35151f4ec58d4d86848410b2a70b9f30be6fa7 (diff) |
couple of changes (int -> long) to handle 64 bits.
-rw-r--r-- | lib/libpthread/arch/mips64/uthread_machdep.c | 21 | ||||
-rw-r--r-- | lib/libpthread/arch/mips64/uthread_machdep.h | 4 | ||||
-rw-r--r-- | lib/libpthread/arch/mips64/uthread_machdep_asm.S | 64 |
3 files changed, 45 insertions, 44 deletions
diff --git a/lib/libpthread/arch/mips64/uthread_machdep.c b/lib/libpthread/arch/mips64/uthread_machdep.c index c2e47db96ad..dcfaf23f5b2 100644 --- a/lib/libpthread/arch/mips64/uthread_machdep.c +++ b/lib/libpthread/arch/mips64/uthread_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uthread_machdep.c,v 1.1 2004/08/11 17:41:34 pefo Exp $ */ +/* $OpenBSD: uthread_machdep.c,v 1.2 2004/09/09 16:59:21 pefo Exp $ */ /* David Leonard, <d@csee.uq.edu.au>. Public domain. */ /* @@ -11,13 +11,14 @@ #define ALIGNBYTES 0x3 struct frame { - int s[9]; /* s0..s7 */ - int _fill; + long s[9]; /* s0..s7 */ + long _fill; double f[3]; /* $f0..$f2 */ - int t9; /* XXX only used when bootstrapping */ - int ra; + long t9; /* XXX only used when bootstrapping */ + long ra; - int arg[4], cra, cfp; /* ABI space for debuggers */ +/* XXX args should not be here for N32 or N64 ABIs */ + long arg[4], cra, cfp; /* ABI space for debuggers */ }; /* @@ -34,13 +35,13 @@ _thread_machdep_init(statep, base, len, entry) struct frame *f; /* Locate the initial frame, aligned at the top of the stack */ - f = (struct frame *)(((int)base + len - sizeof *f) & ~ALIGNBYTES); + f = (struct frame *)(((long)base + len - sizeof *f) & ~ALIGNBYTES); f->cra = f->cfp = 0; /* for debugger */ - f->ra = (int)entry; - f->t9 = (int)entry; + f->ra = (long)entry; + f->t9 = (long)entry; - statep->frame = (int)f; + statep->frame = (long)f; } void diff --git a/lib/libpthread/arch/mips64/uthread_machdep.h b/lib/libpthread/arch/mips64/uthread_machdep.h index 7e95f299456..e3d31729b7b 100644 --- a/lib/libpthread/arch/mips64/uthread_machdep.h +++ b/lib/libpthread/arch/mips64/uthread_machdep.h @@ -1,6 +1,6 @@ -/* $OpenBSD: uthread_machdep.h,v 1.1 2004/08/11 17:41:34 pefo Exp $ */ +/* $OpenBSD: uthread_machdep.h,v 1.2 2004/09/09 16:59:21 pefo Exp $ */ /* David Leonard, <d@csee.uq.edu.au>. Public domain. */ struct _machdep_state { - int frame; + long frame; }; diff --git a/lib/libpthread/arch/mips64/uthread_machdep_asm.S b/lib/libpthread/arch/mips64/uthread_machdep_asm.S index b6e8943f336..d289596748f 100644 --- a/lib/libpthread/arch/mips64/uthread_machdep_asm.S +++ b/lib/libpthread/arch/mips64/uthread_machdep_asm.S @@ -1,52 +1,52 @@ -/* $OpenBSD: uthread_machdep_asm.S,v 1.1 2004/08/11 17:41:34 pefo Exp $ */ +/* $OpenBSD: uthread_machdep_asm.S,v 1.2 2004/09/09 16:59:21 pefo Exp $ */ /* David Leonard, <d@csee.uq.edu.au>. Public domain. */ #include <machine/asm.h> -#define SOFF(n) ((n)*4) -#define FPOFF(n) (SOFF(9) + 4 + (n)*8) -#define REGOFF(n) (FPOFF(3) + (n)*4) +#define SOFF(n) ((n)*REGSZ) +#define FPOFF(n) (SOFF(9) + REGSZ + (n)*8) +#define REGOFF(n) (FPOFF(3) + (n)*REGSZ) -#define FRAMESIZE (REGOFF(2) + 4*4+4+4) +#define FRAMESIZE (REGOFF(2) + REGSZ*4+REGSZ+REGSZ) NON_LEAF(_thread_machdep_switch, FRAMESIZE, ra) - add sp, sp, -FRAMESIZE - - sw s0, SOFF(0)(sp) - sw s1, SOFF(1)(sp) - sw s2, SOFF(2)(sp) - sw s3, SOFF(3)(sp) - sw s4, SOFF(4)(sp) - sw s5, SOFF(5)(sp) - sw s6, SOFF(6)(sp) - sw s7, SOFF(7)(sp) - sw s8, SOFF(8)(sp) + PTR_ADDU sp, sp, -FRAMESIZE + + REG_S s0, SOFF(0)(sp) + REG_S s1, SOFF(1)(sp) + REG_S s2, SOFF(2)(sp) + REG_S s3, SOFF(3)(sp) + REG_S s4, SOFF(4)(sp) + REG_S s5, SOFF(5)(sp) + REG_S s6, SOFF(6)(sp) + REG_S s7, SOFF(7)(sp) + REG_S s8, SOFF(8)(sp) s.d $f0, FPOFF(0)(sp) /* XXX why? */ s.d $f2, FPOFF(1)(sp) s.d $f4, FPOFF(2)(sp) - sw t9, REGOFF(0)(sp) - sw ra, REGOFF(1)(sp) + REG_S t9, REGOFF(0)(sp) + REG_S ra, REGOFF(1)(sp) - sw sp, 0(a1) - lw sp, 0(a0) + REG_S sp, 0(a1) + REG_L sp, 0(a0) .set noreorder /* avoid nops */ - lw ra, REGOFF(1)(sp) - lw t9, REGOFF(0)(sp) + REG_L ra, REGOFF(1)(sp) + REG_L t9, REGOFF(0)(sp) l.d $f4, FPOFF(2)(sp) l.d $f2, FPOFF(1)(sp) l.d $f0, FPOFF(0)(sp) - lw s8, SOFF(8)(sp) - lw s7, SOFF(7)(sp) - lw s6, SOFF(6)(sp) - lw s5, SOFF(5)(sp) - lw s4, SOFF(4)(sp) - lw s3, SOFF(3)(sp) - lw s2, SOFF(2)(sp) - lw s1, SOFF(1)(sp) - lw s0, SOFF(0)(sp) + REG_L s8, SOFF(8)(sp) + REG_L s7, SOFF(7)(sp) + REG_L s6, SOFF(6)(sp) + REG_L s5, SOFF(5)(sp) + REG_L s4, SOFF(4)(sp) + REG_L s3, SOFF(3)(sp) + REG_L s2, SOFF(2)(sp) + REG_L s1, SOFF(1)(sp) + REG_L s0, SOFF(0)(sp) .set reorder - add sp, sp, FRAMESIZE + PTR_ADDU sp, sp, FRAMESIZE j ra END(_thread_machdep_switch) |