// === PROTOTYPES ===
void Proc_IdleThread(void *unused);
-tTID Proc_NewKThread(void (*Fnc)(void*), void *Ptr);
// === GLOBALS ===
tThread *gpCurrentThread = &gThreadZero;
new = Threads_CloneThreadZero();
if(!new) return -1;
- free(new->ThreadName);
+ if(new->ThreadName) free(new->ThreadName);
new->ThreadName = NULL;
new->KernelStack = MM_NewKStack(1);
sp = new->KernelStack;
*(Uint32*)(sp -= 4) = (Uint)Ptr;
- *(Uint32*)(sp -= 4) = 1;
*(Uint32*)(sp -= 4) = (Uint)Fnc;
*(Uint32*)(sp -= 4) = (Uint)new;
sp = new->KernelStack;
*(Uint32*)(sp -= 4) = (Uint)Ptr;
- *(Uint32*)(sp -= 4) = 1;
*(Uint32*)(sp -= 4) = (Uint)Fnc;
*(Uint32*)(sp -= 4) = (Uint)new;