wq tweaks

上级 ae76c346
......@@ -24,6 +24,7 @@ struct stat;
struct proc;
struct vmap;
struct pipe;
struct work;
// bio.c
void binit(void);
......@@ -327,11 +328,10 @@ void updatepages(pml4e_t*, void*, void*, int);
struct vmap * vmap_copy(struct vmap *, int);
// wq.c
#if WQENABLE
int wq_trywork(void);
#else
#define wq_trywork() 0
#endif
int wq_push(struct work *w);
struct work * allocwork(void);
void freework(struct work *w);
// cilk.c
#if CILKENABLE
......
......@@ -47,13 +47,13 @@ wq_stat(void)
return &stat[cpunum()];
}
static struct work *
struct work *
allocwork(void)
{
return (struct work *)kalloc();
}
static void
void
freework(struct work *w)
{
kfree(w);
......@@ -159,8 +159,8 @@ __wq_steal(int c)
static void
__wq_run(struct work *w)
{
void (*fn)(struct work*, void*, void*) = w->rip;
fn(w, w->arg0, w->arg1);
void (*fn)(struct work*, void*, void*, void*, void*) = w->rip;
fn(w, w->arg0, w->arg1, w->arg2, w->arg3);
freework(w);
}
......
......@@ -2,5 +2,7 @@ struct work {
void *rip;
void *arg0;
void *arg1;
void *arg2;
void *arg3;
char data[];
};
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论