Skip to content

Commit a9b44b8

Browse files
authored
Merge pull request #59 from dlrobertson/ioapic
Add basic I/O APIC support.
2 parents 4f068a2 + fa15e68 commit a9b44b8

File tree

5 files changed

+717
-4
lines changed

5 files changed

+717
-4
lines changed

mythril_core/src/acpi/madt.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ bitflags! {
123123
}
124124

125125
/// Interrupt Controller Structures.
126+
#[derive(Debug)]
126127
pub enum Ics {
127128
/// Processor Local APIC Structure.
128129
///
@@ -142,7 +143,7 @@ pub enum Ics {
142143
/// I/O APIC ID.
143144
ioapic_id: u8,
144145
/// 32-bit physical address to access this I/O APIC.
145-
ioapic_addr: *const u8,
146+
ioapic_addr: *mut u8,
146147
/// Global System Interrupt number where this I/O APIC's interrupt
147148
/// input starts.
148149
gsi_base: u32,
@@ -208,7 +209,7 @@ impl Ics {
208209
let ioapic_addr = NativeEndian::read_u32(&bytes[2..6]);
209210
Ok(Ics::IoApic {
210211
ioapic_id: bytes[0],
211-
ioapic_addr: ioapic_addr as *const u8,
212+
ioapic_addr: ioapic_addr as *mut u8,
212213
gsi_base: NativeEndian::read_u32(&bytes[6..10]),
213214
})
214215
}

mythril_core/src/error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use x86::bits64::rflags;
55
use x86::bits64::rflags::RFlags;
66

77
// See Section 30.4
8-
#[derive(Debug, TryFromPrimitive)]
8+
#[derive(Debug, PartialEq, TryFromPrimitive)]
99
#[repr(u64)]
1010
pub enum VmInstructionError {
1111
// Use to represent any error that is not in the current spec
@@ -65,7 +65,7 @@ pub fn check_vm_insruction(rflags: u64, error: String) -> Result<()> {
6565
}
6666
}
6767

68-
#[derive(Debug)]
68+
#[derive(Debug, PartialEq)]
6969
pub enum Error {
7070
Vmcs(String),
7171
VmFailInvalid(String),

0 commit comments

Comments
 (0)