[PATCH] HV: Modularize bsp folder


Arindam Roy <arindam.roy@...>
 

Remove usage of hypervisor.h from inside
BSP folder.
Replace with only the required header files.

Tracked-On: #2893
Signed-off-by: Arindam Roy <arindam.roy@...>
---
hypervisor/bsp/include/bsp_extern.h | 1 +
hypervisor/bsp/include/uefi/uefi.h | 2 ++
hypervisor/bsp/sbl/const_dmar.c | 2 +-
hypervisor/bsp/sbl/sbl.c | 4 ++--
hypervisor/bsp/uefi/uefi.c | 7 ++++++-
hypervisor/include/arch/x86/cpu.h | 1 +
hypervisor/include/arch/x86/multiboot.h | 1 +
7 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/hypervisor/bsp/include/bsp_extern.h b/hypervisor/bsp/include/bsp_extern.h
index 674ec97a..37f6baf4 100644
--- a/hypervisor/bsp/include/bsp_extern.h
+++ b/hypervisor/bsp/include/bsp_extern.h
@@ -18,6 +18,7 @@
#ifndef BSP_EXTERN_H
#define BSP_EXTERN_H

+#include <types.h>
#include "default_acpi_info.h"
#include "platform_acpi_info.h"

diff --git a/hypervisor/bsp/include/uefi/uefi.h b/hypervisor/bsp/include/uefi/uefi.h
index b6651681..8ad12c4f 100644
--- a/hypervisor/bsp/include/uefi/uefi.h
+++ b/hypervisor/bsp/include/uefi/uefi.h
@@ -7,6 +7,8 @@
#ifndef _UEFI_H_
#define _UEFI_H_

+#include <acrn_common.h>
+
struct efi_context {
struct acrn_vcpu_regs vcpu_regs;
void *rsdp;
diff --git a/hypervisor/bsp/sbl/const_dmar.c b/hypervisor/bsp/sbl/const_dmar.c
index 392152fe..2426d8eb 100644
--- a/hypervisor/bsp/sbl/const_dmar.c
+++ b/hypervisor/bsp/sbl/const_dmar.c
@@ -4,8 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/

-#include <hypervisor.h>
#include <vtd.h>
+#include "platform_acpi_info.h"

#ifndef CONFIG_DMAR_PARSE_ENABLED

diff --git a/hypervisor/bsp/sbl/sbl.c b/hypervisor/bsp/sbl/sbl.c
index 6f8eacc2..f9194ad3 100644
--- a/hypervisor/bsp/sbl/sbl.c
+++ b/hypervisor/bsp/sbl/sbl.c
@@ -3,8 +3,8 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
-
-#include <hypervisor.h>
+#include <bsp_extern.h>
+#include <cpu.h>
#include <e820.h>

void init_bsp(void)
diff --git a/hypervisor/bsp/uefi/uefi.c b/hypervisor/bsp/uefi/uefi.c
index 258da4f5..5a79ffc4 100644
--- a/hypervisor/bsp/uefi/uefi.c
+++ b/hypervisor/bsp/uefi/uefi.c
@@ -4,10 +4,15 @@
* SPDX-License-Identifier: BSD-3-Clause
*/

-#include <hypervisor.h>
#include <multiboot.h>
#include <boot_context.h>
#include <uefi.h>
+#include <types.h>
+#include <rtl.h>
+#include <logmsg.h>
+#include <pgtable.h>
+#include <lapic.h>
+#include <bsp_extern.h>

static struct efi_context efi_ctx;
static struct lapic_regs uefi_lapic_regs;
diff --git a/hypervisor/include/arch/x86/cpu.h b/hypervisor/include/arch/x86/cpu.h
index e977526b..d7e13947 100644
--- a/hypervisor/include/arch/x86/cpu.h
+++ b/hypervisor/include/arch/x86/cpu.h
@@ -38,6 +38,7 @@
#ifndef CPU_H
#define CPU_H

+#include <types.h>
/* Define CPU stack alignment */
#define CPU_STACK_ALIGN 16UL

diff --git a/hypervisor/include/arch/x86/multiboot.h b/hypervisor/include/arch/x86/multiboot.h
index c160e3c3..7a0bcf50 100644
--- a/hypervisor/include/arch/x86/multiboot.h
+++ b/hypervisor/include/arch/x86/multiboot.h
@@ -6,6 +6,7 @@

#ifndef MULTIBOOT_H
#define MULTIBOOT_H
+#include <types.h>

#define MULTIBOOT_INFO_MAGIC 0x2BADB002U
#define MULTIBOOT_INFO_HAS_CMDLINE 0x00000004U
--
2.17.1

Join acrn-dev@lists.projectacrn.org to automatically receive all group messages.