mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-07-04 11:07:51 +00:00
HV: Remove the mixed usage of inline assembly in wait_sync_change
When monitor/mwait is not supported, it still uses the inline assembly in wait_sync_change. As it is not allowed based on MISRA-C, the asm wrapper is used for pause scenario in wait_sync_change. Tracked-On: #3442 Suggested-by: Li, Fei1 <fei1.li@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com> Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
This commit is contained in:
parent
baf7d90fdf
commit
7b22456786
@ -447,16 +447,9 @@ void wait_sync_change(volatile const uint64_t *sync, uint64_t wake_sync)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Wait for the event to be set using pause */
|
while ((*sync) != wake_sync) {
|
||||||
asm volatile ("1: cmpq %%rbx,(%%rax)\n"
|
asm_pause();
|
||||||
" je 2f\n"
|
}
|
||||||
" pause\n"
|
|
||||||
" jmp 1b\n"
|
|
||||||
"2:\n"
|
|
||||||
:
|
|
||||||
: "a" (sync), "d"(0), "c"(0),
|
|
||||||
"b"(wake_sync)
|
|
||||||
: "cc");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user