tThread *newThread, *cur;
cur = Proc_GetCurThread();
- newThread = Threads_CloneTCB(NULL, 0);
+ newThread = Threads_CloneTCB(0);
if(!newThread) return -1;
// Set CR3
}
// New thread
- newThread = Threads_CloneTCB(NULL, Flags);
+ newThread = Threads_CloneTCB(Flags);
if(!newThread) return -1;
newThread->KernelStack = cur->KernelStack;
#endif
}
+/**
+ * \brief Create a new kernel thread
+ */
int Proc_NewKThread(void (*Fcn)(void*), void *Data)
{
Uint rsp;
tThread *newThread, *cur;
cur = Proc_GetCurThread();
- newThread = Threads_CloneTCB(NULL, 0);
+ newThread = Threads_CloneTCB(0);
if(!newThread) return -1;
// Set CR3
}
// Create new TCB
- newThread = Threads_CloneTCB(NULL, Flags);
+ newThread = Threads_CloneTCB(Flags);
if(!newThread) return -1;
// Save core machine state
extern tThread *Threads_RemActive(void);
extern tThread *Threads_GetNextToRun(int CPU, tThread *Last);
-extern tThread *Threads_CloneTCB(Uint *Err, Uint Flags);
+extern tThread *Threads_CloneTCB(Uint Flags);
extern tThread *Threads_CloneThreadZero(void);
#endif
}
/**
- * \fn tThread *Threads_CloneTCB(Uint *Err, Uint Flags)
* \brief Clone the TCB of the current thread
- * \param Err Error pointer
* \param Flags Flags for something... (What is this for?)
*/
-tThread *Threads_CloneTCB(Uint *Err, Uint Flags)
+tThread *Threads_CloneTCB(Uint Flags)
{
tThread *cur, *new;
int i;
// Allocate and duplicate
new = malloc(sizeof(tThread));
- if(new == NULL) { *Err = -ENOMEM; return NULL; }
+ if(new == NULL) { errno = -ENOMEM; return NULL; }
memcpy(new, cur, sizeof(tThread));
new->CurCPU = -1;
}
/**
- * \fn tThread *Threads_CloneTCB(Uint *Err, Uint Flags)
- * \brief Clone the TCB of the current thread
+ * \brief Clone the TCB of the kernel thread
*/
tThread *Threads_CloneThreadZero(void)
{