git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Kernel/armv7 - Noted said hack as such
[tpg/acess2.git]
/
Kernel
/
arch
/
armv7
/
proc.S
diff --git
a/Kernel/arch/armv7/proc.S
b/Kernel/arch/armv7/proc.S
index
37f9650
..
531de29
100644
(file)
--- a/
Kernel/arch/armv7/proc.S
+++ b/
Kernel/arch/armv7/proc.S
@@
-18,16
+18,8
@@
KernelThreadHeader:
@ TODO: Do something with the thread pointer
ldr r4, [sp],#4 @ Function
@ TODO: Do something with the thread pointer
ldr r4, [sp],#4 @ Function
- ldr r5, [sp],#4
- @ Get arguments
- sub r5, #1
- ldrhs r0, [sp],#4
-@ suble r5, #1
-@ ldrhs r1, [sp],#4
-@ suble r5, #1
-@ ldrhs r2, [sp],#4
-@ suble r5, #1
-@ ldrhs r3, [sp],#4
+ @ Get argument
+ ldr r0, [sp],#4
blx r4
blx r4
@@
-54,6
+46,8
@@
SwitchTask:
ldr r1, [sp,#4*10]
tst r1, r1
mcrne p15, 0, r1, c2, c0, 0 @ Set TTBR0 to r0
ldr r1, [sp,#4*10]
tst r1, r1
mcrne p15, 0, r1, c2, c0, 0 @ Set TTBR0 to r0
+ mov r1, #0
+ mcrne p15, 0, r1, c8, c7, 0 @ TLBIALL - Invalidate all
@ Restore SP
mov sp, r0
@ Restore SP
mov sp, r0
@@
-61,7
+55,7
@@
SwitchTask:
bx r2
.return:
bx r2
.return:
- p
ush
{r4-r12,pc}
+ p
op
{r4-r12,pc}
.extern MM_Clone
.extern MM_DumpTables
.extern MM_Clone
.extern MM_DumpTables
@@
-79,20
+73,32
@@
Proc_CloneInt:
ldr r0, =Proc_CloneInt_new
pop {r4-r12,pc}
Proc_CloneInt_new:
ldr r0, =Proc_CloneInt_new
pop {r4-r12,pc}
Proc_CloneInt_new:
- cps #18
-
mov r0, #0
mov r0, #0
- mov r1, #0x80000000
- bl MM_DumpTables
+ pop {r4-r12,pc}
-@ ldr r0, =csProc_CloneInt_NewTaskMessage
-@ bl Log
-
+@ R0: New user SP
+@ Return: Old user SP
+.globl Proc_int_SwapUserSP
+Proc_int_SwapUserSP:
+ cps #31 @ Go to system mode
+ mov r1, sp
+ tst r0, r0 @ Only update if non-zero
+ movne sp, r0
+ mov r0, r1
cps #19
cps #19
- mov r0, #0
- pop {r4-r12,pc}
+ mov pc, lr
+.section .usertext, "ax"
+.globl Proc_int_DropToUser
+@ R0: User IP
+@ R1: User SP
+Proc_int_DropToUser:
+ cps #16
+ mov sp, r1
+ mov pc, r0
.section .rodata
csProc_CloneInt_NewTaskMessage:
.section .rodata
csProc_CloneInt_NewTaskMessage:
- .asciz "New task"
+ .asciz "New task PC=%p, R4=%p, sp=%p"
+csProc_CloneInt_OldTaskMessage:
+ .asciz "Parent task PC=%p, R4=%p, SP=%p"
UCC
git Repository :: git.ucc.asn.au