summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbr <br@FreeBSD.org>2016-02-17 13:49:38 +0000
committerbr <br@FreeBSD.org>2016-02-17 13:49:38 +0000
commita59deda1ac7ad1e55fb6be6f15ee343b28bcb340 (patch)
tree990742fc3ce3b9b62c794b782dc915a4ad62b14e
parent97821f014d479d772247a29ca66c704f0a6b4c44 (diff)
downloadFreeBSD-src-a59deda1ac7ad1e55fb6be6f15ee343b28bcb340.zip
FreeBSD-src-a59deda1ac7ad1e55fb6be6f15ee343b28bcb340.tar.gz
Add the implementation of savectx().
-rw-r--r--sys/riscv/riscv/swtch.S27
1 files changed, 23 insertions, 4 deletions
diff --git a/sys/riscv/riscv/swtch.S b/sys/riscv/riscv/swtch.S
index 413e666..1a9092f 100644
--- a/sys/riscv/riscv/swtch.S
+++ b/sys/riscv/riscv/swtch.S
@@ -256,8 +256,27 @@ ENTRY(fork_trampoline)
END(fork_trampoline)
ENTRY(savectx)
- la a0, .Lsavectx_panic_str
- call panic
-.Lsavectx_panic_str:
- .asciz "savectx_panic: %p\0"
+ /* Store ra, sp and the callee-saved registers */
+ sd ra, (PCB_RA)(a0)
+ sd sp, (PCB_SP)(a0)
+
+ /* s[0-11] */
+ sd s0, (PCB_S + 0 * 8)(a0)
+ sd s1, (PCB_S + 1 * 8)(a0)
+ sd s2, (PCB_S + 2 * 8)(a0)
+ sd s3, (PCB_S + 3 * 8)(a0)
+ sd s4, (PCB_S + 4 * 8)(a0)
+ sd s5, (PCB_S + 5 * 8)(a0)
+ sd s6, (PCB_S + 6 * 8)(a0)
+ sd s7, (PCB_S + 7 * 8)(a0)
+ sd s8, (PCB_S + 8 * 8)(a0)
+ sd s9, (PCB_S + 9 * 8)(a0)
+ sd s10, (PCB_S + 10 * 8)(a0)
+ sd s11, (PCB_S + 11 * 8)(a0)
+
+ /* Store the VFP registers */
+#ifdef VFP
+ /* TODO */
+#endif
+ ret
END(savectx)
OpenPOWER on IntegriCloud