diff options
| author | Ingo Molnar <mingo@elte.hu> | 2008-06-25 06:32:01 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2008-06-25 06:32:01 -0400 |
| commit | da7878d75b8520c9ae00d27dfbbce546a7bfdfbb (patch) | |
| tree | 547fd497a80818a60ac36831377d5df97868173c /include/asm-arm/system.h | |
| parent | 0e50a4c6ab94ffe7e5515b86b5df9e5abc8c6b13 (diff) | |
| parent | 543cf4cb3fe6f6cae3651ba918b9c56200b257d0 (diff) | |
Merge branch 'linus' into x86/pebs
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 |
