diff --git a/bcm/archbcm2.c b/bcm/archbcm2.c index a081e8e..b98d97a 100644 --- a/bcm/archbcm2.c +++ b/bcm/archbcm2.c @@ -232,10 +232,24 @@ l2ap(int ap) return (AP(0, (ap))); } +int +cas32(void* addr, u32int old, u32int new) +{ + int r, s; + + s = splhi(); + if(r = (*(u32int*)addr == old)) + *(u32int*)addr = new; + splx(s); + if (r) + coherence(); + return r; +} + int cmpswap(long *addr, long old, long new) { - return cas((ulong*)addr, old, new); + return cas32((ulong*)addr, old, new); } void