Use #[repr(packed)] with correct align for paging.

This commit is contained in:
4lDO2
2020-06-11 11:58:58 +02:00
parent 93e0db1aa3
commit c7b207f4dc
2 changed files with 2 additions and 0 deletions

View File

@@ -6,6 +6,7 @@ use crate::memory::Frame;
use super::PhysicalAddress;
/// A page table entry
#[repr(packed(8))]
pub struct Entry(u64);
bitflags! {

View File

@@ -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>,