mirror of
https://github.com/torvalds/linux.git
synced 2024-12-25 12:21:37 +00:00
include/asm-x86/percpu.h: checkpatch cleanups - formatting only
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
46e1abc63e
commit
bc9e3be20b
@ -85,58 +85,62 @@ DECLARE_PER_CPU(unsigned long, this_cpu_off);
|
||||
* don't give an lvalue though). */
|
||||
extern void __bad_percpu_size(void);
|
||||
|
||||
#define percpu_to_op(op,var,val) \
|
||||
do { \
|
||||
typedef typeof(var) T__; \
|
||||
if (0) { T__ tmp__; tmp__ = (val); } \
|
||||
switch (sizeof(var)) { \
|
||||
case 1: \
|
||||
asm(op "b %1,"__percpu_seg"%0" \
|
||||
: "+m" (var) \
|
||||
:"ri" ((T__)val)); \
|
||||
break; \
|
||||
case 2: \
|
||||
asm(op "w %1,"__percpu_seg"%0" \
|
||||
: "+m" (var) \
|
||||
:"ri" ((T__)val)); \
|
||||
break; \
|
||||
case 4: \
|
||||
asm(op "l %1,"__percpu_seg"%0" \
|
||||
: "+m" (var) \
|
||||
:"ri" ((T__)val)); \
|
||||
break; \
|
||||
default: __bad_percpu_size(); \
|
||||
} \
|
||||
} while (0)
|
||||
#define percpu_to_op(op, var, val) \
|
||||
do { \
|
||||
typedef typeof(var) T__; \
|
||||
if (0) { \
|
||||
T__ tmp__; \
|
||||
tmp__ = (val); \
|
||||
} \
|
||||
switch (sizeof(var)) { \
|
||||
case 1: \
|
||||
asm(op "b %1,"__percpu_seg"%0" \
|
||||
: "+m" (var) \
|
||||
: "ri" ((T__)val)); \
|
||||
break; \
|
||||
case 2: \
|
||||
asm(op "w %1,"__percpu_seg"%0" \
|
||||
: "+m" (var) \
|
||||
: "ri" ((T__)val)); \
|
||||
break; \
|
||||
case 4: \
|
||||
asm(op "l %1,"__percpu_seg"%0" \
|
||||
: "+m" (var) \
|
||||
: "ri" ((T__)val)); \
|
||||
break; \
|
||||
default: __bad_percpu_size(); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define percpu_from_op(op,var) \
|
||||
({ \
|
||||
typeof(var) ret__; \
|
||||
switch (sizeof(var)) { \
|
||||
case 1: \
|
||||
asm(op "b "__percpu_seg"%1,%0" \
|
||||
: "=r" (ret__) \
|
||||
: "m" (var)); \
|
||||
break; \
|
||||
case 2: \
|
||||
asm(op "w "__percpu_seg"%1,%0" \
|
||||
: "=r" (ret__) \
|
||||
: "m" (var)); \
|
||||
break; \
|
||||
case 4: \
|
||||
asm(op "l "__percpu_seg"%1,%0" \
|
||||
: "=r" (ret__) \
|
||||
: "m" (var)); \
|
||||
break; \
|
||||
default: __bad_percpu_size(); \
|
||||
} \
|
||||
ret__; })
|
||||
#define percpu_from_op(op, var) \
|
||||
({ \
|
||||
typeof(var) ret__; \
|
||||
switch (sizeof(var)) { \
|
||||
case 1: \
|
||||
asm(op "b "__percpu_seg"%1,%0" \
|
||||
: "=r" (ret__) \
|
||||
: "m" (var)); \
|
||||
break; \
|
||||
case 2: \
|
||||
asm(op "w "__percpu_seg"%1,%0" \
|
||||
: "=r" (ret__) \
|
||||
: "m" (var)); \
|
||||
break; \
|
||||
case 4: \
|
||||
asm(op "l "__percpu_seg"%1,%0" \
|
||||
: "=r" (ret__) \
|
||||
: "m" (var)); \
|
||||
break; \
|
||||
default: __bad_percpu_size(); \
|
||||
} \
|
||||
ret__; \
|
||||
})
|
||||
|
||||
#define x86_read_percpu(var) percpu_from_op("mov", per_cpu__##var)
|
||||
#define x86_write_percpu(var,val) percpu_to_op("mov", per_cpu__##var, val)
|
||||
#define x86_add_percpu(var,val) percpu_to_op("add", per_cpu__##var, val)
|
||||
#define x86_sub_percpu(var,val) percpu_to_op("sub", per_cpu__##var, val)
|
||||
#define x86_or_percpu(var,val) percpu_to_op("or", per_cpu__##var, val)
|
||||
#define x86_write_percpu(var, val) percpu_to_op("mov", per_cpu__##var, val)
|
||||
#define x86_add_percpu(var, val) percpu_to_op("add", per_cpu__##var, val)
|
||||
#define x86_sub_percpu(var, val) percpu_to_op("sub", per_cpu__##var, val)
|
||||
#define x86_or_percpu(var, val) percpu_to_op("or", per_cpu__##var, val)
|
||||
#endif /* !__ASSEMBLY__ */
|
||||
#endif /* !CONFIG_X86_64 */
|
||||
#endif /* _ASM_X86_PERCPU_H_ */
|
||||
|
Loading…
Reference in New Issue
Block a user