unr: remove UNR64_LOCKED

All platforms support 64-bit atomics now.
This commit is contained in:
Mateusz Guzik 2022-10-08 09:38:41 +00:00
parent 44b0b943b8
commit 143942f992
2 changed files with 0 additions and 21 deletions

View File

@ -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>

View File

@ -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);