@@ -85,25 +85,21 @@ pub enum MappedFrame {
85
85
}
86
86
87
87
impl 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 ,
96
94
}
97
95
}
98
96
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 ,
107
103
}
108
104
}
109
105
}
0 commit comments