HV: config: adapt to the generated config.h

This patch drops "#include <bsp_cfg.h>" and include the generated config.h in
CFLAGS for the configuration data.

Also make sure that all configuration data have the 'CONFIG_' prefix.

v4 -> v5:

    * No changes.

v3 -> v4:

    * Add '-include config.h' to hypervisor/bsp/uefi/efi/Makefile.
    * Update comments mentioning bsp_cfg.h.

v2 -> v3:

    * Include config.h on the command line instead of in any header or source to
      avoid including config.h multiple times.
    * Add config.h as an additional dependency for source compilation.

v1 -> v2:

    * No changes.

Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
This commit is contained in:
Junjie Mao
2018-05-22 23:24:07 +08:00
committed by lijinxia
parent f9bb2024cc
commit c849bff850
17 changed files with 46 additions and 48 deletions

View File

@@ -1,4 +1,4 @@
#include "bsp_cfg.h"
#include "config.h"
ENTRY(cpu_primary_start_32)
@@ -83,4 +83,3 @@ SECTIONS
_ld_ram_size = LENGTH(ram) ;
_ld_ram_end = _ld_ram_size + _ld_ram_start ;
}

View File

@@ -36,7 +36,7 @@ HV_FILE:=acrn
EFI_OBJDIR:=$(HV_OBJDIR)/bsp/uefi/efi
C_SRCS = boot.c pe.c malloc.c
ACRN_OBJS := $(patsubst %.c,$(EFI_OBJDIR)/%.o,$(C_SRCS))
INCLUDE_PATH += ../include/bsp/
INCLUDE_PATH += $(HV_OBJDIR)/include
OBJCOPY=objcopy
@@ -68,7 +68,8 @@ endif
CFLAGS=-I. -I.. -I$(INCDIR)/efi -I$(INCDIR)/efi/$(ARCH) \
-DEFI_FUNCTION_WRAPPER -fPIC -fshort-wchar -ffreestanding \
-Wall -I../fs/ -D$(ARCH) -O2
-Wall -I../fs/ -D$(ARCH) -O2 \
-include config.h
CFLAGS += -mno-mmx -mno-sse -mno-sse2 -mno-80387 -mno-fp-ret-in-387
@@ -107,11 +108,11 @@ install-conf: $(CONF_FILE)
clean:
rm -f $(BOOT) $(HV_OBJDIR)/$(HV_FILE).efi $(EFI_OBJDIR)/boot.so $(ACRN_OBJS) $(FS)
$(EFI_OBJDIR)/%.o:%.S
$(EFI_OBJDIR)/%.o:%.S $(HV_OBJDIR)/$(HV_CONFIG_H)
[ ! -e $@ ] && mkdir -p $(dir $@); \
$(CC) $(CFLAGS) -c -o $@ $<
$(EFI_OBJDIR)/%.o: %.c
$(EFI_OBJDIR)/%.o: %.c $(HV_OBJDIR)/$(HV_CONFIG_H)
[ ! -e $@ ] && mkdir -p $(dir $@); \
$(CC) $(patsubst %, -I%, $(INCLUDE_PATH)) -I. -c $(CFLAGS) $(ARCH_CFLAGS) $< -o $@

View File

@@ -380,7 +380,7 @@ efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *_table)
/*
* If we reach this point, it means we did not receive a specific
* bootloader name to be used. Fall back to the default bootloader
* as specified in bsp_cfg.h
* as specified in config.h
*/
bootloader_name = ch8_2_ch16(CONFIG_UEFI_OS_LOADER_NAME);
}
@@ -454,4 +454,3 @@ failed:
return exit(image, err, ERROR_STRING_LENGTH, error_buf);
}

View File

@@ -34,7 +34,6 @@
#ifndef __ACRNBOOT_H__
#define __ACRNBOOT_H__
#include <bsp_cfg.h>
#include "multiboot.h"
#define E820_RAM 1
@@ -182,4 +181,3 @@ msr_read(uint32_t reg_num)
}
#endif