Kernel/armv7 - Fixed for threading changes
authorJohn Hodge <[email protected]>
Sun, 29 Jan 2012 14:52:17 +0000 (22:52 +0800)
committerJohn Hodge <[email protected]>
Sun, 29 Jan 2012 14:52:17 +0000 (22:52 +0800)
Kernel/arch/armv7/proc.c

index c3cb226..c61590e 100644 (file)
@@ -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
                );
        
 }

UCC git Repository :: git.ucc.asn.au