From 6d918e02d04e7cb2a47315158b7ecfbb379437d1 Mon Sep 17 00:00:00 2001 From: Olivier Houchard Date: Mon, 3 Oct 2005 14:05:38 +0000 Subject: [PATCH] Implement savectx(). Obtained from: NetBSD --- sys/arm/arm/swtch.S | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sys/arm/arm/swtch.S b/sys/arm/arm/swtch.S index 63b20b63453e..f4fffe804cb2 100644 --- a/sys/arm/arm/swtch.S +++ b/sys/arm/arm/swtch.S @@ -450,7 +450,22 @@ ENTRY(cpu_switch) .asciz "cpu_switch: sched_qs empty with non-zero sched_whichqs!\n" #endif ENTRY(savectx) + stmfd sp!, {r4-r7, lr} + /* + * r0 = pcb + */ + /* Store all the registers in the process's pcb */ +#ifndef __XSCALE__ + add r2, r0, #(PCB_R8) + stmia r2, {r8-r13} +#else + strd r8, [r0, #(PCB_R8)] + strd r10, [r0, #(PCB_R10)] + strd r12, [r0, #(PCB_R12)] +#endif + ldmfd sp!, {r4-r7, pc} RET + ENTRY(fork_trampoline) mov r1, r5 mov r2, sp