diff options
| author | Patrick Williams <iawillia@us.ibm.com> | 2011-07-15 12:03:19 -0500 |
|---|---|---|
| committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2011-07-18 12:04:40 -0500 |
| commit | be301c4ea87c944bd1c51ca2c73ac719cec6b495 (patch) | |
| tree | 529436aa13474e54badc7cd6690ae28f7eeda766 /src/kernel/start.S | |
| parent | 62faccd737f97dd4c485770f59bacf1b44dcbc3b (diff) | |
| download | talos-hostboot-be301c4ea87c944bd1c51ca2c73ac719cec6b495.tar.gz talos-hostboot-be301c4ea87c944bd1c51ca2c73ac719cec6b495.zip | |
Add user-space stub for task entry.
This will prevent kernel space from needing to dereference user-space
addresses for starting a task, which is safer and is easier for VMM.
Change-Id: Icad3b832550cedbf291ed8b032840f4049fba18e
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/202
Tested-by: Jenkins Server
Reviewed-by: Douglas R. Gilbert <dgilbert@us.ibm.com>
Reviewed-by: MATTHEW S. BARTH <msbarth@us.ibm.com>
Diffstat (limited to 'src/kernel/start.S')
| -rw-r--r-- | src/kernel/start.S | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/kernel/start.S b/src/kernel/start.S index ac57926b4..381e33bde 100644 --- a/src/kernel/start.S +++ b/src/kernel/start.S @@ -360,6 +360,29 @@ system_call_fast_path: 1: rfid ;// Return from interrupt. + + ;// @fn userspace_task_entry + ;// Stub to load the function address and TOC base from userspace and + ;// jump to task entry point. Used so the kernel doesn't need to + ;// dereference userspace addresses (which could be bad). + ;// + ;// Requires: + ;// * GPR4 -> Function pointer. + ;// * LR -> task_end stub. + ;// * GPR3 -> Task argument. + ;// * GPR1 -> Task stack pointer. + ;// Results: + ;// * TOC base -> GPR2 + ;// * Function Address -> CTR + ;// * GPR1, GPR3 preserved. + ;// * Branch to CTR (no link). +.global userspace_task_entry +userspace_task_entry: + ld r5, 0(r4) + mtctr r5 + ld r2, 8(r4) + bctr + .section .data .balign 1024 kernel_stack: |

