mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-05 07:35:31 +00:00
hv: refine the left atomic operation
rename atomic_cmpxchg_int to atomic_cmpxchg replace atomic_cmpset_long with atomic_cmpxchg64 rename atomic_readandclear_long to atomic_readandclear64 Signed-off-by: Li, Fei1 <fei1.li@intel.com> Acked-by: Eddie Dong <eddie.dong@Intel.com>
This commit is contained in:
@@ -179,7 +179,7 @@ static int uart16550_open(struct tgt_uart *tgt_uart,
|
||||
int status = 0;
|
||||
|
||||
if (strcmp(tgt_uart->uart_id, "STDIO") == 0) {
|
||||
if (atomic_cmpxchg_int(&tgt_uart->open_count, 0, 1) != 0)
|
||||
if (atomic_cmpxchg(&tgt_uart->open_count, 0, 1) != 0)
|
||||
return -EBUSY;
|
||||
|
||||
/* Call UART setup function */
|
||||
@@ -264,7 +264,7 @@ static int uart16550_get_rx_err(uint32_t rx_data)
|
||||
static void uart16550_close(struct tgt_uart *tgt_uart)
|
||||
{
|
||||
if (tgt_uart != NULL) {
|
||||
if (atomic_cmpxchg_int(&tgt_uart->open_count, 1, 0) == 1) {
|
||||
if (atomic_cmpxchg(&tgt_uart->open_count, 1, 0) == 1) {
|
||||
/* TODO: Add logic to disable the UART */
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user