Modules/ATA - Debugging issue with VBox, problem still there
[tpg/acess2.git] / Kernel / arch / x86 / proc.c
index 7366520..4ab4039 100644 (file)
@@ -47,7 +47,6 @@ extern tShortSpinlock glThreadListLock;
 extern int     giNumCPUs;
 extern int     giNextTID;
 extern tThread gThreadZero;
-extern tThread *Threads_CloneTCB(Uint *Err, Uint Flags);
 extern void    Isr8(void);     // Double Fault
 extern void    Proc_ReturnToUser(tVAddr Handler, Uint Argument, tVAddr KernelStack);
 
@@ -57,11 +56,14 @@ void        ArchThreads_Init(void);
 void   MP_StartAP(int CPU);
 void   MP_SendIPI(Uint8 APICID, int Vector, int DeliveryMode);
 #endif
-void   Proc_Start(void);
-tThread        *Proc_GetCurThread(void);
+//void Proc_Start(void);
+//tThread      *Proc_GetCurThread(void);
 void   Proc_ChangeStack(void);
- int   Proc_Clone(Uint *Err, Uint Flags);
+// int Proc_Clone(Uint *Err, Uint Flags);
+Uint   Proc_MakeUserStack(void);
+void   Proc_StartUser(Uint Entrypoint, Uint *Bases, int ArgC, char **ArgV, char **EnvP, int DataSize);
 void   Proc_StartProcess(Uint16 SS, Uint Stack, Uint Flags, Uint16 CS, Uint IP);
+ int   Proc_Demote(Uint *Err, int Dest, tRegs *Regs);
 void   Proc_CallFaultHandler(tThread *Thread);
 void   Proc_Scheduler(int CPU);
 
@@ -471,7 +473,7 @@ void Proc_Start(void)
        if(Proc_Clone(0, 0) == 0)
        {
                gpIdleThread = Proc_GetCurThread();
-               gpIdleThread->ThreadName = "Idle Thread";
+               gpIdleThread->ThreadName = strdup("Idle Thread");
                Threads_SetPriority( gpIdleThread, -1 );        // Never called randomly
                gpIdleThread->Quantum = 1;      // 1 slice quantum
                for(;;) HALT(); // Just yeilds
@@ -649,14 +651,11 @@ int Proc_SpawnWorker(void)
        cur = Proc_GetCurThread();
        
        // Create new thread
-       new = malloc( sizeof(tThread) );
+       new = Threads_CloneThreadZero();
        if(!new) {
                Warning("Proc_SpawnWorker - Out of heap space!\n");
                return -1;
        }
-       memcpy(new, &gThreadZero, sizeof(tThread));
-       // Set Thread ID
-       new->TID = giNextTID++;
        // Create a new worker stack (in PID0's address space)
        // - The stack is relocated by this function
        new->KernelStack = MM_NewWorkerStack();

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