Skip to content
Snippets Groups Projects
Commit 067a832f authored by Stefan Lankes's avatar Stefan Lankes
Browse files

remove obsolete function `detect_from_uhyve`

parent 32510fd5
No related branches found
No related tags found
No related merge requests found
...@@ -265,7 +265,7 @@ fn detect_from_acpi() -> Result<PhysAddr, ()> { ...@@ -265,7 +265,7 @@ fn detect_from_acpi() -> Result<PhysAddr, ()> {
#[cfg(feature = "acpi")] #[cfg(feature = "acpi")]
fn detect_from_acpi() -> Result<PhysAddr, ()> { fn detect_from_acpi() -> Result<PhysAddr, ()> {
// Get the Multiple APIC Description Table (MADT) from the ACPI information and its specific table header. // Get the Multiple APIC Description Table (MADT) from the ACPI information and its specific table header.
let madt = acpi::get_madt().expect("HermitCore requires a MADT in the ACPI tables"); let madt = acpi::get_madt().ok_or(())?;
let madt_header = unsafe { &*(madt.table_start_address() as *const AcpiMadtHeader) }; let madt_header = unsafe { &*(madt.table_start_address() as *const AcpiMadtHeader) };
// Jump to the actual table entries (after the table header). // Jump to the actual table entries (after the table header).
...@@ -429,24 +429,14 @@ fn default_apic() -> PhysAddr { ...@@ -429,24 +429,14 @@ fn default_apic() -> PhysAddr {
let default_address = PhysAddr(0xFEE0_0000); let default_address = PhysAddr(0xFEE0_0000);
init_ioapic_address(default_address); // currently, uhyve doesn't support an IO-APIC
if !env::is_uhyve() {
init_ioapic_address(default_address);
}
default_address default_address
} }
fn detect_from_uhyve() -> Result<PhysAddr, ()> {
if env::is_uhyve() {
let default_address = PhysAddr(0xFEE0_0000);
// currently, uhyve doesn't support an IO-APIC
//init_ioapic_address(default_address);
Ok(default_address)
} else {
Err(())
}
}
#[no_mangle] #[no_mangle]
pub extern "C" fn eoi() { pub extern "C" fn eoi() {
local_apic_write(IA32_X2APIC_EOI, APIC_EOI_ACK); local_apic_write(IA32_X2APIC_EOI, APIC_EOI_ACK);
...@@ -454,8 +444,7 @@ pub extern "C" fn eoi() { ...@@ -454,8 +444,7 @@ pub extern "C" fn eoi() {
pub fn init() { pub fn init() {
// Detect CPUs and APICs. // Detect CPUs and APICs.
let local_apic_physical_address = detect_from_uhyve() let local_apic_physical_address = detect_from_acpi()
.or_else(|_| detect_from_acpi())
.or_else(|_| detect_from_mp()) .or_else(|_| detect_from_mp())
.unwrap_or_else(|_| default_apic()); .unwrap_or_else(|_| default_apic());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment