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 <fei1.li@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Li, Fei1 2018-05-16 15:41:50 +08:00 committed by lijinxia
parent 5e427f340e
commit 0a83cf462d

View File

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