File tree Expand file tree Collapse file tree 2 files changed +3
-15
lines changed Expand file tree Collapse file tree 2 files changed +3
-15
lines changed Original file line number Diff line number Diff line change @@ -86,8 +86,6 @@ impl Vmalloc {
86
86
log:: warn!( "todo: implement this" )
87
87
}
88
88
89
- log:: debug!( "{:?}" , address) ;
90
-
91
89
let mut address_space = AddressSpace :: this ( ) ;
92
90
let mut offset_table = address_space. offset_page_table ( ) ;
93
91
Original file line number Diff line number Diff line change @@ -909,20 +909,10 @@ impl VmProtected {
909
909
} )
910
910
}
911
911
912
+ /// Clears all of the mappings without unmapping them. The caller is responsible
913
+ /// for going through the page table and unmapping all of the pages.
912
914
fn clear ( & mut self ) {
913
- let mut cursor = self . mappings . cursor_front_mut ( ) ;
914
-
915
- let mut address_space = AddressSpace :: this ( ) ;
916
- let mut offset_table = address_space. offset_page_table ( ) ;
917
-
918
- while let Some ( map) = cursor. current ( ) {
919
- // now this should automatically free the physical page backed by this mapping
920
- // if the reference count of that frame is 0 since we have now unmapped it.
921
- map. unmap ( & mut offset_table, map. start_addr , map. end_addr )
922
- . expect ( "vm_clear: unexpected error while unmapping" ) ;
923
-
924
- cursor. remove_current ( ) ;
925
- }
915
+ self . mappings . clear ( )
926
916
}
927
917
928
918
fn munmap ( & mut self , address : VirtAddr , size : usize ) -> bool {
You can’t perform that action at this time.
0 commit comments