File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change 1
1
//! Traits for abstracting away frame allocation and deallocation.
2
2
3
- use crate :: structures:: paging:: { PageSize , PhysFrame } ;
3
+ use crate :: structures:: paging:: { PageSize , PhysFrame , Size4KiB } ;
4
4
5
5
/// A trait for types that can allocate a frame of memory.
6
6
///
@@ -16,3 +16,22 @@ pub trait FrameDeallocator<S: PageSize> {
16
16
/// Deallocate the given frame of memory.
17
17
fn deallocate_frame ( & mut self , frame : PhysFrame < S > ) ;
18
18
}
19
+
20
+ /// Represents a physical frame that is not used for any mapping.
21
+ #[ deprecated( note = "This wrapper type was removed. Use `PhysFrame` instead." ) ]
22
+ #[ derive( Debug ) ]
23
+ pub struct UnusedPhysFrame < S : PageSize = Size4KiB > ( PhysFrame < S > ) ;
24
+
25
+ #[ allow( deprecated) ]
26
+ impl < S : PageSize > UnusedPhysFrame < S > {
27
+ /// Creates a new UnusedPhysFrame from the given frame.
28
+ ///
29
+ /// ## Safety
30
+ ///
31
+ /// This method is unsafe because the caller must guarantee
32
+ /// that the given frame is unused.
33
+ #[ allow( clippy:: new_ret_no_self) ]
34
+ pub unsafe fn new ( frame : PhysFrame < S > ) -> PhysFrame < S > {
35
+ frame
36
+ }
37
+ }
Original file line number Diff line number Diff line change 3
3
//! Page tables translate virtual memory “pages” to physical memory “frames”.
4
4
5
5
pub use self :: frame:: PhysFrame ;
6
+ #[ allow( deprecated) ]
7
+ pub use self :: frame_alloc:: UnusedPhysFrame ;
6
8
pub use self :: frame_alloc:: { FrameAllocator , FrameDeallocator } ;
7
9
#[ doc( no_inline) ]
8
10
pub use self :: mapper:: MappedPageTable ;
You can’t perform that action at this time.
0 commit comments