diff options
author | Patrick Williams <iawillia@us.ibm.com> | 2011-05-25 17:11:33 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2011-06-02 15:13:56 -0500 |
commit | f0e44bc60ca80d5bf875f0836a119e361d84dd44 (patch) | |
tree | d1b7d267a6e292e8c6d10363e7c1df6f7067cb9c /src/kernel/start.S | |
parent | 83e18669b6c2322c8eb5f8632ac823877d765e0d (diff) | |
download | talos-hostboot-f0e44bc60ca80d5bf875f0836a119e361d84dd44.tar.gz talos-hostboot-f0e44bc60ca80d5bf875f0836a119e361d84dd44.zip |
Add HMER access syscalls (as fastpath).
Change-Id: Icc7494986d19950a18cc9ee53fd5125c86096a72
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/105
Tested-by: Jenkins Server
Reviewed-by: Douglas R. Gilbert <dgilbert@us.ibm.com>
Reviewed-by: Andrew J. Geissler <andrewg@us.ibm.com>
Diffstat (limited to 'src/kernel/start.S')
-rw-r--r-- | src/kernel/start.S | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/src/kernel/start.S b/src/kernel/start.S index 7eaf1fdf9..ac57926b4 100644 --- a/src/kernel/start.S +++ b/src/kernel/start.S @@ -126,7 +126,24 @@ STD_INTERRUPT(prog_ex, 0x700) UNIMPL_INTERRUPT(fp_unavail, 0x800) STD_INTERRUPT(decrementer, 0x900) UNIMPL_INTERRUPT(hype_decrementer, 0x980) -STD_INTERRUPT(system_call, 0xC00) + +;// System Call Exception Vector +;// +;// This exception vector implements the save/restore for normal system calls +;// that require C++ code for handling but also implements a fast-path for +;// some simple calls, such as reading protected SPRs. +;// +;// Since this is called from userspace as a function call (see __syscall* +;// functions) we only need to honor the ELF ABI calling conventions. That +;// means some registers and condition fields can be considered volatile and +;// modified prior to being saved. +;// +.org _start + 0xC00 +intvect_system_call_fast: + cmpi cr0, r3, 0x0800 + bge cr0, system_call_fast_path +STD_INTERRUPT(system_call, 0xC08) + UNIMPL_INTERRUPT(trace, 0xD00) UNIMPL_INTERRUPT(hype_data_storage, 0xE00) UNIMPL_INTERRUPT(hype_inst_storage, 0xE20) @@ -320,6 +337,29 @@ kernel_dispatch_task: rfid ;// Execute task. + ;// @fn system_call_fast_path + ;// Handle fast path system calls. + ;// 0x800 = HMER read (HMER -> r3). + ;// 0x801 = HMER write (r4 -> HMER). +system_call_fast_path: + ;// Check if this is HMER read (0x800). + ;// Compare was already done in system call path. + bne cr0, 2f + mfspr r3, HMER + b 1f ;// Jump to exit point. + ;// Check if this is HMER write (0x801). +2: + cmpi cr0, r3, 0x801 + bne cr0, 3f + mtspr HMER, r4 + li r3, 0 + b 1f ;// Jump to exit point. + ;// Invalid system call, loop for debug. +3: + b 3b +1: + rfid ;// Return from interrupt. + .section .data .balign 1024 kernel_stack: |