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:
Li, Fei1
2018-05-17 16:39:50 +08:00
committed by lijinxia
parent 1f3da93e74
commit edb26a7e17
3 changed files with 57 additions and 84 deletions

View File

@@ -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 */
}
}