Skip to content

Commit

Permalink
Fix compilation issue regarding 'naked_asm'
Browse files Browse the repository at this point in the history
  • Loading branch information
fruhland committed Oct 9, 2024
1 parent 4736308 commit f6dd533
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
14 changes: 6 additions & 8 deletions towboot/src/boot/config_tables.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,12 @@ fn handle_acpi(table: &ConfigTableEntry, info_builder: &mut InfoBuilder) {
rsdp.revision(), rsdp.rsdt_address(),
);
} else {
unsafe {
info_builder.set_rsdp_v2(
rsdp.signature(), rsdp.checksum(),
rsdp.oem_id().as_bytes()[0..6].try_into().unwrap(),
rsdp.revision(), rsdp.rsdt_address(), rsdp.length(),
rsdp.xsdt_address(), rsdp.ext_checksum(),
);
}
info_builder.set_rsdp_v2(
rsdp.signature(), rsdp.checksum(),
rsdp.oem_id().as_bytes()[0..6].try_into().unwrap(),
rsdp.revision(), rsdp.rsdt_address(), rsdp.length(),
rsdp.xsdt_address(), rsdp.ext_checksum(),
);
}
}

Expand Down
6 changes: 3 additions & 3 deletions towboot/src/boot/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use x86::{
};

use core::arch::asm;
use core::arch::naked_asm;
use core::ffi::c_void;
use core::ptr::NonNull;
use uefi::prelude::*;
Expand Down Expand Up @@ -588,7 +589,7 @@ impl EntryPoint {
#[naked]
extern "stdcall" fn jump_multiboot_common() {
unsafe {
asm!(
naked_asm!(
".code32",
// > ‘CR0’ Bit 31 (PG) must be cleared. Bit 0 (PE) must be set.
// > Other bits are all undefined.
Expand Down Expand Up @@ -618,8 +619,7 @@ impl EntryPoint {
// write the struct address to EBX
"mov ebx, esi",
// finally jump to the kernel
"jmp edi",
options(noreturn),
"jmp edi"
);
}
}
Expand Down

0 comments on commit f6dd533

Please sign in to comment.