wq tweaks

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