mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-23 09:47:44 +00:00
hv: treewide: convert some MACROs to inline functions
MISRA-C requires that each parameter in the MACRO shall be in brackets. In some cases, adding brackets for all of the parameters may not be a perfect solution. For example, it may affect the code readability when there are many parameters used in the MACRO. And duplicated brackets will appear when one MACRO called another MACRO which is using same parameters. This patch convert some MACROs to inline functions to avoid such cases. v1 -> v2: * Remove the unnecessary changes in hypervisor/bsp/uefi/efi/boot.h Tracked-On: #861 Signed-off-by: Shiqing Gao <shiqing.gao@intel.com> Reviewed-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
@@ -70,7 +70,7 @@ void vcpu_thread(struct vcpu *vcpu)
|
||||
|
||||
/* Restore guest TSC_AUX */
|
||||
if (vcpu->launched) {
|
||||
CPU_MSR_WRITE(MSR_IA32_TSC_AUX,
|
||||
cpu_msr_write(MSR_IA32_TSC_AUX,
|
||||
vcpu->msr_tsc_aux_guest);
|
||||
}
|
||||
|
||||
@@ -87,9 +87,9 @@ void vcpu_thread(struct vcpu *vcpu)
|
||||
|
||||
vcpu->arch_vcpu.nrexits++;
|
||||
/* Save guest TSC_AUX */
|
||||
CPU_MSR_READ(MSR_IA32_TSC_AUX, &vcpu->msr_tsc_aux_guest);
|
||||
cpu_msr_read(MSR_IA32_TSC_AUX, &vcpu->msr_tsc_aux_guest);
|
||||
/* Restore native TSC_AUX */
|
||||
CPU_MSR_WRITE(MSR_IA32_TSC_AUX, tsc_aux_hyp_cpu);
|
||||
cpu_msr_write(MSR_IA32_TSC_AUX, tsc_aux_hyp_cpu);
|
||||
|
||||
CPU_IRQ_ENABLE();
|
||||
/* Dispatch handler */
|
||||
|
Reference in New Issue
Block a user