From cbe0cc999c61fff862054bf428b7163e5458f2af Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sun, 29 Jan 2012 22:52:17 +0800 Subject: [PATCH] Kernel/armv7 - Fixed for threading changes --- Kernel/arch/armv7/proc.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Kernel/arch/armv7/proc.c b/Kernel/arch/armv7/proc.c index c3cb226c..c61590e7 100644 --- a/Kernel/arch/armv7/proc.c +++ b/Kernel/arch/armv7/proc.c @@ -11,6 +11,7 @@ // === IMPORTS === extern tThread gThreadZero; +extern tProcess gProcessZero; extern void SwitchTask(Uint32 NewSP, Uint32 *OldSP, Uint32 NewIP, Uint32 *OldIP, Uint32 MemPtr); extern void KernelThreadHeader(void); // Actually takes args on stack extern void Proc_int_DropToUser(Uint32 IP, Uint32 SP) NORETURN __attribute__((long_call)); @@ -30,7 +31,7 @@ tThread *gpIdleThread = NULL; // === CODE === void ArchThreads_Init(void) { - gThreadZero.MemState.Base = (tPAddr)&kernel_table0 - KERNEL_BASE; + gProcessZero.MemState.Base = (tPAddr)&kernel_table0 - KERNEL_BASE; } void Proc_IdleThread(void *unused) @@ -94,11 +95,15 @@ void Proc_StartUser(Uint Entrypoint, Uint Base, int ArgC, char **ArgV, int DataS Proc_int_DropToUser(Entrypoint, (Uint32)usr_sp); } -void Proc_ClearThread(tThread *Thread) +void Proc_ClearProcess(tProcess *Process) { Log_Warning("Proc", "TODO: Nuke address space etc"); } +void Proc_ClearThread(tThread *Thread) +{ +} + tTID Proc_Clone(Uint Flags) { tThread *new; @@ -118,14 +123,14 @@ tTID Proc_Clone(Uint Flags) new->SavedState.SP = sp; new->SavedState.UserSP = Proc_int_SwapUserSP(0); new->SavedState.UserIP = Proc_GetCurThread()->SavedState.UserIP; - new->MemState.Base = mem; + new->Process->MemState.Base = mem; Threads_AddActive(new); return new->TID; } -tTID Proc_SpawnWorker( void (*Fnc)(void*), void *Ptr ) +int Proc_SpawnWorker( void (*Fnc)(void*), void *Ptr ) { tThread *new; Uint32 sp; @@ -205,7 +210,7 @@ void Proc_Reschedule(void) Log("Switching to %p (%i %s) IP=%p SP=%p TTBR0=%p UsrSP=%p", next, next->TID, next->ThreadName, - next->SavedState.IP, next->SavedState.SP, next->MemState.Base, + next->SavedState.IP, next->SavedState.SP, next->Process->MemState.Base, next->SavedState.UserSP ); @@ -218,7 +223,7 @@ void Proc_Reschedule(void) SwitchTask( next->SavedState.SP, &cur->SavedState.SP, next->SavedState.IP, &cur->SavedState.IP, - next->MemState.Base + next->Process->MemState.Base ); } -- 2.20.1