3 * - By John Hodge (thePowersGang)
6 * - Process management assembly
9 #include "include/assembly.h"
11 .globl KernelThreadHeader
13 @ SP+8: Argument Count
15 @ SP+0: Thread Pointer
18 @ TODO: Do something with the thread pointer
20 ldr r4, [sp],#4 @ Function
32 @ R1: Pointer to where to save old stack
34 @ R3: Pointer to save old IP
35 @ SP+0: New address space
45 @ Only update TTBR0 if the task has an explicit address space
48 mcrne p15, 0, r1, c2, c0, 0 @ Set TTBR0 to r0
50 mcrne p15, 0, r1, c8, c7, 0 @ TLBIALL - Invalid user space
66 mov r4, r1 @ Save mem destination
67 str sp, [r0] @ Save SP to SP dest
70 str r0, [r4] @ Save clone return to Mem Dest
72 ldr r0, =Proc_CloneInt_new
80 .globl Proc_int_SwapUserSP
82 cps #31 @ Go to system mode
84 tst r0, r0 @ Only update if non-zero
90 .section .usertext, "ax"
91 .globl Proc_int_DropToUser
100 csProc_CloneInt_NewTaskMessage:
101 .asciz "New task PC=%p, R4=%p, sp=%p"
102 csProc_CloneInt_OldTaskMessage:
103 .asciz "Parent task PC=%p, R4=%p, SP=%p"