Fix "upper" entry without upper flag
This commit is contained in:
parent
ddde48abc5
commit
6f38311de1
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -25,4 +25,4 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "yboot2-proto"
|
||||
version = "0.1.0"
|
||||
source = "git+https://git.alnyan.me/yggdrasil/yboot2-proto.git#1591988e76a380b7b8fea261aaf2e04760790d5e"
|
||||
source = "git+https://git.alnyan.me/yggdrasil/yboot2-proto.git#f9c0ad12f7d225a99b7a3c31417576fcd46d8b7a"
|
||||
|
11
src/main.rs
11
src/main.rs
@ -88,11 +88,20 @@ fn main() -> Result<(), BootError> {
|
||||
set_efi_mmap(data, &mmap)?;
|
||||
|
||||
// Setup upper virtual mapping if requested
|
||||
let real_entry: usize;
|
||||
if (data.get_flags() & yboot2_proto::FLAG_UPPER) != 0 {
|
||||
mem::setup_upper();
|
||||
|
||||
real_entry = entry;
|
||||
} else {
|
||||
real_entry = if entry >= 0xFFFFFF0000000000 {
|
||||
entry - 0xFFFFFF0000000000
|
||||
} else {
|
||||
entry
|
||||
};
|
||||
}
|
||||
unsafe {
|
||||
llvm_asm!("xor %rbp, %rbp; jmp *$0"::"{di}"(entry));
|
||||
llvm_asm!("xor %rbp, %rbp; jmp *$0"::"{di}"(real_entry));
|
||||
}
|
||||
loop {}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user