mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-07-09 05:13:38 +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
3d65188e54
commit
d0f7f4d658
@ -439,16 +439,9 @@ void wait_sync_change(uint64_t *sync, uint64_t wake_sync)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Wait for the event to be set using pause */
|
while (*((volatile uint64_t *)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