Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 97289
b: refs/heads/master
c: 415ad1e
h: refs/heads/master
i:
  97287: d44b91c
v: v3
  • Loading branch information
Greg Ungerer authored and Russell King committed May 23, 2008
1 parent 31800d8 commit e7fd398
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 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: 66aaeff1c27545909e502546120be2c5432394e3
refs/heads/master: 415ad1e50abcc86c235a42fbab57f2b6134412d7
29 changes: 15 additions & 14 deletions trunk/include/asm-arm/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,6 @@
#define CPUID_TCM 2
#define CPUID_TLBTYPE 3

#ifdef CONFIG_CPU_CP15
#define read_cpuid(reg) \
({ \
unsigned int __val; \
asm("mrc p15, 0, %0, c0, c0, " __stringify(reg) \
: "=r" (__val) \
: \
: "cc"); \
__val; \
})
#else
#define read_cpuid(reg) (processor_id)
#endif

/*
* This is used to ensure the compiler did actually allocate the register we
* asked it for some inline assembly sequences. Apparently we can't trust
Expand All @@ -78,6 +64,21 @@
#include <linux/stringify.h>
#include <linux/irqflags.h>

#ifdef CONFIG_CPU_CP15
#define read_cpuid(reg) \
({ \
unsigned int __val; \
asm("mrc p15, 0, %0, c0, c0, " __stringify(reg) \
: "=r" (__val) \
: \
: "cc"); \
__val; \
})
#else
extern unsigned int processor_id;
#define read_cpuid(reg) (processor_id)
#endif

/*
* The CPU ID never changes at run time, so we might as well tell the
* compiler that it's constant. Use this function to read the CPU ID
Expand Down

0 comments on commit e7fd398

Please sign in to comment.