File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed
src/structures/paging/mapper Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ use crate::structures::paging::{
1818} ;
1919use crate :: { PhysAddr , VirtAddr } ;
2020
21+ use super :: page_table:: FrameError ;
22+
2123mod mapped_page_table;
2224mod offset_page_table;
2325#[ cfg( feature = "instructions" ) ]
@@ -804,6 +806,15 @@ pub enum UnmapError {
804806 InvalidFrameAddress ( PhysAddr ) ,
805807}
806808
809+ impl From < FrameError > for UnmapError {
810+ fn from ( e : FrameError ) -> Self {
811+ match e {
812+ FrameError :: FrameNotPresent => Self :: PageNotMapped ,
813+ FrameError :: HugeFrame => Self :: ParentEntryHugePage ,
814+ }
815+ }
816+ }
817+
807818impl From < Infallible > for UnmapError {
808819 fn from ( i : Infallible ) -> Self {
809820 match i { }
@@ -820,6 +831,15 @@ pub enum FlagUpdateError {
820831 ParentEntryHugePage ,
821832}
822833
834+ impl From < FrameError > for FlagUpdateError {
835+ fn from ( e : FrameError ) -> Self {
836+ match e {
837+ FrameError :: FrameNotPresent => Self :: PageNotMapped ,
838+ FrameError :: HugeFrame => Self :: ParentEntryHugePage ,
839+ }
840+ }
841+ }
842+
823843impl From < Infallible > for FlagUpdateError {
824844 fn from ( i : Infallible ) -> Self {
825845 match i { }
Original file line number Diff line number Diff line change @@ -305,9 +305,10 @@ impl<'a> RecursivePageTable<'a> {
305305 #[ cfg( feature = "experimental" ) ]
306306 unsafe fn next_table_fn_next_table_mut < ' b , I > (
307307 _: & mut I ,
308- _ : & ' b mut PageTableEntry ,
308+ e : & ' b mut PageTableEntry ,
309309 page : Page ,
310- ) -> Result < & ' b mut PageTable , Infallible > {
310+ ) -> Result < & ' b mut PageTable , FrameError > {
311+ e. frame ( ) ?;
311312 Ok ( unsafe { & mut * page. start_address ( ) . as_mut_ptr ( ) } )
312313 }
313314
You can’t perform that action at this time.
0 commit comments