1
0
Fork 0
mirror of https://github.com/hermitcore/libhermit.git synced 2025-03-09 00:00:03 +01:00

avoid memory access by preloading image_size into r11

This commit is contained in:
Stefan Lankes 2017-07-27 11:01:54 +02:00
parent 3bdcd74d03
commit 27d4401372

View file

@ -194,6 +194,7 @@ Lno_mbinfo:
xor rcx, rcx
mov rsi, 510*0x200000
sub rsi, kernel_start
mov r11, QWORD [image_size]
Lremap:
mov QWORD [rdi], rax
add rax, 0x200000
@ -202,7 +203,7 @@ Lremap:
; note: the whole code segement has to fit in the first pgd
cmp rcx, rsi
jnb Lno_pml4_init
cmp rcx, QWORD [image_size]
cmp rcx, r11
jb Lremap
Lno_pml4_init: