diff options
author | David Howells <dhowells@redhat.com> | 2008-04-10 11:10:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-10 16:41:29 -0400 |
commit | e31c243f984628d02f045dc4b622f1e2827860dc (patch) | |
tree | cd2ac2f33c7da86b515087260d93179b31fd1671 /arch/frv/kernel/entry.S | |
parent | 0c93d8e4d342b1b5cda1037f2527fcf443c80fbc (diff) |
FRV: Add support for emulation of userspace atomic ops [try #2]
Use traps 120-126 to emulate atomic cmpxchg32, xchg32, and XOR-, OR-, AND-, SUB-
and ADD-to-memory operations for userspace.
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/frv/kernel/entry.S')
-rw-r--r-- | arch/frv/kernel/entry.S | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/frv/kernel/entry.S b/arch/frv/kernel/entry.S index f36d7f4a7c25..b8a4b94779b1 100644 --- a/arch/frv/kernel/entry.S +++ b/arch/frv/kernel/entry.S | |||
@@ -656,6 +656,26 @@ __entry_debug_exception: | |||
656 | 656 | ||
657 | ############################################################################### | 657 | ############################################################################### |
658 | # | 658 | # |
659 | # handle atomic operation emulation for userspace | ||
660 | # | ||
661 | ############################################################################### | ||
662 | .globl __entry_atomic_op | ||
663 | __entry_atomic_op: | ||
664 | LEDS 0x6012 | ||
665 | sethi.p %hi(atomic_operation),gr5 | ||
666 | setlo %lo(atomic_operation),gr5 | ||
667 | movsg esfr1,gr8 | ||
668 | movsg epcr0,gr9 | ||
669 | movsg esr0,gr10 | ||
670 | |||
671 | # now that we've accessed the exception regs, we can enable exceptions | ||
672 | movsg psr,gr4 | ||
673 | ori gr4,#PSR_ET,gr4 | ||
674 | movgs gr4,psr | ||
675 | jmpl @(gr5,gr0) ; call atomic_operation(esfr1,epcr0,esr0) | ||
676 | |||
677 | ############################################################################### | ||
678 | # | ||
659 | # handle media exception | 679 | # handle media exception |
660 | # | 680 | # |
661 | ############################################################################### | 681 | ############################################################################### |