@@ -41,7 +41,7 @@ impl<'a, P: PhysToVirt> MappedPageTable<'a, P> {
41
41
fn map_to_1gib < A > (
42
42
& mut self ,
43
43
page : Page < Size1GiB > ,
44
- frame : UnusedPhysFrame < Size1GiB > ,
44
+ frame : PhysFrame < Size1GiB > ,
45
45
flags : PageTableFlags ,
46
46
allocator : & mut A ,
47
47
) -> Result < MapperFlush < Size1GiB > , MapToError < Size1GiB > >
@@ -66,7 +66,7 @@ impl<'a, P: PhysToVirt> MappedPageTable<'a, P> {
66
66
fn map_to_2mib < A > (
67
67
& mut self ,
68
68
page : Page < Size2MiB > ,
69
- frame : UnusedPhysFrame < Size2MiB > ,
69
+ frame : PhysFrame < Size2MiB > ,
70
70
flags : PageTableFlags ,
71
71
allocator : & mut A ,
72
72
) -> Result < MapperFlush < Size2MiB > , MapToError < Size2MiB > >
@@ -94,7 +94,7 @@ impl<'a, P: PhysToVirt> MappedPageTable<'a, P> {
94
94
fn map_to_4kib < A > (
95
95
& mut self ,
96
96
page : Page < Size4KiB > ,
97
- frame : UnusedPhysFrame < Size4KiB > ,
97
+ frame : PhysFrame < Size4KiB > ,
98
98
flags : PageTableFlags ,
99
99
allocator : & mut A ,
100
100
) -> Result < MapperFlush < Size4KiB > , MapToError < Size4KiB > >
@@ -115,17 +115,17 @@ impl<'a, P: PhysToVirt> MappedPageTable<'a, P> {
115
115
if !p1[ page. p1_index ( ) ] . is_unused ( ) {
116
116
return Err ( MapToError :: PageAlreadyMapped ( frame) ) ;
117
117
}
118
- p1[ page. p1_index ( ) ] . set_frame ( frame. frame ( ) , flags) ;
118
+ p1[ page. p1_index ( ) ] . set_frame ( frame, flags) ;
119
119
120
120
Ok ( MapperFlush :: new ( page) )
121
121
}
122
122
}
123
123
124
124
impl < ' a , P : PhysToVirt > Mapper < Size1GiB > for MappedPageTable < ' a , P > {
125
- fn map_to < A > (
125
+ unsafe fn map_to < A > (
126
126
& mut self ,
127
127
page : Page < Size1GiB > ,
128
- frame : UnusedPhysFrame < Size1GiB > ,
128
+ frame : PhysFrame < Size1GiB > ,
129
129
flags : PageTableFlags ,
130
130
allocator : & mut A ,
131
131
) -> Result < MapperFlush < Size1GiB > , MapToError < Size1GiB > >
@@ -195,10 +195,10 @@ impl<'a, P: PhysToVirt> Mapper<Size1GiB> for MappedPageTable<'a, P> {
195
195
}
196
196
197
197
impl < ' a , P : PhysToVirt > Mapper < Size2MiB > for MappedPageTable < ' a , P > {
198
- fn map_to < A > (
198
+ unsafe fn map_to < A > (
199
199
& mut self ,
200
200
page : Page < Size2MiB > ,
201
- frame : UnusedPhysFrame < Size2MiB > ,
201
+ frame : PhysFrame < Size2MiB > ,
202
202
flags : PageTableFlags ,
203
203
allocator : & mut A ,
204
204
) -> Result < MapperFlush < Size2MiB > , MapToError < Size2MiB > >
@@ -276,10 +276,10 @@ impl<'a, P: PhysToVirt> Mapper<Size2MiB> for MappedPageTable<'a, P> {
276
276
}
277
277
278
278
impl < ' a , P : PhysToVirt > Mapper < Size4KiB > for MappedPageTable < ' a , P > {
279
- fn map_to < A > (
279
+ unsafe fn map_to < A > (
280
280
& mut self ,
281
281
page : Page < Size4KiB > ,
282
- frame : UnusedPhysFrame < Size4KiB > ,
282
+ frame : PhysFrame < Size4KiB > ,
283
283
flags : PageTableFlags ,
284
284
allocator : & mut A ,
285
285
) -> Result < MapperFlush < Size4KiB > , MapToError < Size4KiB > >
@@ -465,10 +465,7 @@ impl<P: PhysToVirt> PageTableWalker<P> {
465
465
466
466
if entry. is_unused ( ) {
467
467
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 ) ;
472
469
created = true ;
473
470
} else {
474
471
return Err ( PageTableCreateError :: FrameAllocationFailed ) ;
0 commit comments