From 6098648373778ea8e45a334e0e34fecac368ef82 Mon Sep 17 00:00:00 2001 From: Liang Yi Date: Tue, 16 Mar 2021 14:16:07 +0800 Subject: [PATCH] hv/mod_irq: cleanup x86/irq.h Move exception stack layout struct and exception/NMI handling declarations from x86/irq.h into x86/cpu.h. Tracked-On: #5825 Signed-off-by: Peter Fang Reviewed-by: Jason Chen CJ --- hypervisor/include/arch/x86/cpu.h | 25 +++++++++++++++++++++++++ hypervisor/include/arch/x86/irq.h | 27 ++------------------------- 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/hypervisor/include/arch/x86/cpu.h b/hypervisor/include/arch/x86/cpu.h index cf8de386f..e8f253c8d 100644 --- a/hypervisor/include/arch/x86/cpu.h +++ b/hypervisor/include/arch/x86/cpu.h @@ -414,6 +414,31 @@ struct cpu_context { struct ext_context ext_ctx; }; +/* + * Definition of the stack frame layout + */ +struct intr_excp_ctx { + struct acrn_gp_regs gp_regs; + uint64_t vector; + uint64_t error_code; + uint64_t rip; + uint64_t cs; + uint64_t rflags; + uint64_t rsp; + uint64_t ss; +}; + +void dispatch_exception(struct intr_excp_ctx *ctx); + +/** + * @brief Handle NMI + * + * To handle an NMI + * + * @param ctx Pointer to interrupt exception context + */ +void handle_nmi(__unused struct intr_excp_ctx *ctx); + /* Function prototypes */ void cpu_do_idle(void); void cpu_dead(void); diff --git a/hypervisor/include/arch/x86/irq.h b/hypervisor/include/arch/x86/irq.h index f80f4e41a..c0b2c7abd 100644 --- a/hypervisor/include/arch/x86/irq.h +++ b/hypervisor/include/arch/x86/irq.h @@ -94,23 +94,11 @@ struct x86_irq_data { #endif }; +struct intr_excp_ctx; + struct acrn_vcpu; struct acrn_vm; -/* - * Definition of the stack frame layout - */ -struct intr_excp_ctx { - struct acrn_gp_regs gp_regs; - uint64_t vector; - uint64_t error_code; - uint64_t rip; - uint64_t cs; - uint64_t rflags; - uint64_t rsp; - uint64_t ss; -}; - typedef void (*smp_call_func_t)(void *data); struct smp_call_info_data { smp_call_func_t func; @@ -120,8 +108,6 @@ struct smp_call_info_data { void smp_call_function(uint64_t mask, smp_call_func_t func, void *data); bool is_notification_nmi(const struct acrn_vm *vm); -void dispatch_exception(struct intr_excp_ctx *ctx); - void setup_notification(void); void setup_pi_notification(void); @@ -269,15 +255,6 @@ uint32_t irq_to_vector(uint32_t irq); */ void dispatch_interrupt(const struct intr_excp_ctx *ctx); -/** - * @brief Handle NMI - * - * To handle an NMI - * - * @param ctx Pointer to interrupt exception context - */ -void handle_nmi(__unused struct intr_excp_ctx *ctx); - /** * @} */