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().
This commit is contained in:
deischen 2003-10-09 14:48:09 +00:00
parent b6c6c96477
commit 3746a5ee24
4 changed files with 14 additions and 6 deletions

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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)