From 69eb1f0d3407cba3cea24625c544f99612b0a74e Mon Sep 17 00:00:00 2001 From: deischen Date: Thu, 9 Oct 2003 14:48:09 +0000 Subject: 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(). --- lib/libkse/arch/sparc64/sparc64/assym.s | 2 ++ lib/libkse/arch/sparc64/sparc64/thr_getcontext.S | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'lib/libkse') 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) -- cgit v1.1