I have this function:
void boot(uint ncores, uint nterm, Task boot_task, int argl, void* args) { for(int i=0; i<MAX_PROC;i++) { PT[i].ppid = NOPROC; } nextproc = 0; curproc = NOPROC; Exec(boot_task, argl, args); }
and I want to use pthread instead of Exec() , so I need to call cpu_boot:
void cpu_boot(uint cores, interrupt_handler bootfunc, uint serialno) {
These are argument types.
typedef void interrupt_handler(); typedef int (* Task)(int, void*);
I tried:
void boot(uint ncores, uint nterm, Task boot_task, int argl, void* args) { void my_wrapper() { int y; y= boot_task(argl, args); } cpu_boot(ncores, my_wrapper , nterm); }
But it's not right. How to implement this?
source share