我有这个功能:
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);
}
Run Code Online (Sandbox Code Playgroud)
而且我想要而不是Exec()使用pthread,所以我必须调用cpu_boot:
void cpu_boot(uint cores, interrupt_handler bootfunc, uint serialno)
{
//I cannot change this function
}
Run Code Online (Sandbox Code Playgroud)
这些是参数的类型
typedef void interrupt_handler();
typedef int (* Task)(int, void*);
Run Code Online (Sandbox Code Playgroud)
我试过了:
void boot(uint ncores, uint nterm, Task boot_task, int argl, void* args)
{
void my_wrapper()
{
int y;
y= boot_task(argl, args); …Run Code Online (Sandbox Code Playgroud)