diff options
| author | Christian Cunningham <cc@localhost> | 2022-01-22 23:18:22 -0700 | 
|---|---|---|
| committer | Christian Cunningham <cc@localhost> | 2022-01-22 23:18:22 -0700 | 
| commit | 3ace36ab03f40db05a7876013b7d814a3e5ca171 (patch) | |
| tree | a3961e767c4c6672134bac263e72c4047b45fef1 /src/boot.S | |
| parent | 9c0cb4e1f7df02f24751833b384963917bbf2360 (diff) | |
Added SVC call for clean stack
Diffstat (limited to 'src/boot.S')
| -rw-r--r-- | src/boot.S | 17 | 
1 files changed, 14 insertions, 3 deletions
| @@ -136,14 +136,25 @@ svc:  	// TODO: Make supervisor mode return to a specific location  	//  (rather than to a user location) such as the kernel loop  	cmp r0, #0 -	bne 2f +	bne 3f  	cps #0x13  	b   1f -2: +3:  	cmp r0, #2 -	bne 1f +	bne 2f  	ldmfd sp!, {r0-r12,lr}  	b schedule +2: +	cmp r0, #3 +	bne 1f +	ldr r3, =scheduler +	ldr r2, [r3, #0] +	ldr r1, [r2, #8] // sp_base +	cmp r1, #-1 +	beq 1f +	ldr r3, =stacks_table +	mov r0, #0 +	strb r0, [r3, r1]  1:  	ldmfd sp!, {r0-r12,pc}^  io_halt_prefetch: | 
