Signed-off-by: Liran Alon <liran.alon@xxxxxxxxxx> Signed-off-by: Jim Mattson <jmattson@xxxxxxxxxx> --- lib/x86/processor.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/x86/processor.h b/lib/x86/processor.h index e850029173ab..89ee528a2e36 100644 --- a/lib/x86/processor.h +++ b/lib/x86/processor.h @@ -443,4 +443,16 @@ static inline bool is_canonical(u64 addr) return (s64)(addr << 16) >> 16 == addr; } +static inline void clear_bit(int bit, u8 *addr) +{ + __asm__ __volatile__("btr %1, %0" + : "+m" (*addr) : "Ir" (bit) : "cc", "memory"); +} + +static inline void set_bit(int bit, u8 *addr) +{ + __asm__ __volatile__("bts %1, %0" + : "+m" (*addr) : "Ir" (bit) : "cc", "memory"); +} + #endif -- 1.9.1