You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/registers/model_specific.rs
+16-26Lines changed: 16 additions & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -72,8 +72,10 @@ pub struct SCet;
72
72
pubstructPat;
73
73
74
74
/// IA32_APIC_BASE: status and location of the local APIC
75
+
///
76
+
/// IA32_APIC_BASE must be supported on the CPU, otherwise, a general protection exception will occur. Support can be detected using the `cpuid` instruction.
75
77
#[derive(Debug)]
76
-
pubstructApic;
78
+
pubstructApicBase;
77
79
78
80
implEfer{
79
81
/// The underlying model specific register.
@@ -136,7 +138,7 @@ impl Pat {
136
138
];
137
139
}
138
140
139
-
implApic{
141
+
implApicBase{
140
142
/// The underlying model specific register.
141
143
pubconstMSR:Msr = Msr(0x1B);
142
144
}
@@ -231,7 +233,7 @@ bitflags! {
231
233
/// Flags for the Advanced Programmable Interrupt Controler Base Register.
let reserved = old_flags & !(ApicFlags::all().bits());
787
+
let reserved = old_flags & !(ApicBaseFlags::all().bits());
795
788
let new_flags = reserved | flags.bits();
796
789
797
790
unsafe{
798
791
Self::write_raw(frame, new_flags);
799
792
}
800
793
}
801
794
802
-
/// Writes the IA32_APIC_BASE flags.
795
+
/// Writes the IA32_APIC_BASE MSR flags.
803
796
///
804
797
/// Does not preserve any bits, including reserved fields.
805
798
///
806
-
/// The APIC_BASE must be supported on the CPU, otherwise a general protection exception will
807
-
/// occur. Support can be detected using the `cpuid` instruction.
808
-
///
809
799
/// ## Safety
810
800
///
811
801
/// Unsafe because it's possible to set reserved bits to `1` and changing the APIC base address allows hijacking a page of physical memory space in ways that would violate Rust's memory rules.
0 commit comments