mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-05-17 07:11:43 +08:00
Fix atomic ops in <sys/buf_ring.h>
This commit is contained in:
parent
c40e45b75e
commit
2956924a34
@ -89,7 +89,7 @@ buf_ring_enqueue(struct buf_ring *br, void *buf)
|
||||
}
|
||||
continue;
|
||||
}
|
||||
} while (!atomic_cmpset_acq_int(&br->br_prod_head, prod_head, prod_next));
|
||||
} while (!atomic_cmpset_acq_32(&br->br_prod_head, prod_head, prod_next));
|
||||
#ifdef DEBUG_BUFRING
|
||||
if (br->br_ring[prod_head] != NULL)
|
||||
panic("dangling value in enqueue");
|
||||
@ -103,7 +103,7 @@ buf_ring_enqueue(struct buf_ring *br, void *buf)
|
||||
*/
|
||||
while (br->br_prod_tail != prod_head)
|
||||
cpu_spinwait();
|
||||
atomic_store_rel_int(&br->br_prod_tail, prod_next);
|
||||
atomic_store_rel_32(&br->br_prod_tail, prod_next);
|
||||
critical_exit();
|
||||
return (0);
|
||||
}
|
||||
@ -127,7 +127,7 @@ buf_ring_dequeue_mc(struct buf_ring *br)
|
||||
critical_exit();
|
||||
return (NULL);
|
||||
}
|
||||
} while (!atomic_cmpset_acq_int(&br->br_cons_head, cons_head, cons_next));
|
||||
} while (!atomic_cmpset_acq_32(&br->br_cons_head, cons_head, cons_next));
|
||||
|
||||
buf = br->br_ring[cons_head];
|
||||
#ifdef DEBUG_BUFRING
|
||||
@ -141,7 +141,7 @@ buf_ring_dequeue_mc(struct buf_ring *br)
|
||||
while (br->br_cons_tail != cons_head)
|
||||
cpu_spinwait();
|
||||
|
||||
atomic_store_rel_int(&br->br_cons_tail, cons_next);
|
||||
atomic_store_rel_32(&br->br_cons_tail, cons_next);
|
||||
critical_exit();
|
||||
|
||||
return (buf);
|
||||
|
Loading…
x
Reference in New Issue
Block a user