@@ -85,14 +85,14 @@ impl<S: PageSize> Page<S> {
85
85
86
86
/// Returns the start address of the page.
87
87
#[ inline]
88
- pub fn start_address ( self ) -> VirtAddr {
88
+ pub fn start_address ( & self ) -> VirtAddr {
89
89
self . start_address
90
90
}
91
91
92
92
/// Returns the size the page (4KB, 2MB or 1GB).
93
93
#[ cfg( feature = "const_fn" ) ]
94
94
#[ inline]
95
- pub const fn size ( self ) -> u64 {
95
+ pub const fn size ( & self ) -> u64 {
96
96
S :: SIZE
97
97
}
98
98
@@ -105,13 +105,13 @@ impl<S: PageSize> Page<S> {
105
105
106
106
/// Returns the level 4 page table index of this page.
107
107
#[ inline]
108
- pub fn p4_index ( self ) -> PageTableIndex {
108
+ pub fn p4_index ( & self ) -> PageTableIndex {
109
109
self . start_address ( ) . p4_index ( )
110
110
}
111
111
112
112
/// Returns the level 3 page table index of this page.
113
113
#[ inline]
114
- pub fn p3_index ( self ) -> PageTableIndex {
114
+ pub fn p3_index ( & self ) -> PageTableIndex {
115
115
self . start_address ( ) . p3_index ( )
116
116
}
117
117
@@ -131,7 +131,7 @@ impl<S: PageSize> Page<S> {
131
131
impl < S : NotGiantPageSize > Page < S > {
132
132
/// Returns the level 2 page table index of this page.
133
133
#[ inline]
134
- pub fn p2_index ( self ) -> PageTableIndex {
134
+ pub fn p2_index ( & self ) -> PageTableIndex {
135
135
self . start_address ( ) . p2_index ( )
136
136
}
137
137
}
@@ -188,7 +188,7 @@ impl Page<Size4KiB> {
188
188
189
189
/// Returns the level 1 page table index of this page.
190
190
#[ inline]
191
- pub fn p1_index ( self ) -> PageTableIndex {
191
+ pub fn p1_index ( & self ) -> PageTableIndex {
192
192
self . start_address ( ) . p1_index ( )
193
193
}
194
194
}
0 commit comments