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 11//! Traits for abstracting away frame allocation and deallocation.
22
3- use crate :: structures:: paging:: { PageSize , PhysFrame } ;
3+ use crate :: structures:: paging:: { PageSize , PhysFrame , Size4KiB } ;
44
55/// A trait for types that can allocate a frame of memory.
66///
@@ -16,3 +16,22 @@ pub trait FrameDeallocator<S: PageSize> {
1616 /// Deallocate the given frame of memory.
1717 fn deallocate_frame ( & mut self , frame : PhysFrame < S > ) ;
1818}
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 33//! Page tables translate virtual memory “pages” to physical memory “frames”.
44
55pub use self :: frame:: PhysFrame ;
6+ #[ allow( deprecated) ]
7+ pub use self :: frame_alloc:: UnusedPhysFrame ;
68pub use self :: frame_alloc:: { FrameAllocator , FrameDeallocator } ;
79#[ doc( no_inline) ]
810pub use self :: mapper:: MappedPageTable ;
You can’t perform that action at this time.
0 commit comments