提交 8e18824b 创建 作者: Nickolai Zeldovich's avatar Nickolai Zeldovich

use -fms-extensions

上级 7663c33b
...@@ -22,7 +22,7 @@ struct rcu { ...@@ -22,7 +22,7 @@ struct rcu {
int arg1; int arg1;
uint arg2; uint arg2;
} f2; } f2;
} u; };
int type; int type;
}; };
static struct { struct rcu *x __attribute__((aligned (CACHELINE))); } rcu_delayed_head[NCPU]; static struct { struct rcu *x __attribute__((aligned (CACHELINE))); } rcu_delayed_head[NCPU];
...@@ -76,10 +76,10 @@ rcu_gc(void) ...@@ -76,10 +76,10 @@ rcu_gc(void)
// cprintf("free: %d (%x %x)\n", r->epoch, r->dofree, r->item); // cprintf("free: %d (%x %x)\n", r->epoch, r->dofree, r->item);
switch (r->type) { switch (r->type) {
case 1: case 1:
r->u.f1.dofree(r->u.f1.item); r->f1.dofree(r->f1.item);
break; break;
case 2: case 2:
r->u.f2.dofree(r->u.f2.arg1, r->u.f2.arg2); r->f2.dofree(r->f2.arg1, r->f2.arg2);
break; break;
default: default:
panic("rcu type"); panic("rcu type");
...@@ -124,15 +124,15 @@ rcu_delayed(void *e, void (*dofree)(void *)) ...@@ -124,15 +124,15 @@ rcu_delayed(void *e, void (*dofree)(void *))
if (rcu_debug) { if (rcu_debug) {
cprintf("rcu_delayed: %x %x\n", dofree, e); cprintf("rcu_delayed: %x %x\n", dofree, e);
for (struct rcu *r = rcu_delayed_head[cpu->id].x; r; r = r->next) for (struct rcu *r = rcu_delayed_head[cpu->id].x; r; r = r->next)
if (r->u.f1.item == e && r->u.f1.dofree == dofree) if (r->f1.item == e && r->f1.dofree == dofree)
panic("rcu_delayed double free"); panic("rcu_delayed double free");
} }
struct rcu *r = rcu_alloc(); struct rcu *r = rcu_alloc();
if (r == 0) if (r == 0)
panic("rcu_delayed"); panic("rcu_delayed");
r->u.f1.dofree = dofree; r->f1.dofree = dofree;
r->u.f1.item = e; r->f1.item = e;
r->next = 0; r->next = 0;
r->epoch = global_epoch; r->epoch = global_epoch;
r->type = 1; r->type = 1;
...@@ -145,9 +145,9 @@ rcu_delayed2(int a1, uint a2, void (*dofree)(int,uint)) ...@@ -145,9 +145,9 @@ rcu_delayed2(int a1, uint a2, void (*dofree)(int,uint))
struct rcu *r = rcu_alloc(); struct rcu *r = rcu_alloc();
if (r == 0) if (r == 0)
panic("rcu_delayed"); panic("rcu_delayed");
r->u.f2.dofree = dofree; r->f2.dofree = dofree;
r->u.f2.arg1 = a1; r->f2.arg1 = a1;
r->u.f2.arg2 = a2; r->f2.arg2 = a2;
r->next = 0; r->next = 0;
r->epoch = global_epoch; r->epoch = global_epoch;
r->type = 2; r->type = 2;
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论