@@ -85,25 +85,21 @@ pub enum MappedFrame {
8585}
8686
8787impl MappedFrame {
88- const_fn ! {
89- /// Returns the start address of the frame.
90- pub fn start_address( & self ) -> PhysAddr {
91- match self {
92- MappedFrame :: Size4KiB ( frame) => frame. start_address( ) ,
93- MappedFrame :: Size2MiB ( frame) => frame. start_address( ) ,
94- MappedFrame :: Size1GiB ( frame) => frame. start_address( ) ,
95- }
88+ /// Returns the start address of the frame.
89+ pub const fn start_address ( & self ) -> PhysAddr {
90+ match self {
91+ MappedFrame :: Size4KiB ( frame) => frame. start_address ,
92+ MappedFrame :: Size2MiB ( frame) => frame. start_address ,
93+ MappedFrame :: Size1GiB ( frame) => frame. start_address ,
9694 }
9795 }
9896
99- const_fn ! {
100- /// Returns the size the frame (4KB, 2MB or 1GB).
101- pub fn size( & self ) -> u64 {
102- match self {
103- MappedFrame :: Size4KiB ( frame) => frame. size( ) ,
104- MappedFrame :: Size2MiB ( frame) => frame. size( ) ,
105- MappedFrame :: Size1GiB ( frame) => frame. size( ) ,
106- }
97+ /// Returns the size the frame (4KB, 2MB or 1GB).
98+ pub const fn size ( & self ) -> u64 {
99+ match self {
100+ MappedFrame :: Size4KiB ( _) => Size4KiB :: SIZE ,
101+ MappedFrame :: Size2MiB ( _) => Size2MiB :: SIZE ,
102+ MappedFrame :: Size1GiB ( _) => Size1GiB :: SIZE ,
107103 }
108104 }
109105}
0 commit comments