From 1e7868258516018cbfeaac03b99d49be75e60e69 Mon Sep 17 00:00:00 2001 From: uwe Date: Thu, 20 Nov 2003 03:31:02 +0000 Subject: [PATCH] In pthread__locked_switch set self->pt_uc only when the context is inited. In STACK_SWITCH subtract STACKSPACE, not add it (it's zero for now anyway). --- lib/libpthread/arch/sh3/pthread_switch.S | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/libpthread/arch/sh3/pthread_switch.S b/lib/libpthread/arch/sh3/pthread_switch.S index bde8daa4af76..32f2c212c108 100644 --- a/lib/libpthread/arch/sh3/pthread_switch.S +++ b/lib/libpthread/arch/sh3/pthread_switch.S @@ -1,4 +1,4 @@ -/* $NetBSD: pthread_switch.S,v 1.2 2003/11/18 03:11:41 uwe Exp $ */ +/* $NetBSD: pthread_switch.S,v 1.3 2003/11/20 03:31:02 uwe Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -124,7 +124,7 @@ ASSERT_IMMEDIATE_7BIT_OK(PT_TRAPUC) mov tmp, sp ; \ .else ; \ mov tmp, r0 ; \ - add #STACKSPACE, r0 ; \ + add #-STACKSPACE, r0 ; \ mov r0, sp ; \ .endif @@ -257,9 +257,6 @@ NENTRY(pthread__locked_switch) add #1, r0 mov.l r0, @(PT_SPINLOCKS, r9) /* ++next->pt_spinlocks */ - mov #PT_UC, r0 - mov.l sp, @(r0, r8) /* self->pt_uc = &cntx; */ - mov.l CALL_TARGET(41b,_getcontext_u), r0 41: CALL (r0) /* _getcontext_u(self->pt_uc); */ mov sp, r4 @@ -271,6 +268,9 @@ NENTRY(pthread__locked_switch) mova Lpthread__locked_switch_return_point, r0 mov.l r0, @(UC_PC, sp) + mov #PT_UC, r0 + mov.l sp, @(r0, r8) /* self->pt_uc = &cntx; */ + STACK_SWITCH(r9, r4) /* r4 = next->pt_uc; */ /*