diff options
author | Greg Ungerer <gerg@snapgear.com> | 2008-05-23 03:31:39 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-05-23 08:50:08 -0400 |
commit | 415ad1e50abcc86c235a42fbab57f2b6134412d7 (patch) | |
tree | 544076100f62d1210a8f4babe2fed7f62afa92c5 /include/asm-arm/system.h | |
parent | 66aaeff1c27545909e502546120be2c5432394e3 (diff) |
[ARM] 5053/1: define before use of processor_id
For the simple read_cpuid() macro case the variable processor_id has
no definition on use of the macro. Add an extern for it. Move all the
processor ID macros into the #ifndef __ASSEMBLEY__ block.
Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'include/asm-arm/system.h')
-rw-r--r-- | include/asm-arm/system.h | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h index 6335de9a2bb3..514af792a598 100644 --- a/include/asm-arm/system.h +++ b/include/asm-arm/system.h | |||
@@ -48,20 +48,6 @@ | |||
48 | #define CPUID_TCM 2 | 48 | #define CPUID_TCM 2 |
49 | #define CPUID_TLBTYPE 3 | 49 | #define CPUID_TLBTYPE 3 |
50 | 50 | ||
51 | #ifdef CONFIG_CPU_CP15 | ||
52 | #define read_cpuid(reg) \ | ||
53 | ({ \ | ||
54 | unsigned int __val; \ | ||
55 | asm("mrc p15, 0, %0, c0, c0, " __stringify(reg) \ | ||
56 | : "=r" (__val) \ | ||
57 | : \ | ||
58 | : "cc"); \ | ||
59 | __val; \ | ||
60 | }) | ||
61 | #else | ||
62 | #define read_cpuid(reg) (processor_id) | ||
63 | #endif | ||
64 | |||
65 | /* | 51 | /* |
66 | * This is used to ensure the compiler did actually allocate the register we | 52 | * This is used to ensure the compiler did actually allocate the register we |
67 | * asked it for some inline assembly sequences. Apparently we can't trust | 53 | * asked it for some inline assembly sequences. Apparently we can't trust |
@@ -78,6 +64,21 @@ | |||
78 | #include <linux/stringify.h> | 64 | #include <linux/stringify.h> |
79 | #include <linux/irqflags.h> | 65 | #include <linux/irqflags.h> |
80 | 66 | ||
67 | #ifdef CONFIG_CPU_CP15 | ||
68 | #define read_cpuid(reg) \ | ||
69 | ({ \ | ||
70 | unsigned int __val; \ | ||
71 | asm("mrc p15, 0, %0, c0, c0, " __stringify(reg) \ | ||
72 | : "=r" (__val) \ | ||
73 | : \ | ||
74 | : "cc"); \ | ||
75 | __val; \ | ||
76 | }) | ||
77 | #else | ||
78 | extern unsigned int processor_id; | ||
79 | #define read_cpuid(reg) (processor_id) | ||
80 | #endif | ||
81 | |||
81 | /* | 82 | /* |
82 | * The CPU ID never changes at run time, so we might as well tell the | 83 | * The CPU ID never changes at run time, so we might as well tell the |
83 | * compiler that it's constant. Use this function to read the CPU ID | 84 | * compiler that it's constant. Use this function to read the CPU ID |