File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -176,6 +176,7 @@ impl PagingMetaData for ExtendedPageTableMetadata {
176176
177177 // Under the x86 architecture, the flush_tlb operation will invoke the ring0 instruction,
178178 // causing the test to trigger a SIGSEGV exception.
179+ #[ allow( unused_variables) ]
179180 fn flush_tlb ( vaddr : Option < GuestPhysAddr > ) {
180181 #[ cfg( not( test) ) ]
181182 if let Some ( vaddr) = vaddr {
Original file line number Diff line number Diff line change @@ -76,10 +76,31 @@ impl PagingHandler for MockHal {
7676 Self :: mock_alloc_frame ( )
7777 }
7878
79+ fn alloc_frames ( count : usize , _align : usize ) -> Option < PhysAddr > {
80+ if count == 0 {
81+ return Some ( PhysAddr :: from ( 0 ) ) ;
82+ }
83+ // For simplicity, just allocate frames sequentially
84+ let first = Self :: mock_alloc_frame ( ) ?;
85+ for _ in 1 ..count {
86+ if Self :: mock_alloc_frame ( ) . is_none ( ) {
87+ return None ;
88+ }
89+ }
90+ Some ( first)
91+ }
92+
7993 fn dealloc_frame ( _paddr : PhysAddr ) {
8094 Self :: mock_dealloc_frame ( _paddr)
8195 }
8296
97+ fn dealloc_frames ( paddr : PhysAddr , count : usize ) {
98+ for i in 0 ..count {
99+ let offset = i * PAGE_SIZE ;
100+ Self :: mock_dealloc_frame ( PhysAddr :: from ( paddr. as_usize ( ) + offset) ) ;
101+ }
102+ }
103+
83104 fn phys_to_virt ( paddr : PhysAddr ) -> VirtAddr {
84105 Self :: mock_phys_to_virt ( paddr)
85106 }
You can’t perform that action at this time.
0 commit comments