fix: plug memory map leak, save sp_el0, dynamic UART, kill loop
- Bootloader: reallocate memory map buffer when ExitBootServices fails, so GetMemoryMap doesn't scribble past the old allocation on retry. - vectors.S: actually store sp_el0 into the exception frame. Previously it was read into x24 and then… vanished. EL0 tasks would wake up with a corrupted stack pointer. Not great. - Serial: split hardcoded 0x09000000 into a fallback default; add SerialUpdate() so the DTB-parsed UART address actually gets used. - DTB: add bounds check on reserved[] with PMM's 3 extra slots accounted for, so malformed/overstuffed DTBs don't silently corrupt memory. - PMM.h: bump kVMMaxReservedRegions 128→256, define kPMMReservedRegionCount. - Types.h: remove `#define loop while(1)`. while(true) is fine. - Rename IOSerial* → Serial* — the IO prefix was redundant, Serial.c already lives under IO/.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
.macro ventry type
|
||||
.align 7
|
||||
sub sp, sp, #288 // save 288 bytes of stack
|
||||
stp x0, x1, [sp, #0] // move stack
|
||||
stp x0, x1, [sp, #0] // move stack
|
||||
mov x1, #\type // move type to x1
|
||||
b ExceptionsTrapEntry
|
||||
.endm
|
||||
@@ -54,6 +54,7 @@ ExceptionsTrapEntry:
|
||||
|
||||
stp x30, x21, [sp, #16 * 15]
|
||||
stp x22, x23, [sp, #16 * 16]
|
||||
stp x24, xzr, [sp, #16 * 17]
|
||||
|
||||
mov x0, sp
|
||||
bl ExceptionsHandler
|
||||
@@ -92,4 +93,4 @@ ExceptionsVectorsInit:
|
||||
adr x0, ExceptionsVectorsTable
|
||||
msr vbar_el1, x0
|
||||
isb
|
||||
ret
|
||||
ret
|
||||
|
||||
Reference in New Issue
Block a user