diff options
author | Michael Brown | 2016-03-16 22:24:13 +0100 |
---|---|---|
committer | Michael Brown | 2016-03-16 23:33:41 +0100 |
commit | 9bab13a7727a36c36b320409e0e785e016a3ff5c (patch) | |
tree | ebbdfd289af8dc14662118376868542750431538 /src/arch | |
parent | [bitops] Add generic atomic bit test, set, and clear functions (diff) | |
download | ipxe-9bab13a7727a36c36b320409e0e785e016a3ff5c.tar.gz ipxe-9bab13a7727a36c36b320409e0e785e016a3ff5c.tar.xz ipxe-9bab13a7727a36c36b320409e0e785e016a3ff5c.zip |
[hyperv] Use generic set_bit() function
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/arch')
-rw-r--r-- | src/arch/i386/include/bits/hyperv.h | 23 | ||||
-rw-r--r-- | src/arch/x86_64/include/bits/hyperv.h | 23 |
2 files changed, 0 insertions, 46 deletions
diff --git a/src/arch/i386/include/bits/hyperv.h b/src/arch/i386/include/bits/hyperv.h index 3565c8a8..0ba58afb 100644 --- a/src/arch/i386/include/bits/hyperv.h +++ b/src/arch/i386/include/bits/hyperv.h @@ -46,27 +46,4 @@ hv_call ( struct hv_hypervisor *hv, unsigned int code, const void *in, return result; } -/** - * Set bit atomically - * - * @v bits Bit field - * @v bit Bit to set - */ -static inline __attribute__ (( always_inline )) void -hv_set_bit ( void *bits, unsigned int bit ) { - struct { - uint32_t dword[ ( bit / 32 ) + 1 ]; - } *dwords = bits; - - /* Set bit using "lock bts". Inform compiler that any memory - * from the start of the bit field up to and including the - * dword containing this bit may be modified. (This is - * overkill but shouldn't matter in practice since we're - * unlikely to subsequently read other bits from the same bit - * field.) - */ - __asm__ __volatile__ ( "lock bts %1, %0" - : "+m" ( *dwords ) : "Ir" ( bit ) ); -} - #endif /* _BITS_HYPERV_H */ diff --git a/src/arch/x86_64/include/bits/hyperv.h b/src/arch/x86_64/include/bits/hyperv.h index 845c182f..975b1eee 100644 --- a/src/arch/x86_64/include/bits/hyperv.h +++ b/src/arch/x86_64/include/bits/hyperv.h @@ -49,27 +49,4 @@ hv_call ( struct hv_hypervisor *hv, unsigned int code, const void *in, return result; } -/** - * Set bit atomically - * - * @v bits Bit field - * @v bit Bit to set - */ -static inline __attribute__ (( always_inline )) void -hv_set_bit ( void *bits, unsigned int bit ) { - struct { - uint64_t qword[ ( bit / 64 ) + 1 ]; - } *qwords = bits; - - /* Set bit using "lock bts". Inform compiler that any memory - * from the start of the bit field up to and including the - * qword containing this bit may be modified. (This is - * overkill but shouldn't matter in practice since we're - * unlikely to subsequently read other bits from the same bit - * field.) - */ - __asm__ __volatile__ ( "lock bts %1, %0" - : "+m" ( *qwords ) : "Ir" ( bit ) ); -} - #endif /* _BITS_HYPERV_H */ |