unr: remove UNR64_LOCKED
All platforms support 64-bit atomics now.
This commit is contained in:
parent
44b0b943b8
commit
143942f992
@ -98,19 +98,6 @@ static struct mtx unitmtx;
|
||||
|
||||
MTX_SYSINIT(unit, &unitmtx, "unit# allocation", MTX_DEF);
|
||||
|
||||
#ifdef UNR64_LOCKED
|
||||
uint64_t
|
||||
alloc_unr64(struct unrhdr64 *unr64)
|
||||
{
|
||||
uint64_t item;
|
||||
|
||||
mtx_lock(&unitmtx);
|
||||
item = unr64->counter++;
|
||||
mtx_unlock(&unitmtx);
|
||||
return (item);
|
||||
}
|
||||
#endif
|
||||
|
||||
#else /* ...USERLAND */
|
||||
|
||||
#include <bitstring.h>
|
||||
|
@ -510,10 +510,6 @@ int alloc_unr_specific(struct unrhdr *uh, u_int item);
|
||||
int alloc_unrl(struct unrhdr *uh);
|
||||
void free_unr(struct unrhdr *uh, u_int item);
|
||||
|
||||
#ifndef __LP64__
|
||||
#define UNR64_LOCKED
|
||||
#endif
|
||||
|
||||
struct unrhdr64 {
|
||||
uint64_t counter;
|
||||
};
|
||||
@ -525,16 +521,12 @@ new_unrhdr64(struct unrhdr64 *unr64, uint64_t low)
|
||||
unr64->counter = low;
|
||||
}
|
||||
|
||||
#ifdef UNR64_LOCKED
|
||||
uint64_t alloc_unr64(struct unrhdr64 *);
|
||||
#else
|
||||
static __inline uint64_t
|
||||
alloc_unr64(struct unrhdr64 *unr64)
|
||||
{
|
||||
|
||||
return (atomic_fetchadd_64(&unr64->counter, 1));
|
||||
}
|
||||
#endif
|
||||
|
||||
void intr_prof_stack_use(struct thread *td, struct trapframe *frame);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user