From 0a83cf462dd2de098223b40a0e2020f993e51360 Mon Sep 17 00:00:00 2001 From: "Li, Fei1" Date: Wed, 16 May 2018 15:41:50 +0800 Subject: [PATCH] hv: remove support atomic operation for char/short From now on, only plan to support atomic operation for int/long. Signed-off-by: Li, Fei1 Acked-by: Eddie Dong --- hypervisor/include/lib/atomic.h | 87 --------------------------------- 1 file changed, 87 deletions(-) diff --git a/hypervisor/include/lib/atomic.h b/hypervisor/include/lib/atomic.h index 394d0c94b..0392564f3 100644 --- a/hypervisor/include/lib/atomic.h +++ b/hypervisor/include/lib/atomic.h @@ -31,93 +31,6 @@ #define ATOMIC_H #define BUS_LOCK "lock ; " -/* - * #define atomic_set_char(P, V) (*(unsigned char *)(P) |= (V)) - */ -static inline void atomic_set_char(unsigned char *p, unsigned char v) -{ - __asm __volatile(BUS_LOCK "orb %b1,%0" - : "+m" (*p) - : "q" (v) - : "cc", "memory"); -} - -/* - * #define atomic_clear_char(P, V) (*(unsigned char *)(P) &= ~(V)) - */ -static inline void atomic_clear_char(unsigned char *p, unsigned char v) -{ - __asm __volatile(BUS_LOCK "andb %b1,%0" - : "+m" (*p) - : "q" (~v) - : "cc", "memory"); -} - -/* - * #define atomic_add_char(P, V) (*(unsigned char *)(P) += (V)) - */ -static inline void atomic_add_char(unsigned char *p, unsigned char v) -{ - __asm __volatile(BUS_LOCK "addb %b1,%0" - : "+m" (*p) - : "q" (v) - : "cc", "memory"); -} - -/* - * #define atomic_subtract_char(P, V) (*(unsigned char *)(P) -= (V)) - */ -static inline void atomic_subtract_char(unsigned char *p, unsigned char v) -{ - __asm __volatile(BUS_LOCK "subb %b1,%0" - : "+m" (*p) - : "q" (v) - : "cc", "memory"); -} - -/* - * #define atomic_set_short(P, V) (*(unsigned short *)(P) |= (V)) - */ -static inline void atomic_set_short(unsigned short *p, unsigned short v) -{ - __asm __volatile(BUS_LOCK "orw %w1,%0" - : "+m" (*p) - : "r" (v) - : "cc", "memory"); -} - -/* - * #define atomic_clear_short(P, V) (*(unsigned short *)(P) &= ~(V)) - */ -static inline void atomic_clear_short(unsigned short *p, unsigned short v) -{ - __asm __volatile(BUS_LOCK "andw %w1,%0" - : "+m" (*p) - : "r" (~v) - : "cc", "memory"); -} - -/* - * #define atomic_add_short(P, V) (*(unsigned short *)(P) += (V)) - */ -static inline void atomic_add_short(unsigned short *p, unsigned short v) -{ - __asm __volatile(BUS_LOCK "addw %w1,%0" - : "+m" (*p) - : "r" (v) - : "cc", "memory"); -} - -/* - * #define atomic_subtract_short(P, V) (*(unsigned short *)(P) -= (V)) - */ -static inline void atomic_subtract_short(unsigned short *p, unsigned short v) -{ - __asm __volatile(BUS_LOCK "subw %w1,%0" - : "+m" (*p) - : "r" (v) - : "cc", "memory"); -} /* * #define atomic_set_int(P, V) (*(unsigned int *)(P) |= (V))