From ad385e2864f65afcac4b19ac35e17eca2c30e32b Mon Sep 17 00:00:00 2001 From: John Hodge Date: Thu, 20 Oct 2011 21:20:01 +0800 Subject: [PATCH] Kernel/armv7 - Fixed worker thread creation --- Kernel/arch/armv7/proc.S | 23 +++++++---------------- Kernel/arch/armv7/proc.c | 1 - 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/Kernel/arch/armv7/proc.S b/Kernel/arch/armv7/proc.S index f62100e6..52dcb64a 100644 --- a/Kernel/arch/armv7/proc.S +++ b/Kernel/arch/armv7/proc.S @@ -18,16 +18,8 @@ KernelThreadHeader: @ TODO: Do something with the thread pointer ldr r4, [sp],#4 @ Function - ldr r5, [sp],#4 - @ Get arguments - sub r5, #1 - ldrhs r0, [sp],#4 -@ suble r5, #1 -@ ldrhs r1, [sp],#4 -@ suble r5, #1 -@ ldrhs r2, [sp],#4 -@ suble r5, #1 -@ ldrhs r3, [sp],#4 + @ Get argument + ldr r0, [sp],#4 blx r4 @@ -87,17 +79,16 @@ Proc_CloneInt: ldr r0, =Proc_CloneInt_new pop {r4-r12,pc} Proc_CloneInt_new: - cps #18 +@ cps #18 @ mov r0, #0 -@ mov r1, #0 -@ sub r1, #1 +@ mvn r1, #0 @ bl MM_DumpTables -@ ldr r0, =csProc_CloneInt_NewTaskMessage -@ bl Log + ldr r0, =csProc_CloneInt_NewTaskMessage + bl Log - cps #19 +@ cps #19 mov r0, #0 pop {r4-r12,pc} diff --git a/Kernel/arch/armv7/proc.c b/Kernel/arch/armv7/proc.c index a0a646b6..ccc6b8fe 100644 --- a/Kernel/arch/armv7/proc.c +++ b/Kernel/arch/armv7/proc.c @@ -140,7 +140,6 @@ tTID Proc_SpawnWorker( void (*Fnc)(void*), void *Ptr ) sp = new->KernelStack; *(Uint32*)(sp -= 4) = (Uint)Ptr; - *(Uint32*)(sp -= 4) = 1; *(Uint32*)(sp -= 4) = (Uint)Fnc; *(Uint32*)(sp -= 4) = (Uint)new; -- 2.20.1