From d5912a4d169e402786da24d538674c84bc793e02 Mon Sep 17 00:00:00 2001 From: "Yan, Like" Date: Wed, 20 Jun 2018 13:45:47 +0800 Subject: [PATCH] hv: pirq: rename related source files To make the file structure clearer, change the file names: - rename arch/x86/interrupt.c to virq.c, for the virtual irq relavant code, such as irq injection etc; - merge arch/x86/intr_main.c into arch/x86/irq.c; - rename arch/x86/intr_lapic.c to lapic.c Signed-off-by: Yan, Like Acked-by: Eddie Dong --- hypervisor/Makefile | 5 ++- hypervisor/arch/x86/intr_main.c | 31 ------------------- hypervisor/arch/x86/irq.c | 24 ++++++++++++++ hypervisor/arch/x86/{intr_lapic.c => lapic.c} | 0 hypervisor/arch/x86/{interrupt.c => virq.c} | 0 5 files changed, 26 insertions(+), 34 deletions(-) delete mode 100644 hypervisor/arch/x86/intr_main.c rename hypervisor/arch/x86/{intr_lapic.c => lapic.c} (100%) rename hypervisor/arch/x86/{interrupt.c => virq.c} (100%) diff --git a/hypervisor/Makefile b/hypervisor/Makefile index dc701b7b69..1d61df8026 100644 --- a/hypervisor/Makefile +++ b/hypervisor/Makefile @@ -95,14 +95,13 @@ D_SRCS += $(wildcard debug/*.c) C_SRCS += boot/acpi.c C_SRCS += boot/dmar_parse.c C_SRCS += arch/x86/ioapic.c -C_SRCS += arch/x86/intr_lapic.c +C_SRCS += arch/x86/lapic.c S_SRCS += arch/x86/trampoline.S C_SRCS += arch/x86/cpu.c C_SRCS += arch/x86/softirq.c C_SRCS += arch/x86/cpuid.c C_SRCS += arch/x86/mmu.c C_SRCS += arch/x86/notify.c -C_SRCS += arch/x86/intr_main.c C_SRCS += arch/x86/vtd.c C_SRCS += arch/x86/gdt.c S_SRCS += arch/x86/cpu_primary.S @@ -112,7 +111,7 @@ C_SRCS += arch/x86/timer.c C_SRCS += arch/x86/ept.c S_SRCS += arch/x86/vmx_asm.S C_SRCS += arch/x86/io.c -C_SRCS += arch/x86/interrupt.c +C_SRCS += arch/x86/virq.c C_SRCS += arch/x86/vmexit.c C_SRCS += arch/x86/vmx.c C_SRCS += arch/x86/assign.c diff --git a/hypervisor/arch/x86/intr_main.c b/hypervisor/arch/x86/intr_main.c deleted file mode 100644 index 3b7c906b56..0000000000 --- a/hypervisor/arch/x86/intr_main.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (C) 2018 Intel Corporation. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include - -int interrupt_init(uint32_t cpu_id) -{ - struct host_idt_descriptor *idtd = &HOST_IDTR; - int status; - - set_idt(idtd); - - status = init_lapic(cpu_id); - ASSERT(status == 0, "lapic init failed"); - if (status != 0) - return -ENODEV; - - status = init_default_irqs(cpu_id); - ASSERT(status == 0, "irqs init failed"); - if (status != 0) - return -ENODEV; - -#ifndef CONFIG_EFI_STUB - CPU_IRQ_ENABLE(); -#endif - - return status; -} diff --git a/hypervisor/arch/x86/irq.c b/hypervisor/arch/x86/irq.c index b0acfdc296..9e25cd452d 100644 --- a/hypervisor/arch/x86/irq.c +++ b/hypervisor/arch/x86/irq.c @@ -732,3 +732,27 @@ void get_cpu_interrupt_info(char *str, int str_max) } snprintf(str, size, "\r\n"); } + +int interrupt_init(uint32_t cpu_id) +{ + struct host_idt_descriptor *idtd = &HOST_IDTR; + int status; + + set_idt(idtd); + + status = init_lapic(cpu_id); + ASSERT(status == 0, "lapic init failed"); + if (status != 0) + return -ENODEV; + + status = init_default_irqs(cpu_id); + ASSERT(status == 0, "irqs init failed"); + if (status != 0) + return -ENODEV; + +#ifndef CONFIG_EFI_STUB + CPU_IRQ_ENABLE(); +#endif + + return status; +} diff --git a/hypervisor/arch/x86/intr_lapic.c b/hypervisor/arch/x86/lapic.c similarity index 100% rename from hypervisor/arch/x86/intr_lapic.c rename to hypervisor/arch/x86/lapic.c diff --git a/hypervisor/arch/x86/interrupt.c b/hypervisor/arch/x86/virq.c similarity index 100% rename from hypervisor/arch/x86/interrupt.c rename to hypervisor/arch/x86/virq.c