Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 80197
b: refs/heads/master
c: 0af8a5c
h: refs/heads/master
i:
  80195: f101f35
v: v3
  • Loading branch information
travis@sgi.com authored and Ingo Molnar committed Jan 30, 2008
1 parent 9a803ae commit 38f2cb8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 22 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: acdac87202a408133ee8f7985076de9d2e0dc5ab
refs/heads/master: 0af8a5ccc51ee2269712c90ab09c91b0150f4224
30 changes: 9 additions & 21 deletions trunk/include/asm-x86/percpu_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,26 +42,7 @@
*/
#ifdef CONFIG_SMP

/* This is used for other cpus to find our section. */
extern unsigned long __per_cpu_offset[];

#define per_cpu_offset(x) (__per_cpu_offset[x])

#define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name
/* We can use this directly for local CPU (faster). */
DECLARE_PER_CPU(unsigned long, this_cpu_off);

/* var is in discarded region: offset to particular copy we want */
#define per_cpu(var, cpu) (*({ \
extern int simple_indentifier_##var(void); \
RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu]); }))

#define __raw_get_cpu_var(var) (*({ \
extern int simple_indentifier_##var(void); \
RELOC_HIDE(&per_cpu__##var, x86_read_percpu(this_cpu_off)); \
}))

#define __get_cpu_var(var) __raw_get_cpu_var(var)
#define __my_cpu_offset x86_read_percpu(this_cpu_off)

/* A macro to avoid #include hell... */
#define percpu_modcopy(pcpudst, src, size) \
Expand All @@ -74,11 +55,18 @@ do { \

/* fs segment starts at (positive) offset == __per_cpu_offset[cpu] */
#define __percpu_seg "%%fs:"

#else /* !SMP */
#include <asm-generic/percpu.h>

#define __percpu_seg ""

#endif /* SMP */

#include <asm-generic/percpu.h>

/* We can use this directly for local CPU (faster). */
DECLARE_PER_CPU(unsigned long, this_cpu_off);

/* For arch-specific code, we can use direct single-insn ops (they
* don't give an lvalue though). */
extern void __bad_percpu_size(void);
Expand Down

0 comments on commit 38f2cb8

Please sign in to comment.