diff options
author | deischen <deischen@FreeBSD.org> | 2003-10-09 14:48:09 +0000 |
---|---|---|
committer | deischen <deischen@FreeBSD.org> | 2003-10-09 14:48:09 +0000 |
commit | 69eb1f0d3407cba3cea24625c544f99612b0a74e (patch) | |
tree | d8832157dd01e372889bda2d3710524c2d8d950f /lib | |
parent | a2ab5a4d04768486956ff22b79e869f67ab2b1ba (diff) | |
download | FreeBSD-src-69eb1f0d3407cba3cea24625c544f99612b0a74e.zip FreeBSD-src-69eb1f0d3407cba3cea24625c544f99612b0a74e.tar.gz |
Convert a couple of hardcoded values to constants. Make thr_getcontext()
return 0 when called the first time, and return 1 when resumed by
thr_setcontext().
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libkse/arch/sparc64/sparc64/assym.s | 2 | ||||
-rw-r--r-- | lib/libkse/arch/sparc64/sparc64/thr_getcontext.S | 8 | ||||
-rw-r--r-- | lib/libpthread/arch/sparc64/sparc64/assym.s | 2 | ||||
-rw-r--r-- | lib/libpthread/arch/sparc64/sparc64/thr_getcontext.S | 8 |
4 files changed, 14 insertions, 6 deletions
diff --git a/lib/libkse/arch/sparc64/sparc64/assym.s b/lib/libkse/arch/sparc64/sparc64/assym.s index 414163b..3e22c9f 100644 --- a/lib/libkse/arch/sparc64/sparc64/assym.s +++ b/lib/libkse/arch/sparc64/sparc64/assym.s @@ -7,6 +7,8 @@ #define UC_MCONTEXT 0x40 +#define MC_FLAGS 0x0 +#define MC_VALID_FLAGS 0x1 #define MC_GLOBAL 0x0 #define MC_OUT 0x40 #define MC_TPC 0xc8 diff --git a/lib/libkse/arch/sparc64/sparc64/thr_getcontext.S b/lib/libkse/arch/sparc64/sparc64/thr_getcontext.S index 9c36bf5..d855dac 100644 --- a/lib/libkse/arch/sparc64/sparc64/thr_getcontext.S +++ b/lib/libkse/arch/sparc64/sparc64/thr_getcontext.S @@ -37,10 +37,12 @@ ENTRY(__thr_getcontext) stx %sp, [%o0 + MC_OUT + (6 * 8)] stx %o1, [%o0 + MC_TPC] stx %o2, [%o0 + MC_TNPC] - mov 1, %l0 # Validate the context. - stx %l0, [%o0 + MC_GLOBAL] + mov MC_VALID_FLAGS, %l0 /* Validate the context. */ + stx %l0, [%o0 + MC_FLAGS] + mov 1, %l0 + stx %l0, [%o0 + MC_OUT + (0 * 8)] /* return 1 when resumed */ retl - nop + mov 0, %o0 /* return 0 */ END(__thr_getcontext) .weak CNAME(_thr_setcontext) diff --git a/lib/libpthread/arch/sparc64/sparc64/assym.s b/lib/libpthread/arch/sparc64/sparc64/assym.s index 414163b..3e22c9f 100644 --- a/lib/libpthread/arch/sparc64/sparc64/assym.s +++ b/lib/libpthread/arch/sparc64/sparc64/assym.s @@ -7,6 +7,8 @@ #define UC_MCONTEXT 0x40 +#define MC_FLAGS 0x0 +#define MC_VALID_FLAGS 0x1 #define MC_GLOBAL 0x0 #define MC_OUT 0x40 #define MC_TPC 0xc8 diff --git a/lib/libpthread/arch/sparc64/sparc64/thr_getcontext.S b/lib/libpthread/arch/sparc64/sparc64/thr_getcontext.S index 9c36bf5..d855dac 100644 --- a/lib/libpthread/arch/sparc64/sparc64/thr_getcontext.S +++ b/lib/libpthread/arch/sparc64/sparc64/thr_getcontext.S @@ -37,10 +37,12 @@ ENTRY(__thr_getcontext) stx %sp, [%o0 + MC_OUT + (6 * 8)] stx %o1, [%o0 + MC_TPC] stx %o2, [%o0 + MC_TNPC] - mov 1, %l0 # Validate the context. - stx %l0, [%o0 + MC_GLOBAL] + mov MC_VALID_FLAGS, %l0 /* Validate the context. */ + stx %l0, [%o0 + MC_FLAGS] + mov 1, %l0 + stx %l0, [%o0 + MC_OUT + (0 * 8)] /* return 1 when resumed */ retl - nop + mov 0, %o0 /* return 0 */ END(__thr_getcontext) .weak CNAME(_thr_setcontext) |