diff options
author | Stuart Menefy <stuart.menefy@st.com> | 2007-11-30 02:12:36 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2008-01-27 23:18:58 -0500 |
commit | 1efe4ce3ca126da77e450d5a83f7201949d76f62 (patch) | |
tree | fbae9902aa4103a9e86d06f841d580f24682e7b3 /arch/sh/kernel/cpu | |
parent | 53ff09422e5e7a6d6198b767c8f494e43ec8e3ae (diff) |
sh: GUSA atomic rollback support.
This implements kernel-level atomic rollback built on top of gUSA,
as an alternative non-IRQ based atomicity method. This is generally
a faster method for platforms that are lacking the LL/SC pairs that
SH-4A and later use, and is only supportable on legacy cores.
Signed-off-by: Stuart Menefy <stuart.menefy@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/cpu')
-rw-r--r-- | arch/sh/kernel/cpu/sh3/entry.S | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/arch/sh/kernel/cpu/sh3/entry.S b/arch/sh/kernel/cpu/sh3/entry.S index 0d12a124055c..4004073f98cd 100644 --- a/arch/sh/kernel/cpu/sh3/entry.S +++ b/arch/sh/kernel/cpu/sh3/entry.S | |||
@@ -13,8 +13,9 @@ | |||
13 | #include <linux/linkage.h> | 13 | #include <linux/linkage.h> |
14 | #include <asm/asm-offsets.h> | 14 | #include <asm/asm-offsets.h> |
15 | #include <asm/thread_info.h> | 15 | #include <asm/thread_info.h> |
16 | #include <asm/cpu/mmu_context.h> | ||
17 | #include <asm/unistd.h> | 16 | #include <asm/unistd.h> |
17 | #include <asm/cpu/mmu_context.h> | ||
18 | #include <asm/page.h> | ||
18 | 19 | ||
19 | ! NOTE: | 20 | ! NOTE: |
20 | ! GNU as (as of 2.9.1) changes bf/s into bt/s and bra, when the address | 21 | ! GNU as (as of 2.9.1) changes bf/s into bt/s and bra, when the address |
@@ -409,6 +410,27 @@ ENTRY(handle_exception) | |||
409 | ! Using k0, k1 for scratch registers (r0_bank1, r1_bank), | 410 | ! Using k0, k1 for scratch registers (r0_bank1, r1_bank), |
410 | ! save all registers onto stack. | 411 | ! save all registers onto stack. |
411 | ! | 412 | ! |
413 | |||
414 | #ifdef CONFIG_GUSA | ||
415 | ! Check for roll back gRB (User and Kernel) | ||
416 | mov r15, k0 | ||
417 | shll k0 | ||
418 | bf/s 1f | ||
419 | shll k0 | ||
420 | bf/s 1f | ||
421 | stc spc, k1 | ||
422 | stc r0_bank, k0 | ||
423 | cmp/hs k0, k1 ! test k1 (saved PC) >= k0 (saved r0) | ||
424 | bt/s 2f | ||
425 | stc r1_bank, k1 | ||
426 | |||
427 | add #-2, k0 | ||
428 | add r15, k0 | ||
429 | ldc k0, spc ! PC = saved r0 + r15 - 2 | ||
430 | 2: mov k1, r15 ! SP = r1 | ||
431 | 1: | ||
432 | #endif | ||
433 | |||
412 | stc ssr, k0 ! Is it from kernel space? | 434 | stc ssr, k0 ! Is it from kernel space? |
413 | shll k0 ! Check MD bit (bit30) by shifting it into... | 435 | shll k0 ! Check MD bit (bit30) by shifting it into... |
414 | shll k0 ! ...the T bit | 436 | shll k0 ! ...the T bit |