@@ -247,7 +247,7 @@ where
247
247
/// # Safety
248
248
///
249
249
/// The caller has to ensure that PCID is enabled in CR4 when the flush is executed.
250
- pub unsafe fn pcid ( mut self , pcid : Pcid ) -> Self {
250
+ pub unsafe fn pcid ( & mut self , pcid : Pcid ) -> & mut Self {
251
251
self . pcid = Some ( pcid) ;
252
252
self
253
253
}
@@ -258,7 +258,7 @@ where
258
258
///
259
259
/// The caller has to ensure that SVM is enabled in EFER when the flush is executed.
260
260
// FIXME: Make ASID a type and remove error type.
261
- pub unsafe fn asid ( mut self , asid : u16 ) -> Result < Self , AsidOutOfRangeError > {
261
+ pub unsafe fn asid ( & mut self , asid : u16 ) -> Result < & mut Self , AsidOutOfRangeError > {
262
262
if u32:: from ( asid) > self . invlpgb . nasid {
263
263
return Err ( AsidOutOfRangeError {
264
264
asid,
@@ -271,13 +271,13 @@ where
271
271
}
272
272
273
273
/// Also flush global pages.
274
- pub fn include_global ( mut self ) -> Self {
274
+ pub fn include_global ( & mut self ) -> & mut Self {
275
275
self . include_global = true ;
276
276
self
277
277
}
278
278
279
279
/// Only flush the final translation and not the cached upper level TLB entries.
280
- pub fn final_translation_only ( mut self ) -> Self {
280
+ pub fn final_translation_only ( & mut self ) -> & mut Self {
281
281
self . final_translation_only = true ;
282
282
self
283
283
}
@@ -294,7 +294,7 @@ where
294
294
}
295
295
296
296
/// Execute the flush.
297
- pub fn flush ( self ) {
297
+ pub fn flush ( & self ) {
298
298
if let Some ( mut pages) = self . page_range {
299
299
while !pages. is_empty ( ) {
300
300
// Calculate out how many pages we still need to flush.
0 commit comments