Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 185007
b: refs/heads/master
c: f7b64fe
h: refs/heads/master
i:
  185005: 93fd159
  185003: a0476f7
  184999: 8d6fce0
  184991: 952539b
v: v3
  • Loading branch information
Tejun Heo committed Oct 29, 2009
1 parent 1abafd2 commit 1221306
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dd17c8f72993f9461e9c19250e3f155d6d99df22
refs/heads/master: f7b64fe806029e0a0454df132eec3c5ab576102c
23 changes: 14 additions & 9 deletions trunk/include/linux/percpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@
* we force a syntax error here if it isn't.
*/
#define get_cpu_var(var) (*({ \
extern int simple_identifier_##var(void); \
preempt_disable(); \
&__get_cpu_var(var); }))
#define put_cpu_var(var) preempt_enable()

#define put_cpu_var(var) do { \
(void)(var); \
preempt_enable(); \
} while (0)

#ifdef CONFIG_SMP

Expand Down Expand Up @@ -182,17 +185,19 @@ static inline void *pcpu_lpage_remapped(void *kaddr)
#ifndef percpu_read
# define percpu_read(var) \
({ \
typeof(var) __tmp_var__; \
__tmp_var__ = get_cpu_var(var); \
put_cpu_var(var); \
__tmp_var__; \
typeof(var) *pr_ptr__ = &(var); \
typeof(var) pr_ret__; \
pr_ret__ = get_cpu_var(*pr_ptr__); \
put_cpu_var(*pr_ptr__); \
pr_ret__; \
})
#endif

#define __percpu_generic_to_op(var, val, op) \
do { \
get_cpu_var(var) op val; \
put_cpu_var(var); \
typeof(var) *pgto_ptr__ = &(var); \
get_cpu_var(*pgto_ptr__) op val; \
put_cpu_var(*pgto_ptr__); \
} while (0)

#ifndef percpu_write
Expand Down Expand Up @@ -304,7 +309,7 @@ do { \
#define _this_cpu_generic_to_op(pcp, val, op) \
do { \
preempt_disable(); \
*__this_cpu_ptr(&pcp) op val; \
*__this_cpu_ptr(&(pcp)) op val; \
preempt_enable(); \
} while (0)

Expand Down

0 comments on commit 1221306

Please sign in to comment.