Use #[repr(packed)] with correct align for paging.
This commit is contained in:
@@ -6,6 +6,7 @@ use crate::memory::Frame;
|
||||
use super::PhysicalAddress;
|
||||
|
||||
/// A page table entry
|
||||
#[repr(packed(8))]
|
||||
pub struct Entry(u64);
|
||||
|
||||
bitflags! {
|
||||
|
||||
@@ -39,6 +39,7 @@ impl HierarchicalLevel for Level2 {
|
||||
type NextLevel = Level1;
|
||||
}
|
||||
|
||||
#[repr(packed(4096))]
|
||||
pub struct Table<L: TableLevel> {
|
||||
entries: [Entry; ENTRY_COUNT],
|
||||
level: PhantomData<L>,
|
||||
|
||||
Reference in New Issue
Block a user