@@ -314,6 +314,7 @@ static mut CURRENT_VCPU: Option<*mut u8> = None;
314314///
315315/// It's guaranteed that each time before a method of [`AxArchVCpu`] is called, the current VCpu is set to the corresponding [`AxVCpu`].
316316/// So methods of [`AxArchVCpu`] can always get the [`AxVCpu`] containing itself by calling this method.
317+ #[ allow( static_mut_refs) ]
317318pub fn get_current_vcpu < ' a , A : AxArchVCpu > ( ) -> Option < & ' a AxVCpu < A > > {
318319 unsafe {
319320 CURRENT_VCPU
@@ -327,6 +328,7 @@ pub fn get_current_vcpu<'a, A: AxArchVCpu>() -> Option<&'a AxVCpu<A>> {
327328/// Get a mutable reference to the current VCpu on the current physical CPU.
328329///
329330/// See [`get_current_vcpu`] for more details.
331+ #[ allow( static_mut_refs) ]
330332pub fn get_current_vcpu_mut < ' a , A : AxArchVCpu > ( ) -> Option < & ' a mut AxVCpu < A > > {
331333 unsafe {
332334 CURRENT_VCPU
@@ -342,6 +344,7 @@ pub fn get_current_vcpu_mut<'a, A: AxArchVCpu>() -> Option<&'a mut AxVCpu<A>> {
342344/// # Safety
343345/// This method is marked as unsafe because it may result in unexpected behavior if not used properly.
344346/// Do not call this method unless you know what you are doing.
347+ #[ allow( static_mut_refs) ]
345348pub unsafe fn set_current_vcpu < A : AxArchVCpu > ( vcpu : & AxVCpu < A > ) {
346349 unsafe {
347350 CURRENT_VCPU
@@ -354,7 +357,8 @@ pub unsafe fn set_current_vcpu<A: AxArchVCpu>(vcpu: &AxVCpu<A>) {
354357///
355358/// # Safety
356359/// This method is marked as unsafe because it may result in unexpected behavior if not used properly.
357- /// Do not call this method unless you know what you are doing.
360+ /// Do not call this method unless you know what you are doing.
361+ #[ allow( static_mut_refs) ]
358362pub unsafe fn clear_current_vcpu < A : AxArchVCpu > ( ) {
359363 unsafe {
360364 CURRENT_VCPU . current_ref_mut_raw ( ) . take ( ) ;
0 commit comments