Format
This commit is contained in:
+5
-1
@@ -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
@@ -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 {
|
||||
|
||||
@@ -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
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user