@@ -41,7 +41,7 @@ impl<'a, P: PhysToVirt> MappedPageTable<'a, P> {
4141 fn map_to_1gib < A > (
4242 & mut self ,
4343 page : Page < Size1GiB > ,
44- frame : UnusedPhysFrame < Size1GiB > ,
44+ frame : PhysFrame < Size1GiB > ,
4545 flags : PageTableFlags ,
4646 allocator : & mut A ,
4747 ) -> Result < MapperFlush < Size1GiB > , MapToError < Size1GiB > >
@@ -66,7 +66,7 @@ impl<'a, P: PhysToVirt> MappedPageTable<'a, P> {
6666 fn map_to_2mib < A > (
6767 & mut self ,
6868 page : Page < Size2MiB > ,
69- frame : UnusedPhysFrame < Size2MiB > ,
69+ frame : PhysFrame < Size2MiB > ,
7070 flags : PageTableFlags ,
7171 allocator : & mut A ,
7272 ) -> Result < MapperFlush < Size2MiB > , MapToError < Size2MiB > >
@@ -94,7 +94,7 @@ impl<'a, P: PhysToVirt> MappedPageTable<'a, P> {
9494 fn map_to_4kib < A > (
9595 & mut self ,
9696 page : Page < Size4KiB > ,
97- frame : UnusedPhysFrame < Size4KiB > ,
97+ frame : PhysFrame < Size4KiB > ,
9898 flags : PageTableFlags ,
9999 allocator : & mut A ,
100100 ) -> Result < MapperFlush < Size4KiB > , MapToError < Size4KiB > >
@@ -115,17 +115,17 @@ impl<'a, P: PhysToVirt> MappedPageTable<'a, P> {
115115 if !p1[ page. p1_index ( ) ] . is_unused ( ) {
116116 return Err ( MapToError :: PageAlreadyMapped ( frame) ) ;
117117 }
118- p1[ page. p1_index ( ) ] . set_frame ( frame. frame ( ) , flags) ;
118+ p1[ page. p1_index ( ) ] . set_frame ( frame, flags) ;
119119
120120 Ok ( MapperFlush :: new ( page) )
121121 }
122122}
123123
124124impl < ' a , P : PhysToVirt > Mapper < Size1GiB > for MappedPageTable < ' a , P > {
125- fn map_to < A > (
125+ unsafe fn map_to < A > (
126126 & mut self ,
127127 page : Page < Size1GiB > ,
128- frame : UnusedPhysFrame < Size1GiB > ,
128+ frame : PhysFrame < Size1GiB > ,
129129 flags : PageTableFlags ,
130130 allocator : & mut A ,
131131 ) -> Result < MapperFlush < Size1GiB > , MapToError < Size1GiB > >
@@ -195,10 +195,10 @@ impl<'a, P: PhysToVirt> Mapper<Size1GiB> for MappedPageTable<'a, P> {
195195}
196196
197197impl < ' a , P : PhysToVirt > Mapper < Size2MiB > for MappedPageTable < ' a , P > {
198- fn map_to < A > (
198+ unsafe fn map_to < A > (
199199 & mut self ,
200200 page : Page < Size2MiB > ,
201- frame : UnusedPhysFrame < Size2MiB > ,
201+ frame : PhysFrame < Size2MiB > ,
202202 flags : PageTableFlags ,
203203 allocator : & mut A ,
204204 ) -> Result < MapperFlush < Size2MiB > , MapToError < Size2MiB > >
@@ -276,10 +276,10 @@ impl<'a, P: PhysToVirt> Mapper<Size2MiB> for MappedPageTable<'a, P> {
276276}
277277
278278impl < ' a , P : PhysToVirt > Mapper < Size4KiB > for MappedPageTable < ' a , P > {
279- fn map_to < A > (
279+ unsafe fn map_to < A > (
280280 & mut self ,
281281 page : Page < Size4KiB > ,
282- frame : UnusedPhysFrame < Size4KiB > ,
282+ frame : PhysFrame < Size4KiB > ,
283283 flags : PageTableFlags ,
284284 allocator : & mut A ,
285285 ) -> Result < MapperFlush < Size4KiB > , MapToError < Size4KiB > >
@@ -465,10 +465,7 @@ impl<P: PhysToVirt> PageTableWalker<P> {
465465
466466 if entry. is_unused ( ) {
467467 if let Some ( frame) = allocator. allocate_frame ( ) {
468- entry. set_frame (
469- frame. frame ( ) ,
470- PageTableFlags :: PRESENT | PageTableFlags :: WRITABLE ,
471- ) ;
468+ entry. set_frame ( frame, PageTableFlags :: PRESENT | PageTableFlags :: WRITABLE ) ;
472469 created = true ;
473470 } else {
474471 return Err ( PageTableCreateError :: FrameAllocationFailed ) ;
0 commit comments