File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ use addr::*;
22use core:: fmt:: { Debug , Error , Formatter } ;
33use core:: ops:: { Index , IndexMut } ;
44
5+ #[ repr( C ) ]
56pub struct PageTable {
67 entries : [ PageTableEntry ; ENTRY_COUNT ] ,
78}
@@ -53,6 +54,7 @@ impl Debug for PageTable {
5354}
5455
5556#[ derive( Copy , Clone ) ]
57+ #[ repr( C ) ]
5658pub struct PageTableEntry ( usize ) ;
5759
5860impl PageTableEntry {
@@ -79,9 +81,6 @@ impl PageTableEntry {
7981 flags |= EF :: ACCESSED | EF :: DIRTY ;
8082 self . 0 = ( frame. number ( ) << 10 ) | flags. bits ( ) ;
8183 }
82- pub fn flags_mut ( & mut self ) -> & mut PageTableFlags {
83- unsafe { & mut * ( self as * mut _ as * mut PageTableFlags ) }
84- }
8584}
8685
8786impl Debug for PageTableEntry {
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ pub trait Mapper {
3030 flags : PageTableFlags ,
3131 ) -> Result < MapperFlush , FlagUpdateError > {
3232 self . ref_entry ( page) . map ( |e| {
33- * e . flags_mut ( ) = flags;
33+ e . set ( e . frame ( ) , flags) ;
3434 MapperFlush :: new ( page)
3535 } )
3636 }
You can’t perform that action at this time.
0 commit comments