mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-11-12 08:23:19 +00:00
hv: multi-arch: move and rename arch-specific IRQ functions
Move the declarations of arch-specific IRQ functions from their arch-specific headers into the common header file. Also rename these functions from xxx_arch() to arch_xxx() for better naming consistency across architectures. This change follows the style defined for multi-arch development. Tracked-On: #8845 Signed-off-by: Shiqing Gao <shiqing.gao@intel.com> Acked-by: Wang Yu1 <yu1.wang@intel.com>
This commit is contained in:
committed by
acrnsi-robot
parent
b919e3d155
commit
ec88134829
@@ -12,7 +12,7 @@
|
||||
#include <asm/csr.h>
|
||||
#include <types.h>
|
||||
|
||||
static void init_interrupt_arch(__unused uint16_t pcpu_id)
|
||||
static void arch_init_interrupt(__unused uint16_t pcpu_id)
|
||||
{
|
||||
uint64_t addr = (uint64_t)&strap_handler;
|
||||
|
||||
@@ -44,7 +44,7 @@ static void init_interrupt_arch(__unused uint16_t pcpu_id)
|
||||
*/
|
||||
void init_interrupt(uint16_t pcpu_id)
|
||||
{
|
||||
init_interrupt_arch(pcpu_id);
|
||||
arch_init_interrupt(pcpu_id);
|
||||
|
||||
local_irq_enable();
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ uint32_t alloc_irq_vector(uint32_t irq)
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool request_irq_arch(uint32_t irq)
|
||||
bool arch_request_irq(uint32_t irq)
|
||||
{
|
||||
return (alloc_irq_vector(irq) != VECTOR_INVALID);
|
||||
}
|
||||
@@ -117,7 +117,7 @@ static void free_irq_vector(uint32_t irq)
|
||||
}
|
||||
}
|
||||
|
||||
void free_irq_arch(uint32_t irq)
|
||||
void arch_free_irq(uint32_t irq)
|
||||
{
|
||||
free_irq_vector(irq);
|
||||
}
|
||||
@@ -164,7 +164,7 @@ static inline bool irq_need_unmask(const struct irq_desc *desc)
|
||||
&& is_ioapic_irq(desc->irq));
|
||||
}
|
||||
|
||||
void pre_irq_arch(const struct irq_desc *desc)
|
||||
void arch_pre_irq(const struct irq_desc *desc)
|
||||
{
|
||||
if (irq_need_mask(desc)) {
|
||||
ioapic_gsi_mask_irq(desc->irq);
|
||||
@@ -174,7 +174,7 @@ void pre_irq_arch(const struct irq_desc *desc)
|
||||
send_lapic_eoi();
|
||||
}
|
||||
|
||||
void post_irq_arch(const struct irq_desc *desc)
|
||||
void arch_post_irq(const struct irq_desc *desc)
|
||||
{
|
||||
if (irq_need_unmask(desc)) {
|
||||
ioapic_gsi_unmask_irq(desc->irq);
|
||||
@@ -214,7 +214,7 @@ void dispatch_interrupt(const struct intr_excp_ctx *ctx)
|
||||
/*
|
||||
* descs[] must have NR_IRQS entries
|
||||
*/
|
||||
void init_irq_descs_arch(struct irq_desc descs[])
|
||||
void arch_init_irq_descs(struct irq_desc descs[])
|
||||
{
|
||||
uint32_t i;
|
||||
|
||||
@@ -254,7 +254,7 @@ void init_irq_descs_arch(struct irq_desc descs[])
|
||||
}
|
||||
|
||||
/* must be called after IRQ setup */
|
||||
void setup_irqs_arch(void)
|
||||
void arch_setup_irqs(void)
|
||||
{
|
||||
ioapic_setup_irqs();
|
||||
}
|
||||
@@ -288,7 +288,7 @@ static inline void set_idt(struct host_idt_descriptor *idtd)
|
||||
[idtd] "m"(*idtd));
|
||||
}
|
||||
|
||||
void init_interrupt_arch(uint16_t pcpu_id)
|
||||
void arch_init_interrupt(uint16_t pcpu_id)
|
||||
{
|
||||
struct host_idt_descriptor *idtd = &HOST_IDTR;
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ void free_irq(uint32_t irq)
|
||||
desc->flags = IRQF_NONE;
|
||||
spinlock_irqrestore_release(&desc->lock, rflags);
|
||||
|
||||
free_irq_arch(irq);
|
||||
arch_free_irq(irq);
|
||||
free_irq_num(irq);
|
||||
}
|
||||
}
|
||||
@@ -132,7 +132,7 @@ int32_t request_irq(uint32_t req_irq, irq_action_t action_fn, void *priv_data,
|
||||
pr_err("[%s] invalid irq num", __func__);
|
||||
ret = -EINVAL;
|
||||
} else {
|
||||
if (!request_irq_arch(irq)) {
|
||||
if (!arch_request_irq(irq)) {
|
||||
pr_err("[%s] failed to alloc vector for irq %u",
|
||||
__func__, irq);
|
||||
free_irq_num(irq);
|
||||
@@ -178,13 +178,13 @@ static inline void handle_irq(const struct irq_desc *desc)
|
||||
{
|
||||
irq_action_t action = desc->action;
|
||||
|
||||
pre_irq_arch(desc);
|
||||
arch_pre_irq(desc);
|
||||
|
||||
if (action != NULL) {
|
||||
action(desc->irq, desc->priv_data);
|
||||
}
|
||||
|
||||
post_irq_arch(desc);
|
||||
arch_post_irq(desc);
|
||||
}
|
||||
|
||||
void do_irq(const uint32_t irq)
|
||||
@@ -214,16 +214,16 @@ static void init_irq_descs(void)
|
||||
spinlock_init(&desc->lock);
|
||||
}
|
||||
|
||||
init_irq_descs_arch(irq_desc_array);
|
||||
arch_init_irq_descs(irq_desc_array);
|
||||
}
|
||||
|
||||
void init_interrupt(uint16_t pcpu_id)
|
||||
{
|
||||
init_interrupt_arch(pcpu_id);
|
||||
arch_init_interrupt(pcpu_id);
|
||||
|
||||
if (pcpu_id == BSP_CPU_ID) {
|
||||
init_irq_descs();
|
||||
setup_irqs_arch();
|
||||
arch_setup_irqs();
|
||||
init_softirq();
|
||||
}
|
||||
|
||||
|
||||
@@ -123,16 +123,4 @@ uint32_t irq_to_vector(uint32_t irq);
|
||||
*/
|
||||
void dispatch_interrupt(const struct intr_excp_ctx *ctx);
|
||||
|
||||
/* Arch specific routines called from generic IRQ handling */
|
||||
|
||||
struct irq_desc;
|
||||
|
||||
void init_irq_descs_arch(struct irq_desc *descs);
|
||||
void setup_irqs_arch(void);
|
||||
void init_interrupt_arch(uint16_t pcpu_id);
|
||||
void free_irq_arch(uint32_t irq);
|
||||
bool request_irq_arch(uint32_t irq);
|
||||
void pre_irq_arch(const struct irq_desc *desc);
|
||||
void post_irq_arch(const struct irq_desc *desc);
|
||||
|
||||
#endif /* ARCH_X86_IRQ_H */
|
||||
|
||||
@@ -125,6 +125,14 @@ void do_irq(const uint32_t irq);
|
||||
*/
|
||||
void init_interrupt(uint16_t pcpu_id);
|
||||
|
||||
/* Arch specific routines called from generic IRQ handling */
|
||||
void arch_init_irq_descs(struct irq_desc *descs);
|
||||
void arch_setup_irqs(void);
|
||||
void arch_init_interrupt(uint16_t pcpu_id);
|
||||
void arch_free_irq(uint32_t irq);
|
||||
bool arch_request_irq(uint32_t irq);
|
||||
void arch_pre_irq(const struct irq_desc *desc);
|
||||
void arch_post_irq(const struct irq_desc *desc);
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
Reference in New Issue
Block a user