aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Anshul Gupta <ansg191@anshulg.com> 2023-12-22 18:12:58 -0800
committerGravatar Anshul Gupta <ansg191@anshulg.com> 2023-12-22 18:12:58 -0800
commitc16bbbefa41052d9ec2f4878bf7128756dae2086 (patch)
tree3a8be432c6c32fd539b403c2513b78f5dade618f /src
parente4f2d1e9868611d1581b15eded3d552297b41519 (diff)
downloadrust-x86-master.tar.gz
rust-x86-master.tar.zst
rust-x86-master.zip
Makes `xapic` read & write publicHEADmaster
Diffstat (limited to '')
-rw-r--r--src/apic/xapic.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/apic/xapic.rs b/src/apic/xapic.rs
index 218e4c5..80bea6d 100644
--- a/src/apic/xapic.rs
+++ b/src/apic/xapic.rs
@@ -143,7 +143,7 @@ pub const XAPIC_TIMER_DIV_CONF: u32 = 0x3E0;
#[derive(Copy, Clone)]
#[allow(dead_code, non_camel_case_types)]
-enum ApicRegister {
+pub enum ApicRegister {
XAPIC_ID = XAPIC_ID as isize,
XAPIC_VERSION = XAPIC_VERSION as isize,
XAPIC_TPR = XAPIC_TPR as isize,
@@ -301,14 +301,14 @@ impl XAPIC {
}
/// Read a register from the MMIO region.
- fn read(&self, offset: ApicRegister) -> u32 {
+ pub fn read(&self, offset: ApicRegister) -> u32 {
assert!(offset as usize % 4 == 0);
let index = offset as usize / 4;
unsafe { core::ptr::read_volatile(&self.mmio_region[index]) }
}
/// write a register in the MMIO region.
- fn write(&mut self, offset: ApicRegister, val: u32) {
+ pub fn write(&mut self, offset: ApicRegister, val: u32) {
assert!(offset as usize % 4 == 0);
let index = offset as usize / 4;
unsafe { core::ptr::write_volatile(&mut self.mmio_region[index], val) }