hv: abstract IRQ related macros

Convert IRQ-related macros to static inline functions and introduce
wrappers for arch-specific implementations. This follows the style we
defined for multi-arch development.

This is a follow-up update for commit
a7239d126 ("[FIXME] hv: risc-v add denpended implementation in cpu.h").

CPU_IRQ_ENABLE_ON_CONFIG  -> local_irq_enable
CPU_IRQ_DISABLE_ON_CONFIG -> local_irq_disable
CPU_INT_ALL_DISABLE       -> local_irq_save
CPU_INT_ALL_RESTORE       -> local_irq_restore

Tracked-On: #8813
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
Reviewed-by: Yifan Liu  <yifan1.liu@intel.com>
This commit is contained in:
Shiqing Gao
2025-09-22 16:39:59 +08:00
committed by acrnsi-robot
parent 86b25ea9ac
commit ca778139e6
14 changed files with 123 additions and 98 deletions

View File

@@ -10,7 +10,7 @@
#ifndef ASSEMBLER
#include <types.h>
#include <rtl.h>
#include <asm/cpu.h>
#include <cpu.h>
#include <asm/lib/spinlock.h>
/* The common spinlock type */
@@ -28,14 +28,14 @@ static inline void spinlock_init(spinlock_t *lock)
static inline void spinlock_irqsave_obtain(spinlock_t *lock, uint64_t * flags)
{
CPU_INT_ALL_DISABLE(flags);
local_irq_save(flags);
arch_spinlock_obtain(lock);
}
static inline void spinlock_irqrestore_release(spinlock_t *lock, uint64_t flags)
{
arch_spinlock_release(lock);
CPU_INT_ALL_RESTORE(flags);
local_irq_restore(flags);
}
static inline void spinlock_obtain(spinlock_t *lock)