Redo testbios utility to use all of YABEL
Drop buggy duplicate implementation of intXX handlers and provide enough glue to use all of YABEL. Change-Id: I2db77a56a2a991cb84876456dcbb3a843a0d9754 Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-on: https://review.coreboot.org/12117 Reviewed-by: Ronald G. Minnich <rminnich@gmail.com> Tested-by: build bot (Jenkins)
This commit is contained in:
committed by
Stefan Reinauer
parent
eb960f1af9
commit
05082737a9
@@ -1,3 +1,18 @@
|
||||
##
|
||||
## This file is part of the coreboot project.
|
||||
##
|
||||
## Copyright (C) 2016 Google Inc.
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; version 2 of the License.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
##
|
||||
|
||||
#
|
||||
# NOTE: You need to add your libpci.a version to CFLAGS below if
|
||||
# pci-userspace.c does not build.
|
||||
@@ -7,33 +22,55 @@
|
||||
#
|
||||
|
||||
TOP ?= ../..
|
||||
OUT ?= build
|
||||
|
||||
CC ?= gcc
|
||||
CFLAGS ?= -O2 -g -fomit-frame-pointer
|
||||
|
||||
CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes
|
||||
CFLAGS += -Wwrite-strings -Wredundant-decls -Wstrict-aliasing -Wshadow -Wextra
|
||||
CFLAGS += -Wno-unused-but-set-variable
|
||||
|
||||
# TODO check host architecture
|
||||
CBCFLAGS = -DCONFIG_ARCH_X86=1 -Wno-sign-compare -Wno-unused-but-set-variable -Wno-unused-parameter
|
||||
CBCFLAGS = -Wno-sign-compare -Wno-unused-parameter -Wno-format
|
||||
|
||||
INCLUDES = -Iinclude -I$(TOP)/src/device/oprom/include/
|
||||
CBINCLUDES = -I$(TOP)/src --include include/stdtypes.h
|
||||
CBINCLUDES += --include $(TOP)/src/commonlib/include/commonlib/loglevel.h
|
||||
CBINCLUDES += -include stdio.h
|
||||
INCLUDES = -Iinclude -I$(OUT)/include
|
||||
INCLUDES += -I$(TOP)/src/device/oprom/include/
|
||||
INCLUDES += -I$(TOP)/src/device/oprom/yabel
|
||||
INCLUDES += -include $(TOP)/src/commonlib/include/commonlib/loglevel.h
|
||||
INCLUDES += -include stdtypes.h -include pci-userspace.h
|
||||
INCLUDES += -include $(TOP)/src/include/kconfig.h
|
||||
|
||||
SOURCE = int10.c int15.c int16.c int1a.c inte6.c testbios.c
|
||||
SOURCE += helper_exec.c helper_mem.c pci-userspace.c
|
||||
CBINCLUDES = -I$(TOP)/src -include include/stdtypes.h -include $(TOP)/src/include/endian.h
|
||||
CBINCLUDES += -include stdio.h -include sys/io.h
|
||||
|
||||
X86EMU = sys.c decode.c ops.c ops2.c prim_ops.c fpu.c debug.c
|
||||
X86EMU_DIR = $(TOP)/src/device/oprom/x86emu
|
||||
SOURCE = testbios.c
|
||||
SOURCE += pci-userspace.c
|
||||
SOURCE += device.c
|
||||
|
||||
X86EMU = x86emu/sys.c x86emu/decode.c x86emu/ops.c x86emu/ops2.c
|
||||
X86EMU += x86emu/prim_ops.c x86emu/fpu.c x86emu/debug.c
|
||||
|
||||
X86EMU += yabel/interrupt.c
|
||||
X86EMU += yabel/mem.c
|
||||
X86EMU += yabel/io.c
|
||||
X86EMU += yabel/pmm.c
|
||||
X86EMU += yabel/biosemu.c
|
||||
X86EMU += yabel/debug.c
|
||||
#X86EMU += yabel/device.c # For now we need a local copy :-(
|
||||
|
||||
|
||||
|
||||
X86EMU_DIR = $(TOP)/src/device/oprom
|
||||
X86EMU_SOURCE = $(addprefix $(X86EMU_DIR)/, $(X86EMU))
|
||||
OBJECTS:=$(SOURCE:.c=.o) $(X86EMU:.c=.o)
|
||||
OBJECTS:=$(addprefix $(OUT)/,$(SOURCE:.c=.o)) $(addprefix $(OUT)/, $(X86EMU:.c=.o))
|
||||
|
||||
LIBS=-lpci
|
||||
|
||||
all: dep testbios
|
||||
|
||||
$(OBJECTS): includes
|
||||
|
||||
testbios: $(OBJECTS)
|
||||
printf " LINK $(notdir $@)\n"
|
||||
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
|
||||
@@ -42,21 +79,37 @@ dep: $(SOURCE) $(X86EMU_SOURCE) Makefile
|
||||
$(CC) $(CFLAGS) $(INCLUDES) -MM $(SOURCE) > .dependencies
|
||||
$(CC) $(CFLAGS) $(INCLUDES) $(CBCFLAGS) $(CBINCLUDES) -MM $(X86EMU_SOURCE) >> .dependencies
|
||||
|
||||
# Make all the dummy include files (that are in reality
|
||||
# covered by all the -include statements above)
|
||||
includes:
|
||||
mkdir -p $(OUT)/include/device
|
||||
mkdir -p $(OUT)/include/arch
|
||||
touch $(OUT)/include/device/device.h
|
||||
touch $(OUT)/include/device/pci.h
|
||||
touch $(OUT)/include/device/pci_ops.h
|
||||
touch $(OUT)/include/device/resource.h
|
||||
touch $(OUT)/include/arch/io.h
|
||||
touch $(OUT)/include/timer.h
|
||||
touch $(OUT)/include/types.h
|
||||
|
||||
clean:
|
||||
rm -f *.o *~ testbios
|
||||
rm -f $(OBJECTS) *~ testbios
|
||||
rm -rf $(OUT)
|
||||
|
||||
distclean: clean
|
||||
rm -f .dependencies
|
||||
|
||||
%.o: $(X86EMU_DIR)/%.c
|
||||
$(OUT)/%.o: $(X86EMU_DIR)/%.c
|
||||
printf " CC (x86emu) $(notdir $<)\n"
|
||||
mkdir -p $(dir $@)
|
||||
$(CC) $(CFLAGS) $(CBCFLAGS) $(INCLUDES) $(CBINCLUDES) -c -o $@ $<
|
||||
|
||||
%.o: %.c
|
||||
$(OUT)/%.o: %.c
|
||||
printf " CC $(notdir $<)\n"
|
||||
mkdir -p $(dir $@)
|
||||
$(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
|
||||
|
||||
.PHONY: all clean distclean
|
||||
.PHONY: all includes clean distclean
|
||||
.SILENT:
|
||||
|
||||
-include .dependencies
|
||||
|
Reference in New Issue
Block a user