This commit is contained in:
Jeremy Soller
2024-02-16 21:40:42 -07:00
parent 86589aa7fa
commit 6c6fc18f8e
5 changed files with 14 additions and 10 deletions
+5 -1
View File
@@ -193,7 +193,11 @@ impl Madt {
if &sdt.signature == b"APIC" && sdt.data_len() >= 8 {
//Not valid if no local address and flags
let local_address = unsafe { (sdt.data_address() as *const u32).read_unaligned() };
let flags = unsafe { (sdt.data_address() as *const u32).offset(1).read_unaligned() };
let flags = unsafe {
(sdt.data_address() as *const u32)
.offset(1)
.read_unaligned()
};
Some(Madt {
sdt,
+5 -1
View File
@@ -37,7 +37,11 @@ impl Iterator for RsdtIter {
type Item = usize;
fn next(&mut self) -> Option<Self::Item> {
if self.i < self.sdt.data_len() / mem::size_of::<u32>() {
let item = unsafe { (self.sdt.data_address() as *const u32).add(self.i).read_unaligned() };
let item = unsafe {
(self.sdt.data_address() as *const u32)
.add(self.i)
.read_unaligned()
};
self.i += 1;
Some(item as usize)
} else {
+1 -1
View File
@@ -12,8 +12,8 @@ use crate::{
paging::{entry::EntryFlags, KernelMapper, Page, PageFlags, PhysicalAddress, RmmA, RmmArch},
};
use crate::arch::cpuid::cpuid;
use super::pic;
use crate::arch::cpuid::cpuid;
pub struct IoApicRegs {
pointer: *const u32,
+2 -6
View File
@@ -83,12 +83,8 @@ pub fn init() {
unsafe {
let percpu = PercpuBlock::current();
percpu
.switch_internals
.set_context_id(context.id);
percpu
.switch_internals
.set_idle_id(context.id);
percpu.switch_internals.set_context_id(context.id);
percpu.switch_internals.set_idle_id(context.id);
}
}
+1 -1
View File
@@ -265,7 +265,7 @@ pub struct ContextSwitchPercpu {
context_id: Cell<ContextId>,
// The ID of the idle process
idle_id: Cell<ContextId>
idle_id: Cell<ContextId>,
}
impl ContextSwitchPercpu {
pub fn context_id(&self) -> ContextId {