thermosphere: add cctx->userFrame

This commit is contained in:
TuxSH
2020-01-13 22:46:10 +00:00
parent 674f3d0fc9
commit c085a67150
2 changed files with 27 additions and 22 deletions

View File

@@ -65,12 +65,12 @@
.macro PIVOT_STACK_FOR_CRASH
// Note: x18 assumed uncorrupted
// Note: replace sp_el0 with crashing sp
str x16, [x18, #0x18] // currentCoreCtx->scratch = x16
str x16, [x18, #8] // currentCoreCtx->scratch = x16
mov x16, sp
msr sp_el0, x16
ldr x16, [x18, #0x10] // currentCoreCtx->crashStack
ldr x16, [x18, #0x10] // currentCoreCtx->crashStack
mov sp, x16
ldr x16, [x18, #0x18]
ldr x16, [x18, #8]
.endm
.equ EXCEPTION_TYPE_HOST, 0
@@ -85,14 +85,16 @@ vector_entry \name
SAVE_MOST_REGISTERS
mov x0, sp
.if \type == EXCEPTION_TYPE_GUEST
ldp x18, xzr, [sp, #STACK_FRAME_SIZE]
str x0, [x18] // currentCoreCtx->userFrame
mov w1, #1
.else
mov w1, #0
.endif
mov x0, sp
bl exceptionEntryPostprocess
.endm