summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Simek <monstr@monstr.eu>2009-08-31 16:24:56 +0200
committerMichal Simek <monstr@monstr.eu>2009-09-21 14:29:21 +0200
commit9002062ff52696888847224a778a3279bc8c1cb5 (patch)
tree8a68281f621df2702b58d38f7e13b8639db13af0
parent2622434ee0108c65808a63f067e72d0bbc75b372 (diff)
microblaze: Improve checking mechanism for MSR instruction
It is more safe to use clear instead of msrset. We save some instructions too. Signed-off-by: Michal Simek <monstr@monstr.eu>
-rw-r--r--arch/microblaze/kernel/head.S13
1 files changed, 5 insertions, 8 deletions
diff --git a/arch/microblaze/kernel/head.S b/arch/microblaze/kernel/head.S
index bfc7ea801cc..697ce3007f3 100644
--- a/arch/microblaze/kernel/head.S
+++ b/arch/microblaze/kernel/head.S
@@ -54,19 +54,16 @@ ENTRY(_start)
mfs r1, rmsr
andi r1, r1, ~2
mts rmsr, r1
-
/*
* Here is checking mechanism which check if Microblaze has msr instructions
* We load msr and compare it with previous r1 value - if is the same,
* msr instructions works if not - cpu don't have them.
*/
- or r8, r0, r0 /* 0 - I have msr instr, 1 - I don't have */
- or r12, r0, r0
- msrset r12, 0 /* set nothing - just read msr for test */
- cmpu r12, r12, r1
- beqi r12, 1f
- ori r8, r0, 1 /* I don't have msr */
-1:
+ /* r8=0 - I have msr instr, 1 - I don't have them */
+ rsubi r0, r0, 1 /* set the carry bit */
+ msrclr r0, 0x4 /* try to clear it */
+ /* read the carry bit, r8 will be '0' if msrclr exists */
+ addik r8, r0, 0
/* r7 may point to an FDT, or there may be one linked in.
if it's in r7, we've got to save it away ASAP.