[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Minios-devel] [UNIKRAFT PATCH v3 4/5] build: add prefix CONFIG_ to every kconfig symbol
There are two reasons to have prefix CONFIG_: 1) This makes code a bit more understandable - one can distinguish internal macros from configuration ones 2) The fixdep heavily relies on it while detecting configuration build dependencies Signed-off-by: Yuri Volchkov <yuri.volchkov@xxxxxxxxx> --- Makefile | 117 ++++++++++++++++--------------- Makefile.uk | 46 ++++++------ arch/Arch.uk | 8 +-- arch/arm/Compiler.uk | 6 +- arch/arm/Makefile.uk | 16 ++--- arch/arm/ldivmod_helper.c | 2 +- arch/x86_64/Compiler.uk | 6 +- arch/x86_64/Makefile.uk | 60 ++++++++-------- include/uk/plat/memory.h | 2 +- lib/Makefile.uk | 20 +++--- lib/fdt/Makefile.uk | 6 +- lib/nolibc/Makefile.uk | 12 ++-- lib/nolibc/include/stdlib.h | 4 +- lib/ukalloc/Makefile.uk | 6 +- lib/ukalloc/alloc.c | 2 +- lib/ukalloc/include/uk/alloc.h | 18 ++--- lib/ukallocbbuddy/Makefile.uk | 6 +- lib/ukallocbbuddy/bbuddy.c | 4 +- lib/ukargparse/Makefile.uk | 6 +- lib/ukboot/Makefile.uk | 6 +- lib/ukboot/boot.c | 30 ++++---- lib/ukdebug/Makefile.uk | 6 +- lib/ukdebug/hexdump.c | 14 ++-- lib/ukdebug/include/uk/assert.h | 2 +- lib/ukdebug/include/uk/hexdump.h | 4 +- lib/ukdebug/include/uk/print.h | 28 ++++---- lib/ukdebug/print.c | 32 ++++----- lib/uksched/Makefile.uk | 6 +- lib/uksched/include/uk/thread.h | 4 +- lib/uksched/sched.c | 4 +- lib/uksched/thread.c | 2 +- lib/ukschedcoop/Makefile.uk | 6 +- lib/uktimeconv/Makefile.uk | 6 +- plat/Makefile.uk | 2 +- plat/kvm/Linker.uk | 16 ++--- plat/kvm/Makefile.uk | 30 ++++---- plat/kvm/memory.c | 16 ++--- plat/kvm/x86/setup.c | 2 +- plat/linuxu/Linker.uk | 10 +-- plat/linuxu/Makefile.uk | 6 +- plat/linuxu/memory.c | 4 +- plat/linuxu/setup.c | 2 +- plat/xen/Linker.uk | 34 ++++----- plat/xen/Makefile.uk | 24 +++---- plat/xen/arm/setup.c | 8 +-- plat/xen/console.c | 4 +- plat/xen/include/xen-x86/mm.h | 2 +- plat/xen/memory.c | 12 ++-- plat/xen/x86/setup.c | 4 +- support/build/Makefile.rules | 8 +-- 50 files changed, 341 insertions(+), 340 deletions(-) diff --git a/Makefile b/Makefile index f6c8dee..c205506 100644 --- a/Makefile +++ b/Makefile @@ -62,16 +62,16 @@ space := $(empty) $(empty) export CDPATH := # Use current directory as base -UK_BASE := $(CURDIR) -override UK_BASE := $(realpath $(UK_BASE)) -ifeq ($(UK_BASE),) -$(error "Invalid base directory (UK_BASE)") +CONFIG_UK_BASE := $(CURDIR) +override CONFIG_UK_BASE := $(realpath $(CONFIG_UK_BASE)) +ifeq ($(CONFIG_UK_BASE),) +$(error "Invalid base directory (CONFIG_UK_BASE)") endif # A // APP_DIR # Set A variable if not already done on the command line; ifneq ("$(origin A)", "command line") -A := $(UK_BASE) +A := $(CONFIG_UK_BASE) endif # Remove the trailing '/.' # Also remove the trailing '/' the user can set when on the command line. @@ -79,14 +79,14 @@ override A := $(realpath $(patsubst %/,%,$(patsubst %.,%,$(A)))) ifeq ($(A),) $(error "Invalid app directory (A)") endif -override UK_APP := $(A) +override CONFIG_UK_APP := $(A) override APP_DIR := $(A) override APP_BASE := $(A) # BUILD_DIR # Use O variable if set on the command line, otherwise use $(A)/build; ifneq ("$(origin O)", "command line") -BUILD_DIR := $(shell mkdir -p $(UK_APP)/build && cd $(UK_APP)/build >/dev/null && pwd) +BUILD_DIR := $(shell mkdir -p $(CONFIG_UK_APP)/build && cd $(CONFIG_UK_APP)/build >/dev/null && pwd) $(if $(BUILD_DIR),, $(error could not create directory "$(A)/build")) else BUILD_DIR := $(shell mkdir -p $(O) && cd $(O) >/dev/null && pwd) @@ -109,9 +109,9 @@ endif ELIB_DIR := $(realpath $(patsubst %/,%,$(patsubst %.,%,$(ELIB_DIR)))) # KConfig settings -CONFIG_DIR := $(UK_APP) -CONFIG_CONFIG_IN := $(UK_BASE)/Config.uk -CONFIG := $(UK_BASE)/support/kconfig +CONFIG_DIR := $(CONFIG_UK_APP) +CONFIG_CONFIG_IN := $(CONFIG_UK_BASE)/Config.uk +CONFIG := $(CONFIG_UK_BASE)/support/kconfig UK_CONFIG := $(CONFIG_DIR)/.config UK_CONFIG_OUT := $(BUILD_DIR)/config UK_GENERATED_INCLUDES := $(BUILD_DIR)/include @@ -124,17 +124,17 @@ KCONFIG_APP_IN := $(KCONFIG_DIR)/app.uk KCONFIG_ELIB_IN := $(KCONFIG_DIR)/elib.uk # Makefile support scripts -SCRIPTS_DIR := $(UK_BASE)/support/scripts +SCRIPTS_DIR := $(CONFIG_UK_BASE)/support/scripts # # Set and export the version string -include $(UK_BASE)/version.mk +include $(CONFIG_UK_BASE)/version.mk # Compute the full local version string so packages can use it as-is # Need to export it, so it can be got from environment in children (eg. mconf) export UK_FULLVERSION := $(UK_VERSION).$(UK_SUBVERSION)$(UK_EXTRAVERSION)$(shell $(SCRIPTS_DIR)/gitsha1) # Default image name -export UK_NAME ?= $(notdir $(APP_DIR)) +export CONFIG_UK_NAME ?= $(notdir $(APP_DIR)) export DATE := $(shell date +%Y%m%d) @@ -225,8 +225,8 @@ UK_HAVE_DOT_CONFIG := y endif endif -# remove quotes from UK_NAME -UK_NAME := $(call qstrip,$(UK_NAME)) +# remove quotes from CONFIG_UK_NAME +CONFIG_UK_NAME := $(call qstrip,$(CONFIG_UK_NAME)) ################################################################################ # Host compiler and linker tools @@ -304,11 +304,11 @@ export HOSTCC_NOCCACHE HOSTCXX_NOCCACHE # Unikraft Architecture ################################################################################ # Set target archicture as set in config -include $(UK_BASE)/arch/Arch.uk -ifeq ($(UK_ARCH),) +include $(CONFIG_UK_BASE)/arch/Arch.uk +ifeq ($(CONFIG_UK_ARCH),) # Set target archicture as set in environment ifneq ($(ARCH),) -export UK_ARCH ?= $(shell echo "$(call qstrip,$(ARCH))" | \ +export CONFIG_UK_ARCH ?= $(shell echo "$(call qstrip,$(ARCH))" | \ sed -e "s/-.*//" \ -e 's//\1/' \ -e 's/i.86/x86/' \ @@ -322,7 +322,7 @@ export UK_ARCH ?= $(shell echo "$(call qstrip,$(ARCH))" | \ -e 's/sh.*/sh/' ) else # Nothing set, use detected host architecture -export UK_ARCH ?= $(shell echo "$(HOSTARCH)" | \ +export CONFIG_UK_ARCH ?= $(shell echo "$(HOSTARCH)" | \ sed -e "s/-.*//" \ -e 's//\1/' \ -e 's/i.86/x86/' \ @@ -336,17 +336,17 @@ export UK_ARCH ?= $(shell echo "$(HOSTARCH)" | \ -e 's/sh.*/sh/' ) endif endif -override ARCH := $(UK_ARCH) -export UK_ARCH ARCH +override ARCH := $(CONFIG_UK_ARCH) +export CONFIG_UK_ARCH ARCH # Quick-check if architecture exists ifeq ($(filter $(null_targets) print-vars,$(MAKECMDGOALS)),) -ifeq ($(wildcard $(UK_BASE)/arch/$(ARCH)/Makefile.uk),) -$(error Target architecture ($(ARCH)) is currently not supported (could not find $(UK_BASE)/arch/$(ARCH)/Makefile.uk).) +ifeq ($(wildcard $(CONFIG_UK_BASE)/arch/$(ARCH)/Makefile.uk),) +$(error Target architecture ($(ARCH)) is currently not supported (could not find $(CONFIG_UK_BASE)/arch/$(ARCH)/Makefile.uk).) endif ifeq ($(wildcard arch/$(ARCH)/Compiler.uk),) -$(error Target architecture ($(ARCH)) is currently not supported (could not find $(UK_BASE)/arch/$(ARCH)/Compiler.uk).) +$(error Target architecture ($(ARCH)) is currently not supported (could not find $(CONFIG_UK_BASE)/arch/$(ARCH)/Compiler.uk).) endif endif @@ -355,7 +355,7 @@ endif ################################################################################ ifeq ($(UK_HAVE_DOT_CONFIG),y) # Hide troublesome environment variables from sub processes -unexport CROSS_COMPILE +unexport CONFIG_CROSS_COMPILE #unexport CC #unexport LD #unexport AR @@ -373,32 +373,32 @@ unexport TERMINFO unexport MACHINE #unexport O -# CROSS_COMPILE specify the prefix used for all executables used +# CONFIG_CROSS_COMPILE specify the prefix used for all executables used # during compilation. Only gcc and related bin-utils executables -# are prefixed with $(CROSS_COMPILE). -# CROSS_COMPILE can be set on the command line +# are prefixed with $(CONFIG_CROSS_COMPILE). +# CONFIG_CROSS_COMPILE can be set on the command line # make CROSS_COMPILE=ia64-linux- -# Alternatively CROSS_COMPILE can be set in the environment. +# Alternatively CONFIG_CROSS_COMPILE can be set in the environment. # A third alternative is to store a setting in .config so that plain # "make" in the configured kernel build directory always uses that. -# Default value for CROSS_COMPILE is not to prefix executables -# Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile.uk -CROSS_COMPILE := $(CROSS_COMPILE:"%"=%) +# Default value for CONFIG_CROSS_COMPILE is not to prefix executables +# Note: Some architectures assign CONFIG_CROSS_COMPILE in their arch/*/Makefile.uk +CONFIG_CROSS_COMPILE := $(CROSS_COMPILE:"%"=%) -include $(UK_BASE)/arch/$(UK_ARCH)/Compiler.uk +include $(CONFIG_UK_BASE)/arch/$(CONFIG_UK_ARCH)/Compiler.uk # Make variables (CC, etc...) -LD := $(CROSS_COMPILE)gcc -CC := $(CROSS_COMPILE)gcc +LD := $(CONFIG_CROSS_COMPILE)gcc +CC := $(CONFIG_CROSS_COMPILE)gcc CPP := $(CC) CXX := $(CPP) AS := $(CC) -AR := $(CROSS_COMPILE)gcc-ar -NM := $(CROSS_COMPILE)gcc-nm -READELF := $(CROSS_COMPILE)readelf -STRIP := $(CROSS_COMPILE)strip -OBJCOPY := $(CROSS_COMPILE)objcopy -OBJDUMP := $(CROSS_COMPILE)objdump +AR := $(CONFIG_CROSS_COMPILE)gcc-ar +NM := $(CONFIG_CROSS_COMPILE)gcc-nm +READELF := $(CONFIG_CROSS_COMPILE)readelf +STRIP := $(CONFIG_CROSS_COMPILE)strip +OBJCOPY := $(CONFIG_CROSS_COMPILE)objcopy +OBJDUMP := $(CONFIG_CROSS_COMPILE)objdump AR := ar MV := mv -f RM := rm -rf @@ -425,7 +425,7 @@ CFLAGS += -DCC_VERSION=$(CC_VERSION) CXXFLAGS += -DCC_VERSION=$(CC_VERSION) # Common Makefile definitions we need for building Unikraft -include $(UK_BASE)/support/build/Makefile.rules +include $(CONFIG_UK_BASE)/support/build/Makefile.rules # ensure $(BUILD_DIR)/include and $(BUILD_DIR)/include/uk exists $(call mk_sub_build_dir,include) @@ -439,35 +439,35 @@ CXXINCLUDES += -I$(UK_GENERATED_INCLUDES) # Build rules ################################################################################ # external application -ifneq ($(UK_BASE),$(UK_APP)) -$(eval $(call _import_lib,$(UK_APP))); +ifneq ($(CONFIG_UK_BASE),$(CONFIG_UK_APP)) +$(eval $(call _import_lib,$(CONFIG_UK_APP))); endif # external libraries $(foreach E,$(ELIB_DIR), \ $(eval $(call _import_lib,$(E))); \ ) -$(eval $(call _import_lib,$(UK_BASE)/arch/$(UK_ARCH))) # architecture libraries -include $(UK_BASE)/plat/Makefile.uk # platform libraries -include $(UK_BASE)/lib/Makefile.uk # libraries -include $(UK_BASE)/Makefile.uk # Unikraft base +$(eval $(call _import_lib,$(CONFIG_UK_BASE)/arch/$(CONFIG_UK_ARCH))) # architecture libraries +include $(CONFIG_UK_BASE)/plat/Makefile.uk # platform libraries +include $(CONFIG_UK_BASE)/lib/Makefile.uk # libraries +include $(CONFIG_UK_BASE)/Makefile.uk # Unikraft base ifeq ($(call qstrip,$(UK_PLATS) $(UK_PLATS-y)),) $(warning You did not choose any target platform.) $(warning Please choose at least one target platform in the configuration!) endif -ifneq ($(HAVE_BOOTENTRY),y) +ifneq ($(CONFIG_HAVE_BOOTENTRY),y) $(error You did not select a library that handles bootstrapping! (e.g., ukboot)) endif # Generate build rules -include $(UK_BASE)/support/build/Makefile.build +include $(CONFIG_UK_BASE)/support/build/Makefile.build ifneq ($(call qstrip,$(UK_DEPS) $(UK_DEPS-y)),) -include $(UK_DEPS) $(UK_DEPS-y) # include header dependencies endif -include $(UK_BASE)/plat/Linker.uk +include $(CONFIG_UK_BASE)/plat/Linker.uk .PHONY: prepare image libs objs clean @@ -494,7 +494,7 @@ all: images # Cleanup rules ################################################################################ # Generate cleaning rules -include $(UK_BASE)/support/build/Makefile.clean +include $(CONFIG_UK_BASE)/support/build/Makefile.clean clean: $(addprefix clean-,\ $(foreach P,$(UK_PLATS) $(UK_PLATS-y),\ @@ -548,7 +548,7 @@ $(KCONFIG_APP_IN) $(KCONFIG_ELIB_IN): %: %.new $(KCONFIG_APP_IN).new: @echo '# external application' > $@ -ifneq ($(UK_BASE),$(UK_APP)) +ifneq ($(CONFIG_UK_BASE),$(CONFIG_UK_APP)) @echo 'source "$(APP_DIR)/Config.uk"' >> $@ else @echo 'comment "No external application specified"' >> $@ @@ -577,28 +577,29 @@ DEFCONFIG = $(call qstrip,$(UK_DEFCONFIG)) # We don't want to fully expand UK_DEFCONFIG here, so Kconfig will # recognize that if it's still at its default $(CONFIG_DIR)/defconfig COMMON_CONFIG_ENV = \ + CONFIG_="CONFIG_" \ BR2_CONFIG="$(UK_CONFIG)" \ KCONFIG_AUTOCONFIG="$(KCONFIG_AUTOCONFIG)" \ KCONFIG_AUTOHEADER="$(KCONFIG_AUTOHEADER)" \ KCONFIG_TRISTATE="$(KCONFIG_TRISTATE)" \ HOST_GCC_VERSION="$(HOSTCC_VERSION)" \ BUILD_DIR="$(BUILD_DIR)" \ - UK_BASE="$(UK_BASE)" \ - UK_APP="$(UK_APP)" \ + UK_BASE="$(CONFIG_UK_BASE)" \ + UK_APP="$(CONFIG_UK_APP)" \ UK_CONFIG="$(UK_CONFIG)" \ UK_FULLVERSION="$(UK_FULLVERSION)" \ UK_CODENAME="$(UK_CODENAME)" \ - UK_ARCH="$(UK_ARCH)" \ + UK_ARCH="$(CONFIG_UK_ARCH)" \ KCONFIG_APP_IN="$(KCONFIG_APP_IN)" \ KCONFIG_ELIB_IN="$(KCONFIG_ELIB_IN)" \ - UK_NAME="$(UK_NAME)" + UK_NAME="$(CONFIG_UK_NAME)" xconfig: $(KCONFIG_DIR)/qconf $(KCONFIG_APP_IN) $(KCONFIG_ELIB_IN) @$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN) @$(SCRIPTS_DIR)/configupdate $(UK_CONFIG) $(UK_CONFIG_OUT) gconfig: $(KCONFIG_DIR)/gconf $(KCONFIG_APP_IN) $(KCONFIG_ELIB_IN) - @$(COMMON_CONFIG_ENV) srctree=$(UK_BASE) $< $(CONFIG_CONFIG_IN) + @$(COMMON_CONFIG_ENV) srctree=$(CONFIG_UK_BASE) $< $(CONFIG_CONFIG_IN) @$(SCRIPTS_DIR)/configupdate $(UK_CONFIG) $(UK_CONFIG_OUT) menuconfig: $(KCONFIG_DIR)/mconf $(KCONFIG_APP_IN) $(KCONFIG_ELIB_IN) diff --git a/Makefile.uk b/Makefile.uk index 529bb70..b3938d0 100644 --- a/Makefile.uk +++ b/Makefile.uk @@ -5,17 +5,17 @@ ################################################################################ ASFLAGS += -U __linux__ -U __FreeBSD__ -U __sun__ -D__ASSEMBLY__ -no-pie -ASINCLUDES += -nostdinc -nostdlib -I$(UK_BASE)/include +ASINCLUDES += -nostdinc -nostdlib -I$(CONFIG_UK_BASE)/include CFLAGS += -U __linux__ -U __FreeBSD__ -U __sun__ -no-pie CFLAGS += -fno-stack-protector -fno-omit-frame-pointer -fno-tree-sra CFLAGS += -Wall -Wextra -CINCLUDES += -nostdinc -nostdlib -I$(UK_BASE)/include +CINCLUDES += -nostdinc -nostdlib -I$(CONFIG_UK_BASE)/include CXXFLAGS += -U __linux__ -U __FreeBSD__ -U __sun__ -no-pie CXXFLAGS += -fno-stack-protector -fno-omit-frame-pointer -fno-tree-sra CXXFLAGS += -Wall -Wextra -CXXINCLUDES += -nostdinc -nostdlib -I$(UK_BASE)/include +CXXINCLUDES += -nostdinc -nostdlib -I$(CONFIG_UK_BASE)/include # Set the text and data sections to be readable and writable. Also, # do not page-align the data segment. If the output format supports @@ -23,34 +23,34 @@ CXXINCLUDES += -nostdinc -nostdlib -I$(UK_BASE)/include LIBLDFLAGS += -nostdinc -nostdlib -Wl,--omagic -Wl,-r -no-pie LDFLAGS += -nostdinc -nostdlib -Wl,--omagic -Wl,--build-id=none -no-pie -CFLAGS-$(OPTIMIZE_NONE) += -O0 -fno-optimize-sibling-calls -fno-tree-vectorize -CXXFLAGS-$(OPTIMIZE_NONE) += -O0 -fno-optimize-sibling-calls -fno-tree-vectorize -CFLAGS-$(OPTIMIZE_PERF) += -O2 -CXXFLAGS-$(OPTIMIZE_PERF) += -O2 -CFLAGS-$(OPTIMIZE_SIZE) += -Os -CXXFLAGS-$(OPTIMIZE_SIZE) += -Os +CFLAGS-$(CONFIG_OPTIMIZE_NONE) += -O0 -fno-optimize-sibling-calls -fno-tree-vectorize +CXXFLAGS-$(CONFIG_OPTIMIZE_NONE) += -O0 -fno-optimize-sibling-calls -fno-tree-vectorize +CFLAGS-$(CONFIG_OPTIMIZE_PERF) += -O2 +CXXFLAGS-$(CONFIG_OPTIMIZE_PERF) += -O2 +CFLAGS-$(CONFIG_OPTIMIZE_SIZE) += -Os +CXXFLAGS-$(CONFIG_OPTIMIZE_SIZE) += -Os -CFLAGS-$(OPTIMIZE_DEADELIM) += -fdata-sections -ffunction-sections -CXXFLAGS-$(OPTIMIZE_DEADELIM) += -fdata-sections -ffunction-sections -LDFLAGS-$(OPTIMIZE_DEADELIM) += -Wl,--gc-sections +CFLAGS-$(CONFIG_OPTIMIZE_DEADELIM) += -fdata-sections -ffunction-sections +CXXFLAGS-$(CONFIG_OPTIMIZE_DEADELIM) += -fdata-sections -ffunction-sections +LDFLAGS-$(CONFIG_OPTIMIZE_DEADELIM) += -Wl,--gc-sections # LTO requires the compiler flags to be handed over also for linking -CFLAGS-$(OPTIMIZE_LTO) += -flto -CXXFLAGS-$(OPTIMIZE_LTO) += -flto -LIBLDFLAGS-$(OPTIMIZE_LTO) += $(CFLAGS) $(CFLAGS-y) -LDFLAGS-$(OPTIMIZE_LTO) += $(CFLAGS) $(CFLAGS-y) +CFLAGS-$(CONFIG_OPTIMIZE_LTO) += -flto +CXXFLAGS-$(CONFIG_OPTIMIZE_LTO) += -flto +LIBLDFLAGS-$(CONFIG_OPTIMIZE_LTO) += $(CFLAGS) $(CFLAGS-y) +LDFLAGS-$(CONFIG_OPTIMIZE_LTO) += $(CFLAGS) $(CFLAGS-y) -ifneq ($(DEBUG_SYMBOLS),y) +ifneq ($(CONFIG_DEBUG_SYMBOLS),y) CFLAGS += -g0 CXXFLAGS += -g0 LDFLAGS-y += -Wl,--strip-debug else -CFLAGS-$(DEBUG_SYMBOLS_LVL1) += -g1 -CXXFLAGS-$(DEBUG_SYMBOLS_LVL1) += -g1 -CFLAGS-$(DEBUG_SYMBOLS_LVL2) += -g2 -CXXFLAGS-$(DEBUG_SYMBOLS_LVL2) += -g2 -CFLAGS-$(DEBUG_SYMBOLS_LVL3) += -g3 -CXXFLAGS-$(DEBUG_SYMBOLS_LVL3) += -g3 +CFLAGS-$(CONFIG_DEBUG_SYMBOLS_LVL1) += -g1 +CXXFLAGS-$(CONFIG_DEBUG_SYMBOLS_LVL1) += -g1 +CFLAGS-$(CONFIG_DEBUG_SYMBOLS_LVL2) += -g2 +CXXFLAGS-$(CONFIG_DEBUG_SYMBOLS_LVL2) += -g2 +CFLAGS-$(CONFIG_DEBUG_SYMBOLS_LVL3) += -g3 +CXXFLAGS-$(CONFIG_DEBUG_SYMBOLS_LVL3) += -g3 endif ASFLAGS += -DUK_VERSION=$(UK_VERSION).$(UK_SUBVERSION) -DUK_FULLVERSION=$(UK_FULLVERSION) -DUK_CODENAME="$(UK_CODENAME)" diff --git a/arch/Arch.uk b/arch/Arch.uk index 64f418c..f11308b 100644 --- a/arch/Arch.uk +++ b/arch/Arch.uk @@ -1,6 +1,6 @@ # Selects architecture according to .config -ifeq ($(ARCH_X86_64),y) -UK_ARCH := x86_64 -else ifeq ($(ARCH_ARM_32),y) -UK_ARCH := arm +ifeq ($(CONFIG_ARCH_X86_64),y) +CONFIG_UK_ARCH := x86_64 +else ifeq ($(CONFIG_ARCH_ARM_32),y) +CONFIG_UK_ARCH := arm endif diff --git a/arch/arm/Compiler.uk b/arch/arm/Compiler.uk index ee34916..44a497d 100644 --- a/arch/arm/Compiler.uk +++ b/arch/arm/Compiler.uk @@ -1,6 +1,6 @@ # set cross compile -ifeq ($(CROSS_COMPILE),) -ifneq ($(UK_ARCH),$(HOSTARCH)) - CROSS_COMPILE := arm-linux-gnueabihf- +ifeq ($(CONFIG_CROSS_COMPILE),) +ifneq ($(CONFIG_UK_ARCH),$(HOSTARCH)) + CONFIG_CROSS_COMPILE := arm-linux-gnueabihf- endif endif diff --git a/arch/arm/Makefile.uk b/arch/arm/Makefile.uk index 2567dbe..b746f70 100644 --- a/arch/arm/Makefile.uk +++ b/arch/arm/Makefile.uk @@ -7,13 +7,13 @@ CXXFLAGS += -marm -fms-extensions #-march=armv7-a -CFLAGS-$(MARCH_A20NEON) += -mcpu=cortex-a7 -mtune=cortex-a7 -mfpu=vfpv4-d16 -mfpu=neon-vfpv4 -funsafe-math-optimizations -CXXFLAGS-$(MARCH_A20NEON) += -mcpu=cortex-a7 -mtune=cortex-a7 -mfpu=vfpv4-d16 -mfpu=neon-vfpv4 -funsafe-math-optimizations -CFLAGS-$(MARCH_CORTEXA7) += -mcpu=cortex-a7 -mtune=cortex-a7 -CXXFLAGS-$(MARCH_CORTEXA7) += -mcpu=cortex-a7 -mtune=cortex-a +CFLAGS-$(CONFIG_MARCH_A20NEON) += -mcpu=cortex-a7 -mtune=cortex-a7 -mfpu=vfpv4-d16 -mfpu=neon-vfpv4 -funsafe-math-optimizations +CXXFLAGS-$(CONFIG_MARCH_A20NEON) += -mcpu=cortex-a7 -mtune=cortex-a7 -mfpu=vfpv4-d16 -mfpu=neon-vfpv4 -funsafe-math-optimizations +CFLAGS-$(CONFIG_MARCH_CORTEXA7) += -mcpu=cortex-a7 -mtune=cortex-a7 +CXXFLAGS-$(CONFIG_MARCH_CORTEXA7) += -mcpu=cortex-a7 -mtune=cortex-a $(eval $(call addlib,libarmmath)) -LIBARMMATH_SRCS-$(ARCH_ARM_32) += $(UK_BASE)/arch/arm/divsi3.S -LIBARMMATH_SRCS-$(ARCH_ARM_32) += $(UK_BASE)/arch/arm/ldivmod.S -LIBARMMATH_SRCS-$(ARCH_ARM_32) += $(UK_BASE)/arch/arm/ldivmod_helper.c -LIBARMMATH_SRCS-$(ARCH_ARM_32) += $(UK_BASE)/arch/arm/qdivrem.c +LIBARMMATH_SRCS-$(CONFIG_ARCH_ARM_32) += $(CONFIG_UK_BASE)/arch/arm/divsi3.S +LIBARMMATH_SRCS-$(CONFIG_ARCH_ARM_32) += $(CONFIG_UK_BASE)/arch/arm/ldivmod.S +LIBARMMATH_SRCS-$(CONFIG_ARCH_ARM_32) += $(CONFIG_UK_BASE)/arch/arm/ldivmod_helper.c +LIBARMMATH_SRCS-$(CONFIG_ARCH_ARM_32) += $(CONFIG_UK_BASE)/arch/arm/qdivrem.c diff --git a/arch/arm/ldivmod_helper.c b/arch/arm/ldivmod_helper.c index 098523e..2702485 100644 --- a/arch/arm/ldivmod_helper.c +++ b/arch/arm/ldivmod_helper.c @@ -30,7 +30,7 @@ __u64 __qdivrem(__u64 u, __u64 v, __u64 *rem); -#ifndef HAVE_LIBC +#ifndef CONFIG_HAVE_LIBC __s64 __divdi3(__s64 a, __s64 b) { __u64 ua, ub, uq; diff --git a/arch/x86_64/Compiler.uk b/arch/x86_64/Compiler.uk index a5470ed..98ea8ad 100644 --- a/arch/x86_64/Compiler.uk +++ b/arch/x86_64/Compiler.uk @@ -1,6 +1,6 @@ # set cross compile -ifeq ($(CROSS_COMPILE),) -ifneq ($(UK_ARCH),$(HOSTARCH)) - CROSS_COMPILE := x86_64-linux-gnu- +ifeq ($(CONFIG_CROSS_COMPILE),) +ifneq ($(CONFIG_UK_ARCH),$(HOSTARCH)) + CONFIG_CROSS_COMPILE := x86_64-linux-gnu- endif endif diff --git a/arch/x86_64/Makefile.uk b/arch/x86_64/Makefile.uk index 8c9bfe3..b56228a 100644 --- a/arch/x86_64/Makefile.uk +++ b/arch/x86_64/Makefile.uk @@ -5,33 +5,33 @@ CFLAGS += -m64 -mno-red-zone -fno-reorder-blocks -fno-asynchronous-unwind-tabl CXXFLAGS += -D__X86_64__ CXXFLAGS += -m64 -mno-red-zone -fno-reorder-blocks -fno-asynchronous-unwind-tables -CFLAGS-$(MARCH_GENERIC) += -mtune=generic -CXXFLAGS-$(MARCH_GENERIC) += -mtune=generic -CFLAGS-$(MARCH_NOCONA) += -march=nocona -CXXFLAGS-$(MARCH_NOCONA) += -march=nocona -CFLAGS-$(MARCH_CORE2) += -march=core2 -CXXFLAGS-$(MARCH_CORE2) += -march=core2 -CFLAGS-$(MARCH_COREI7) += -march=corei7 -CXXFLAGS-$(MARCH_COREI7) += -march=corei7 -CFLAGS-$(MARCH_COREI7AVX) += -march=corei7-avx -CXXFLAGS-$(MARCH_COREI7AVX) += -march=corei7-avx -CFLAGS-$(MARCH_COREI7AVXI) += -march=core-avx-i -CXXFLAGS-$(MARCH_COREI7AVXI) += -march=core-avx-i -CFLAGS-$(MARCH_ATOM) += -march=atom -CXXFLAGS-$(MARCH_ATOM) += -march=atom -CFLAGS-$(MARCH_K8) += -march=k8 -CXXFLAGS-$(MARCH_K8) += -march=k8 -CFLAGS-$(MARCH_K8SSE3) += -march=k8-sse3 -CXXFLAGS-$(MARCH_K8SSE3) += -march=k8-sse3 -CFLAGS-$(MARCH_AMDFAM10) += -march=amdfam10 -CXXFLAGS-$(MARCH_AMDFAM10) += -march=amdfam10 -CFLAGS-$(MARCH_BDVER1) += -march=bdver1 -CXXFLAGS-$(MARCH_BDVER1) += -march=bdver1 -CFLAGS-$(MARCH_BDVER2) += -march=bdver2 -CXXFLAGS-$(MARCH_BDVER2) += -march=bdver2 -CFLAGS-$(MARCH_BDVER3) += -march=bdver3 -CXXFLAGS-$(MARCH_BDVER3) += -march=bdver3 -CFLAGS-$(MARCH_BTVER1) += -march=btver1 -CXXFLAGS-$(MARCH_BTVER1) += -march=btver1 -CFLAGS-$(MARCH_BTVER2) += -march=btver2 -CXXFLAGS-$(MARCH_BTVER2) += -march=btver2 +CFLAGS-$(CONFIG_MARCH_GENERIC) += -mtune=generic +CXXFLAGS-$(CONFIG_MARCH_GENERIC) += -mtune=generic +CFLAGS-$(CONFIG_MARCH_NOCONA) += -march=nocona +CXXFLAGS-$(CONFIG_MARCH_NOCONA) += -march=nocona +CFLAGS-$(CONFIG_MARCH_CORE2) += -march=core2 +CXXFLAGS-$(CONFIG_MARCH_CORE2) += -march=core2 +CFLAGS-$(CONFIG_MARCH_COREI7) += -march=corei7 +CXXFLAGS-$(CONFIG_MARCH_COREI7) += -march=corei7 +CFLAGS-$(CONFIG_MARCH_COREI7AVX) += -march=corei7-avx +CXXFLAGS-$(CONFIG_MARCH_COREI7AVX) += -march=corei7-avx +CFLAGS-$(CONFIG_MARCH_COREI7AVXI) += -march=core-avx-i +CXXFLAGS-$(CONFIG_MARCH_COREI7AVXI) += -march=core-avx-i +CFLAGS-$(CONFIG_MARCH_ATOM) += -march=atom +CXXFLAGS-$(CONFIG_MARCH_ATOM) += -march=atom +CFLAGS-$(CONFIG_MARCH_K8) += -march=k8 +CXXFLAGS-$(CONFIG_MARCH_K8) += -march=k8 +CFLAGS-$(CONFIG_MARCH_K8SSE3) += -march=k8-sse3 +CXXFLAGS-$(CONFIG_MARCH_K8SSE3) += -march=k8-sse3 +CFLAGS-$(CONFIG_MARCH_AMDFAM10) += -march=amdfam10 +CXXFLAGS-$(CONFIG_MARCH_AMDFAM10) += -march=amdfam10 +CFLAGS-$(CONFIG_MARCH_BDVER1) += -march=bdver1 +CXXFLAGS-$(CONFIG_MARCH_BDVER1) += -march=bdver1 +CFLAGS-$(CONFIG_MARCH_BDVER2) += -march=bdver2 +CXXFLAGS-$(CONFIG_MARCH_BDVER2) += -march=bdver2 +CFLAGS-$(CONFIG_MARCH_BDVER3) += -march=bdver3 +CXXFLAGS-$(CONFIG_MARCH_BDVER3) += -march=bdver3 +CFLAGS-$(CONFIG_MARCH_BTVER1) += -march=btver1 +CXXFLAGS-$(CONFIG_MARCH_BTVER1) += -march=btver1 +CFLAGS-$(CONFIG_MARCH_BTVER2) += -march=btver2 +CXXFLAGS-$(CONFIG_MARCH_BTVER2) += -march=btver2 diff --git a/include/uk/plat/memory.h b/include/uk/plat/memory.h index eadb088..4678eb6 100644 --- a/include/uk/plat/memory.h +++ b/include/uk/plat/memory.h @@ -58,7 +58,7 @@ struct ukplat_memregion_desc { void *base; __sz len; int flags; -#if UKPLAT_MEMRNAME +#if CONFIG_UKPLAT_MEMRNAME const char *name; #endif }; diff --git a/lib/Makefile.uk b/lib/Makefile.uk index d08a50f..fcd1eea 100644 --- a/lib/Makefile.uk +++ b/lib/Makefile.uk @@ -4,13 +4,13 @@ # ################################################################################ -$(eval $(call _import_lib,$(UK_BASE)/lib/ukboot)) -$(eval $(call _import_lib,$(UK_BASE)/lib/ukdebug)) -$(eval $(call _import_lib,$(UK_BASE)/lib/ukargparse)) -$(eval $(call _import_lib,$(UK_BASE)/lib/uktimeconv)) -$(eval $(call _import_lib,$(UK_BASE)/lib/nolibc)) -$(eval $(call _import_lib,$(UK_BASE)/lib/ukalloc)) -$(eval $(call _import_lib,$(UK_BASE)/lib/ukallocbbuddy)) -$(eval $(call _import_lib,$(UK_BASE)/lib/uksched)) -$(eval $(call _import_lib,$(UK_BASE)/lib/ukschedcoop)) -$(eval $(call _import_lib,$(UK_BASE)/lib/fdt)) +$(eval $(call _import_lib,$(CONFIG_UK_BASE)/lib/ukboot)) +$(eval $(call _import_lib,$(CONFIG_UK_BASE)/lib/ukdebug)) +$(eval $(call _import_lib,$(CONFIG_UK_BASE)/lib/ukargparse)) +$(eval $(call _import_lib,$(CONFIG_UK_BASE)/lib/uktimeconv)) +$(eval $(call _import_lib,$(CONFIG_UK_BASE)/lib/nolibc)) +$(eval $(call _import_lib,$(CONFIG_UK_BASE)/lib/ukalloc)) +$(eval $(call _import_lib,$(CONFIG_UK_BASE)/lib/ukallocbbuddy)) +$(eval $(call _import_lib,$(CONFIG_UK_BASE)/lib/uksched)) +$(eval $(call _import_lib,$(CONFIG_UK_BASE)/lib/ukschedcoop)) +$(eval $(call _import_lib,$(CONFIG_UK_BASE)/lib/fdt)) diff --git a/lib/fdt/Makefile.uk b/lib/fdt/Makefile.uk index f264396..348e0f9 100644 --- a/lib/fdt/Makefile.uk +++ b/lib/fdt/Makefile.uk @@ -1,7 +1,7 @@ -$(eval $(call addlib_s,libfdt,$(LIBFDT))) +$(eval $(call addlib_s,libfdt,$(CONFIG_LIBFDT))) -CINCLUDES-$(LIBFDT) += -I$(LIBFDT_BASE)/include -CXXINCLUDES-$(LIBFDT) += -I$(LIBFDT_BASE)/include +CINCLUDES-$(CONFIG_LIBFDT) += -I$(LIBFDT_BASE)/include +CXXINCLUDES-$(CONFIG_LIBFDT) += -I$(LIBFDT_BASE)/include LIBFDT_CFLAGS-y += -Wno-sign-compare diff --git a/lib/nolibc/Makefile.uk b/lib/nolibc/Makefile.uk index 07bcbd2..9186783 100644 --- a/lib/nolibc/Makefile.uk +++ b/lib/nolibc/Makefile.uk @@ -1,4 +1,4 @@ -$(eval $(call addlib_s,libnolibc,$(LIBNOLIBC))) +$(eval $(call addlib_s,libnolibc,$(CONFIG_LIBNOLIBC))) LIBNOLIBC_NO_BUILTINS += -fno-builtin-printf LIBNOLIBC_NO_BUILTINS += -fno-builtin-fprintf @@ -15,10 +15,10 @@ LIBNOLIBC_NO_BUILTINS += -fno-builtin-vscanf LIBNOLIBC_NO_BUILTINS += -fno-builtin-vfscanf LIBNOLIBC_NO_BUILTINS += -fno-builtin-vsscanf -CFLAGS-$(LIBNOLIBC) += $(LIBNOLIBC_NO_BUILTINS) -CXXFLAGS-$(LIBNOLIBC) += $(LIBNOLIBC_NO_BUILTINS) -CINCLUDES-$(LIBNOLIBC) += -I$(LIBNOLIBC_BASE)/include -CXXINCLUDES-$(LIBNOLIBC) += -I$(LIBNOLIBC_BASE)/include +CFLAGS-$(CONFIG_LIBNOLIBC) += $(LIBNOLIBC_NO_BUILTINS) +CXXFLAGS-$(CONFIG_LIBNOLIBC) += $(LIBNOLIBC_NO_BUILTINS) +CINCLUDES-$(CONFIG_LIBNOLIBC) += -I$(LIBNOLIBC_BASE)/include +CXXINCLUDES-$(CONFIG_LIBNOLIBC) += -I$(LIBNOLIBC_BASE)/include LIBNOLIBC_SRCS-y += $(LIBNOLIBC_BASE)/errno.c LIBNOLIBC_SRCS-y += $(LIBNOLIBC_BASE)/stdio.c @@ -26,7 +26,7 @@ LIBNOLIBC_SRCS-y += $(LIBNOLIBC_BASE)/ctype.c LIBNOLIBC_SRCS-y += $(LIBNOLIBC_BASE)/stdlib.c LIBNOLIBC_SRCS-y += $(LIBNOLIBC_BASE)/string.c LIBNOLIBC_SRCS-y += $(LIBNOLIBC_BASE)/getopt.c -LIBNOLIBC_SRCS-$(LIBUKALLOC) += $(LIBNOLIBC_BASE)/malloc.c +LIBNOLIBC_SRCS-$(CONFIG_LIBUKALLOC) += $(LIBNOLIBC_BASE)/malloc.c # Localize internal symbols (starting with __*) LIBNOLIBC_OBJCFLAGS-y += -w -L __* diff --git a/lib/nolibc/include/stdlib.h b/lib/nolibc/include/stdlib.h index 9281a86..dd6f9f7 100644 --- a/lib/nolibc/include/stdlib.h +++ b/lib/nolibc/include/stdlib.h @@ -48,7 +48,7 @@ unsigned long strtoul(const char *nptr, char **endptr, int base); long long strtoll(const char *nptr, char **endptr, int base); unsigned long long strtoull(const char *nptr, char **endptr, int base); -#if LIBUKALLOC +#if CONFIG_LIBUKALLOC /* Allocate size bytes of memory. Returns pointer to start of allocated memory, * or NULL on failure. */ @@ -75,7 +75,7 @@ int posix_memalign(void **memptr, size_t align, size_t size); * start of allocated memory, or NULL on failure. */ void *memalign(size_t align, size_t size); -#endif /* LIBUKALLOC */ +#endif /* CONFIG_LIBUKALLOC */ #ifdef __cplusplus } diff --git a/lib/ukalloc/Makefile.uk b/lib/ukalloc/Makefile.uk index 53c2ce4..3063646 100644 --- a/lib/ukalloc/Makefile.uk +++ b/lib/ukalloc/Makefile.uk @@ -1,6 +1,6 @@ -$(eval $(call addlib_s,libukalloc,$(LIBUKALLOC))) +$(eval $(call addlib_s,libukalloc,$(CONFIG_LIBUKALLOC))) -CINCLUDES-$(LIBUKALLOC) += -I$(LIBUKALLOC_BASE)/include -CXXINCLUDES-$(LIBUKALLOC) += -I$(LIBUKALLOC_BASE)/include +CINCLUDES-$(CONFIG_LIBUKALLOC) += -I$(LIBUKALLOC_BASE)/include +CXXINCLUDES-$(CONFIG_LIBUKALLOC) += -I$(LIBUKALLOC_BASE)/include LIBUKALLOC_SRCS-y += $(LIBUKALLOC_BASE)/alloc.c diff --git a/lib/ukalloc/alloc.c b/lib/ukalloc/alloc.c index 85b3e00..3260554 100644 --- a/lib/ukalloc/alloc.c +++ b/lib/ukalloc/alloc.c @@ -109,7 +109,7 @@ int uk_alloc_set_default(struct uk_alloc *a) return 0; } -#if LIBUKALLOC_IFPAGES +#if CONFIG_LIBUKALLOC_IFPAGES static void *uk_get_real_start(const void *ptr) { void *intptr; diff --git a/lib/ukalloc/include/uk/alloc.h b/lib/ukalloc/include/uk/alloc.h index 3f0d9e5..d59da30 100644 --- a/lib/ukalloc/include/uk/alloc.h +++ b/lib/ukalloc/include/uk/alloc.h @@ -66,7 +66,7 @@ typedef void* (*uk_alloc_realloc_func_t) (struct uk_alloc *a, void *ptr, size_t size); typedef void (*uk_alloc_free_func_t) (struct uk_alloc *a, void *ptr); -#if LIBUKALLOC_IFPAGES +#if CONFIG_LIBUKALLOC_IFPAGES typedef void* (*uk_alloc_palloc_func_t) (struct uk_alloc *a, size_t order); typedef void (*uk_alloc_pfree_func_t) @@ -74,7 +74,7 @@ typedef void (*uk_alloc_pfree_func_t) #endif typedef int (*uk_alloc_addmem_func_t) (struct uk_alloc *a, void *base, size_t size); -#if LIBUKALLOC_IFSTATS +#if CONFIG_LIBUKALLOC_IFSTATS typedef ssize_t (*uk_alloc_availmem_func_t) (struct uk_alloc *a); #endif @@ -88,12 +88,12 @@ struct uk_alloc { uk_alloc_memalign_func_t memalign; uk_alloc_free_func_t free; -#if LIBUKALLOC_IFPAGES +#if CONFIG_LIBUKALLOC_IFPAGES /* page allocation interface */ uk_alloc_palloc_func_t palloc; uk_alloc_pfree_func_t pfree; #endif -#if LIBUKALLOC_IFSTATS +#if CONFIG_LIBUKALLOC_IFSTATS /* optional interface */ uk_alloc_availmem_func_t availmem; #endif @@ -191,7 +191,7 @@ static inline void uk_free(struct uk_alloc *a, void *ptr) uk_do_free(a, ptr); } -#if LIBUKALLOC_IFPAGES +#if CONFIG_LIBUKALLOC_IFPAGES static inline void *uk_do_palloc(struct uk_alloc *a, size_t order) { UK_ASSERT(a); @@ -222,7 +222,7 @@ static inline int uk_alloc_addmem(struct uk_alloc *a, void *base, else return -ENOTSUP; } -#if LIBUKALLOC_IFSTATS +#if CONFIG_LIBUKALLOC_IFSTATS static inline ssize_t uk_alloc_availmem(struct uk_alloc *a) { UK_ASSERT(a); @@ -230,9 +230,9 @@ static inline ssize_t uk_alloc_availmem(struct uk_alloc *a) return (ssize_t) -ENOTSUP; return a->availmem(a); } -#endif /* LIBUKALLOC_IFSTATS */ +#endif /* CONFIG_LIBUKALLOC_IFSTATS */ -#if LIBUKALLOC_IFPAGES +#if CONFIG_LIBUKALLOC_IFPAGES /* uses palloc(), pfree() */ void *uk_malloc_ifpages(struct uk_alloc *a, size_t size); void *uk_realloc_ifpages(struct uk_alloc *a, void *ptr, size_t size); @@ -246,7 +246,7 @@ void uk_free_ifpages(struct uk_alloc *a, void *ptr); void *uk_calloc_compat(struct uk_alloc *a, size_t num, size_t len); void *uk_memalign_compat(struct uk_alloc *a, size_t align, size_t len); -#if LIBUKALLOC_IFPAGES +#if CONFIG_LIBUKALLOC_IFPAGES #define uk_alloc_init_palloc(a, palloc_func, pfree_func, addmem_func) \ do { \ (a)->malloc = uk_malloc_ifpages; \ diff --git a/lib/ukallocbbuddy/Makefile.uk b/lib/ukallocbbuddy/Makefile.uk index 7b3314d..27c98b7 100644 --- a/lib/ukallocbbuddy/Makefile.uk +++ b/lib/ukallocbbuddy/Makefile.uk @@ -1,6 +1,6 @@ -$(eval $(call addlib_s,libukallocbbuddy,$(LIBUKALLOCBBUDDY))) +$(eval $(call addlib_s,libukallocbbuddy,$(CONFIG_LIBUKALLOCBBUDDY))) -CINCLUDES-$(LIBUKALLOCBBUDDY) += -I$(LIBUKALLOCBBUDDY_BASE)/include -CXXINCLUDES-$(LIBUKALLOCBBUDDY) += -I$(LIBUKALLOCBBUDDY_BASE)/include +CINCLUDES-$(CONFIG_LIBUKALLOCBBUDDY) += -I$(LIBUKALLOCBBUDDY_BASE)/include +CXXINCLUDES-$(CONFIG_LIBUKALLOCBBUDDY) += -I$(LIBUKALLOCBBUDDY_BASE)/include LIBUKALLOCBBUDDY_SRCS-y += $(LIBUKALLOCBBUDDY_BASE)/bbuddy.c diff --git a/lib/ukallocbbuddy/bbuddy.c b/lib/ukallocbbuddy/bbuddy.c index b830995..20a9b70 100644 --- a/lib/ukallocbbuddy/bbuddy.c +++ b/lib/ukallocbbuddy/bbuddy.c @@ -201,7 +201,7 @@ static void map_free(struct uk_bbpalloc *b, uintptr_t first_page, b->nr_free_pages += nr_pages; } -#if LIBUKALLOC_IFSTATS +#if CONFIG_LIBUKALLOC_IFSTATS static ssize_t bbuddy_availmem(struct uk_alloc *a) { struct uk_bbpalloc *b; @@ -439,7 +439,7 @@ struct uk_alloc *uk_allocbbuddy_init(void *base, size_t len) /* initialize and register allocator interface */ uk_alloc_init_palloc(a, bbuddy_palloc, bbuddy_pfree, bbuddy_addmem); -#if LIBUKALLOC_IFSTATS +#if CONFIG_LIBUKALLOC_IFSTATS a->availmem = bbuddy_availmem; #endif diff --git a/lib/ukargparse/Makefile.uk b/lib/ukargparse/Makefile.uk index 970422d..af9eba5 100644 --- a/lib/ukargparse/Makefile.uk +++ b/lib/ukargparse/Makefile.uk @@ -1,6 +1,6 @@ -$(eval $(call addlib_s,libukargparse,$(LIBUKARGPARSE))) +$(eval $(call addlib_s,libukargparse,$(CONFIG_LIBUKARGPARSE))) -CINCLUDES-$(LIBUKARGPARSE) += -I$(LIBUKARGPARSE_BASE)/include -CXXINCLUDES-$(LIBUKARGPARSE) += -I$(LIBUKARGPARSE_BASE)/include +CINCLUDES-$(CONFIG_LIBUKARGPARSE) += -I$(LIBUKARGPARSE_BASE)/include +CXXINCLUDES-$(CONFIG_LIBUKARGPARSE) += -I$(LIBUKARGPARSE_BASE)/include LIBUKARGPARSE_SRCS-y += $(LIBUKARGPARSE_BASE)/argparse.c diff --git a/lib/ukboot/Makefile.uk b/lib/ukboot/Makefile.uk index ddb81e0..2b7f69f 100644 --- a/lib/ukboot/Makefile.uk +++ b/lib/ukboot/Makefile.uk @@ -1,6 +1,6 @@ -$(eval $(call addlib_s,libukboot,$(LIBUKBOOT))) +$(eval $(call addlib_s,libukboot,$(CONFIG_LIBUKBOOT))) -CINCLUDES-$(LIBUKBOOT) += -I$(LIBUKBOOT_BASE)/include -CXXINCLUDES-$(LIBUKBOOT) += -I$(LIBUKBOOT_BASE)/include +CINCLUDES-$(CONFIG_LIBUKBOOT) += -I$(LIBUKBOOT_BASE)/include +CXXINCLUDES-$(CONFIG_LIBUKBOOT) += -I$(LIBUKBOOT_BASE)/include LIBUKBOOT_SRCS-y += $(LIBUKBOOT_BASE)/boot.c diff --git a/lib/ukboot/boot.c b/lib/ukboot/boot.c index 0609efe..e6dfffa 100644 --- a/lib/ukboot/boot.c +++ b/lib/ukboot/boot.c @@ -40,10 +40,10 @@ #include <stddef.h> #include <errno.h> -#if LIBUKALLOC && LIBUKALLOCBBUDDY && LIBUKBOOT_INITALLOC +#if CONFIG_LIBUKALLOC && CONFIG_LIBUKALLOCBBUDDY && CONFIG_LIBUKBOOT_INITALLOC #include <uk/allocbbuddy.h> #endif -#if LIBUKSCHED +#if CONFIG_LIBUKSCHED #include <uk/sched.h> #endif #include <uk/arch/lcpu.h> @@ -90,7 +90,7 @@ static void main_thread_func(void *arg) /* defined in <uk/plat.h> */ void ukplat_entry_argp(char *arg0, char *argb, __sz argb_len) { - char *argv[LIBUKBOOT_MAXNBARGS]; + char *argv[CONFIG_LIBUKBOOT_MAXNBARGS]; int argc = 0; if (arg0) { @@ -99,8 +99,8 @@ void ukplat_entry_argp(char *arg0, char *argb, __sz argb_len) } if (argb && argb_len) { argc += uk_argnparse(argb, argb_len, arg0 ? &argv[1] : &argv[0], - arg0 ? (LIBUKBOOT_MAXNBARGS - 1) - : LIBUKBOOT_MAXNBARGS); + arg0 ? (CONFIG_LIBUKBOOT_MAXNBARGS - 1) + : CONFIG_LIBUKBOOT_MAXNBARGS); } ukplat_entry(argc, argv); } @@ -110,19 +110,19 @@ void ukplat_entry(int argc, char *argv[]) { int i; struct thread_main_arg tma; -#if LIBUKALLOC +#if CONFIG_LIBUKALLOC struct uk_alloc *a = NULL; int rc; #endif -#if LIBUKALLOC && LIBUKALLOCBBUDDY && LIBUKBOOT_INITALLOC +#if CONFIG_LIBUKALLOC && CONFIG_LIBUKALLOCBBUDDY && CONFIG_LIBUKBOOT_INITALLOC struct ukplat_memregion_desc md; #endif -#if LIBUKSCHED +#if CONFIG_LIBUKSCHED struct uk_sched *s = NULL; struct uk_thread *main_thread = NULL; #endif -#if LIBUKBOOT_BANNER +#if CONFIG_LIBUKBOOT_BANNER uk_printk("Welcome to _ __ _____\n"); uk_printk(" __ _____ (_) /__ _______ _/ _/ /_\n"); uk_printk("/ // / _ \\/ / '_// __/ _ `/ _/ __/\n"); @@ -153,7 +153,7 @@ void ukplat_entry(int argc, char *argv[]) } } -#if LIBUKALLOC && LIBUKALLOCBBUDDY && LIBUKBOOT_INITALLOC +#if CONFIG_LIBUKALLOC && CONFIG_LIBUKALLOCBBUDDY && CONFIG_LIBUKBOOT_INITALLOC /* initialize memory allocator * FIXME: ukallocbbuddy is hard-coded for now */ @@ -166,7 +166,7 @@ void ukplat_entry(int argc, char *argv[]) if ((md.flags & UKPLAT_MEMRF_ALLOCATABLE) != UKPLAT_MEMRF_ALLOCATABLE) { -#if UKPLAT_MEMRNAME +#if CONFIG_UKPLAT_MEMRNAME uk_printd(DLVL_EXTRA, "Skip memory region %d: %p - %p (flags: 0x%02x, name: %s)\n", i, md.base, (void *)((size_t)md.base + md.len), @@ -180,7 +180,7 @@ void ukplat_entry(int argc, char *argv[]) continue; } -#if UKPLAT_MEMRNAME +#if CONFIG_UKPLAT_MEMRNAME uk_printd(DLVL_EXTRA, "Try memory region %d: %p - %p (flags: 0x%02x, name: %s)...\n", i, md.base, (void *)((size_t)md.base + md.len), @@ -206,7 +206,7 @@ void ukplat_entry(int argc, char *argv[]) uk_printd(DLVL_WARN, "No suitable memory region for memory allocator. Continue without heap\n"); #endif -#if LIBUKALLOC +#if CONFIG_LIBUKALLOC uk_printd(DLVL_INFO, "Initialize IRQ subsystem...\n"); rc = ukplat_irq_init(a); if (unlikely(rc != 0)) @@ -217,7 +217,7 @@ void ukplat_entry(int argc, char *argv[]) uk_printd(DLVL_INFO, "Initialize platform time...\n"); ukplat_time_init(); -#if LIBUKSCHED +#if CONFIG_LIBUKSCHED /* Init scheduler. */ s = uk_sched_default_init(a); if (unlikely(!s)) @@ -227,7 +227,7 @@ void ukplat_entry(int argc, char *argv[]) tma.argc = argc; tma.argv = argv; -#if LIBUKSCHED +#if CONFIG_LIBUKSCHED main_thread = uk_thread_create("main", main_thread_func, &tma); if (unlikely(!main_thread)) UK_CRASH("Could not create main thread."); diff --git a/lib/ukdebug/Makefile.uk b/lib/ukdebug/Makefile.uk index dd909ee..4aaa518 100644 --- a/lib/ukdebug/Makefile.uk +++ b/lib/ukdebug/Makefile.uk @@ -1,7 +1,7 @@ -$(eval $(call addlib_s,libukdebug,$(LIBUKDEBUG))) +$(eval $(call addlib_s,libukdebug,$(CONFIG_LIBUKDEBUG))) -CINCLUDES-$(LIBUKDEBUG) += -I$(LIBUKDEBUG_BASE)/include -CXXINCLUDES-$(LIBUKDEBUG) += -I$(LIBUKDEBUG_BASE)/include +CINCLUDES-$(CONFIG_LIBUKDEBUG) += -I$(LIBUKDEBUG_BASE)/include +CXXINCLUDES-$(CONFIG_LIBUKDEBUG) += -I$(LIBUKDEBUG_BASE)/include LIBUKDEBUG_CFLAGS-y += -D__IN_LIBUKDEBUG__ LIBUKDEBUG_CXXFLAGS-y += -D__IN_LIBUKDEBUG__ diff --git a/lib/ukdebug/hexdump.c b/lib/ukdebug/hexdump.c index 21a70c9..a3d8e5f 100644 --- a/lib/ukdebug/hexdump.c +++ b/lib/ukdebug/hexdump.c @@ -51,10 +51,10 @@ enum _hxd_output_type { UK_HXDOUT_FILE = 0, UK_HXDOUT_BUFFER, -#if LIBUKDEBUG_PRINTK +#if CONFIG_LIBUKDEBUG_PRINTK UK_HXDOUT_KERN, #endif -#if LIBUKDEBUG_PRINTD +#if CONFIG_LIBUKDEBUG_PRINTD UK_HXDOUT_DEBUG, #endif }; @@ -63,7 +63,7 @@ struct _hxd_output { enum _hxd_output_type type; union { -#if LIBUKDEBUG_PRINTD +#if CONFIG_LIBUKDEBUG_PRINTD struct { int lvl; const char *libname; @@ -106,12 +106,12 @@ static int _hxd_outf(struct _hxd_output *o, const char *fmt, ...) o->buffer.left -= (ret - 1); } break; -#if LIBUKDEBUG_PRINTK +#if CONFIG_LIBUKDEBUG_PRINTK case UK_HXDOUT_KERN: uk_vprintk(fmt, ap); break; #endif -#if LIBUKDEBUG_PRINTD +#if CONFIG_LIBUKDEBUG_PRINTD case UK_HXDOUT_DEBUG: _uk_vprintd(o->debug.lvl, o->debug.libname, o->debug.srcname, o->debug.srcline, fmt, ap); @@ -326,7 +326,7 @@ int uk_hexdumpf(FILE *fp, const void *data, size_t len, size_t addr0, int flags, void uk_hexdumpk(const void *data, size_t len, int flags, unsigned int grps_per_line) { -#if LIBUKDEBUG_PRINTK +#if CONFIG_LIBUKDEBUG_PRINTK struct _hxd_output o = {.type = UK_HXDOUT_KERN}; _hxd(&o, data, len, (size_t)data, flags, grps_per_line, ""); @@ -340,7 +340,7 @@ void _uk_hexdumpd(int lvl, const char *libname, const char *srcname, size_t addr0, int flags, unsigned int grps_per_line, const char *line_prefix) { -#if LIBUKDEBUG_PRINTD +#if CONFIG_LIBUKDEBUG_PRINTD struct _hxd_output o = {.type = UK_HXDOUT_DEBUG, .debug.lvl = lvl, .debug.libname = libname, diff --git a/lib/ukdebug/include/uk/assert.h b/lib/ukdebug/include/uk/assert.h index 8569cdc..09001fb 100644 --- a/lib/ukdebug/include/uk/assert.h +++ b/lib/ukdebug/include/uk/assert.h @@ -44,7 +44,7 @@ #include <uk/print.h> #include <uk/config.h> -#if LIBUKDEBUG_ENABLE_ASSERT +#if CONFIG_LIBUKDEBUG_ENABLE_ASSERT #define UK_ASSERT(x) \ do { \ if (unlikely(!(x))) { \ diff --git a/lib/ukdebug/include/uk/hexdump.h b/lib/ukdebug/include/uk/hexdump.h index 1ba5e4a..4d32647 100644 --- a/lib/ukdebug/include/uk/hexdump.h +++ b/lib/ukdebug/include/uk/hexdump.h @@ -51,7 +51,7 @@ #define UK_HXDF_COMPRESS (64) /* suppress repeated lines */ -#if LIBUKDEBUG_PRINTK +#if CONFIG_LIBUKDEBUG_PRINTK /** * Plots an hexdump for a given data region to kernel output * The absolute address is plotted when UK_HXDF_ADDR is set @@ -72,7 +72,7 @@ static inline void uk_hexdumpk(const void *data, size_t len, int flags, } #endif -#if LIBUKDEBUG_PRINTD +#if CONFIG_LIBUKDEBUG_PRINTD void _uk_hexdumpd(int lvl, const char *libname, const char *srcname, unsigned int srcline, const void *data, size_t len, size_t addr0, int flags, unsigned int grps_per_line, diff --git a/lib/ukdebug/include/uk/print.h b/lib/ukdebug/include/uk/print.h index a7a6bfd..c5c5557 100644 --- a/lib/ukdebug/include/uk/print.h +++ b/lib/ukdebug/include/uk/print.h @@ -49,20 +49,20 @@ * in the configuration. This is required for linking with * pre-compiled objects that built by using a different configuration. */ -#if !LIBUKDEBUG_PRINTK -#undef LIBUKDEBUG_PRINTK -#define LIBUKDEBUG_PRINTK 1 +#if !CONFIG_LIBUKDEBUG_PRINTK +#undef CONFIG_LIBUKDEBUG_PRINTK +#define CONFIG_LIBUKDEBUG_PRINTK 1 #endif -#if !LIBUKDEBUG_PRINTD -#undef LIBUKDEBUG_PRINTD -#define LIBUKDEBUG_PRINTD 1 +#if !CONFIG_LIBUKDEBUG_PRINTD +#undef CONFIG_LIBUKDEBUG_PRINTD +#define CONFIG_LIBUKDEBUG_PRINTD 1 #endif #endif /* __IN_LIBUKDEBUG__ */ /* * KERNEL CONSOLE */ -#if LIBUKDEBUG_PRINTK +#if CONFIG_LIBUKDEBUG_PRINTK void uk_vprintk(const char *fmt, va_list ap); void uk_printk(const char *fmt, ...) __printf(1, 2); #else @@ -84,21 +84,21 @@ static inline void uk_printk(const char *fmt, ...) #define DLVL_ERR (1) #define DLVL_CRIT (0) -#if LIBUKDEBUG_PRINTD_CRIT +#if CONFIG_LIBUKDEBUG_PRINTD_CRIT #define DLVL_MAX DLVL_CRIT -#elif LIBUKDEBUG_PRINTD_ERR +#elif CONFIG_LIBUKDEBUG_PRINTD_ERR #define DLVL_MAX DLVL_ERR -#elif LIBUKDEBUG_PRINTD_WARN +#elif CONFIG_LIBUKDEBUG_PRINTD_WARN #define DLVL_MAX DLVL_WARN -#elif LIBUKDEBUG_PRINTD_INFO +#elif CONFIG_LIBUKDEBUG_PRINTD_INFO #define DLVL_MAX DLVL_INFO -#elif LIBUKDEBUG_PRINTD_EXTRA +#elif CONFIG_LIBUKDEBUG_PRINTD_EXTRA #define DLVL_MAX DLVL_EXTRA #else #define DLVL_MAX DLVL_ERR /* default level */ #endif -#if LIBUKDEBUG_PRINTD +#if CONFIG_LIBUKDEBUG_PRINTD /* please use the uk_printd(), uk_vprintd() macros because * they compile in the function calls only if the configured * debug level requires it @@ -142,7 +142,7 @@ static inline void uk_printd(int lvl, const char *fmt, ...) __printf(2, 3); static inline void uk_printd(int lvl __unused, const char *fmt __unused, ...) { } -#endif /* LIBUKDEBUG_PRINTD */ +#endif /* CONFIG_LIBUKDEBUG_PRINTD */ /* Print a message on both: Kernel console and Debug console */ #define uk_printkd(dlvl, fmt, ...) \ diff --git a/lib/ukdebug/print.c b/lib/ukdebug/print.c index 42dca4a..6f98d28 100644 --- a/lib/ukdebug/print.c +++ b/lib/ukdebug/print.c @@ -59,7 +59,7 @@ /* special level for printk redirection, used internally only */ #define DLVL_CONS (-1) -#if !LIBUKDEBUG_REDIR_PRINTK +#if !CONFIG_LIBUKDEBUG_REDIR_PRINTK static inline void _vprintk(const char *fmt, va_list ap) { char lbuf[BUFLEN]; @@ -71,13 +71,13 @@ static inline void _vprintk(const char *fmt, va_list ap) } #endif -#if LIBUKDEBUG_REDIR_PRINTD +#if CONFIG_LIBUKDEBUG_REDIR_PRINTD #define _ukplat_coutd(lbuf, len) ukplat_coutk((lbuf), (len)) #else #define _ukplat_coutd(lbuf, len) ukplat_coutd((lbuf), (len)) #endif -#if LIBUKDEBUG_PRINTD_TIME +#if CONFIG_LIBUKDEBUG_PRINTD_TIME static void _printd_timestamp(void) { char buf[BUFLEN]; @@ -93,7 +93,7 @@ static void _printd_timestamp(void) } #endif -#if LIBUKDEBUG_PRINTD_STACK +#if CONFIG_LIBUKDEBUG_PRINTD_STACK static void _printd_stack(void) { unsigned long stackb; @@ -120,7 +120,7 @@ static inline void _vprintd(int lvl, const char *libname, const char *srcname, const char *nlptr = NULL; switch (lvl) { -#if LIBUKDEBUG_REDIR_PRINTK +#if CONFIG_LIBUKDEBUG_REDIR_PRINTK case DLVL_CONS: msghdr = "Kern: "; break; @@ -161,11 +161,11 @@ static inline void _vprintd(int lvl, const char *libname, const char *srcname, lptr = lbuf; while (len > 0) { if (newline) { -#if LIBUKDEBUG_PRINTD_TIME +#if CONFIG_LIBUKDEBUG_PRINTD_TIME _printd_timestamp(); #endif _ukplat_coutd(DECONST(char *, msghdr), 6); -#if LIBUKDEBUG_PRINTD_STACK +#if CONFIG_LIBUKDEBUG_PRINTD_STACK _printd_stack(); #endif if (libname) { @@ -204,43 +204,43 @@ static inline void _vprintd(int lvl, const char *libname, const char *srcname, /* ensures that function is always compiled */ void uk_vprintk(const char *fmt, va_list ap) { -#if LIBUKDEBUG_PRINTK -#if LIBUKDEBUG_REDIR_PRINTK +#if CONFIG_LIBUKDEBUG_PRINTK +#if CONFIG_LIBUKDEBUG_REDIR_PRINTK _vprintd(DLVL_CONS, NULL, NULL, 0, fmt, ap); #else _vprintk(fmt, ap); #endif -#endif /* LIBUKDEBUG_PRINTK */ +#endif /* CONFIG_LIBUKDEBUG_PRINTK */ } /* ensures that function is always compiled */ void uk_printk(const char *fmt, ...) { -#if LIBUKDEBUG_PRINTK +#if CONFIG_LIBUKDEBUG_PRINTK va_list ap; va_start(ap, fmt); uk_vprintk(fmt, ap); va_end(ap); -#endif /* LIBUKDEBUG_PRINTK */ +#endif /* CONFIG_LIBUKDEBUG_PRINTK */ } /* ensures that function is always compiled */ void _uk_vprintd(int lvl, const char *libname, const char *srcname, unsigned int srcline, const char *fmt, va_list ap) { -#if LIBUKDEBUG_PRINTD +#if CONFIG_LIBUKDEBUG_PRINTD if (likely(lvl > DLVL_MAX)) return; _vprintd(lvl, libname, srcname, srcline, fmt, ap); -#endif /* LIBUKDEBUG_PRINTD */ +#endif /* CONFIG_LIBUKDEBUG_PRINTD */ } /* ensures that function is always compiled */ void _uk_printd(int lvl, const char *libname, const char *srcname, unsigned int srcline, const char *fmt, ...) { -#if LIBUKDEBUG_PRINTD +#if CONFIG_LIBUKDEBUG_PRINTD va_list ap; if (likely(lvl > DLVL_MAX)) @@ -249,5 +249,5 @@ void _uk_printd(int lvl, const char *libname, const char *srcname, va_start(ap, fmt); _uk_vprintd(lvl, libname, srcname, srcline, fmt, ap); va_end(ap); -#endif /* LIBUKDEBUG_PRINTD */ +#endif /* CONFIG_LIBUKDEBUG_PRINTD */ } diff --git a/lib/uksched/Makefile.uk b/lib/uksched/Makefile.uk index b7636f2..24816f6 100644 --- a/lib/uksched/Makefile.uk +++ b/lib/uksched/Makefile.uk @@ -1,7 +1,7 @@ -$(eval $(call addlib_s,libuksched,$(LIBUKSCHED))) +$(eval $(call addlib_s,libuksched,$(CONFIG_LIBUKSCHED))) -CINCLUDES-$(LIBUKSCHED) += -I$(LIBUKSCHED_BASE)/include -CXXINCLUDES-$(LIBUKSCHED) += -I$(LIBUKSCHED_BASE)/include +CINCLUDES-$(CONFIG_LIBUKSCHED) += -I$(LIBUKSCHED_BASE)/include +CXXINCLUDES-$(CONFIG_LIBUKSCHED) += -I$(LIBUKSCHED_BASE)/include LIBUKSCHED_SRCS-y += $(LIBUKSCHED_BASE)/sched.c LIBUKSCHED_SRCS-y += $(LIBUKSCHED_BASE)/thread.c diff --git a/lib/uksched/include/uk/thread.h b/lib/uksched/include/uk/thread.h index 9d52f25..4ffb002 100644 --- a/lib/uksched/include/uk/thread.h +++ b/lib/uksched/include/uk/thread.h @@ -29,7 +29,7 @@ #define __UK_THREAD_H__ #include <stdint.h> -#ifdef HAVE_LIBC +#ifdef CONFIG_HAVE_LIBC #include <sys/reent.h> #endif #include <uk/arch/lcpu.h> @@ -52,7 +52,7 @@ struct uk_thread { uint32_t flags; __snsec wakeup_time; struct uk_sched *sched; -#ifdef HAVE_LIBC +#ifdef CONFIG_HAVE_LIBC struct _reent reent; #endif }; diff --git a/lib/uksched/sched.c b/lib/uksched/sched.c index 0887b44..07e7aef 100644 --- a/lib/uksched/sched.c +++ b/lib/uksched/sched.c @@ -37,7 +37,7 @@ #include <uk/plat/thread.h> #include <uk/alloc.h> #include <uk/sched.h> -#if LIBUKSCHEDCOOP +#if CONFIG_LIBUKSCHEDCOOP #include <uk/schedcoop.h> #endif @@ -48,7 +48,7 @@ struct uk_sched *uk_sched_default_init(struct uk_alloc *a) { struct uk_sched *s = NULL; -#if LIBUKSCHEDCOOP +#if CONFIG_LIBUKSCHEDCOOP s = uk_schedcoop_init(a); #endif diff --git a/lib/uksched/thread.c b/lib/uksched/thread.c index 83d43a4..4b00b1a 100644 --- a/lib/uksched/thread.c +++ b/lib/uksched/thread.c @@ -85,7 +85,7 @@ int uk_thread_init(struct uk_thread *thread, thread->flags = 0; thread->wakeup_time = 0LL; -#ifdef HAVE_LIBC +#ifdef CONFIG_HAVE_LIBC //TODO _REENT_INIT_PTR(&thread->reent); #endif diff --git a/lib/ukschedcoop/Makefile.uk b/lib/ukschedcoop/Makefile.uk index 394e7e9..13bc9a4 100644 --- a/lib/ukschedcoop/Makefile.uk +++ b/lib/ukschedcoop/Makefile.uk @@ -1,6 +1,6 @@ -$(eval $(call addlib_s,libukschedcoop,$(LIBUKSCHEDCOOP))) +$(eval $(call addlib_s,libukschedcoop,$(CONFIG_LIBUKSCHEDCOOP))) -CINCLUDES-$(LIBUKSCHEDCOOP) += -I$(LIBUKSCHEDCOOP_BASE)/include -CXXINCLUDES-$(LIBUKSCHEDCOOP) += -I$(LIBUKSCHEDCOOP_BASE)/include +CINCLUDES-$(CONFIG_LIBUKSCHEDCOOP) += -I$(LIBUKSCHEDCOOP_BASE)/include +CXXINCLUDES-$(CONFIG_LIBUKSCHEDCOOP) += -I$(LIBUKSCHEDCOOP_BASE)/include LIBUKSCHEDCOOP_SRCS-y += $(LIBUKSCHEDCOOP_BASE)/schedcoop.c diff --git a/lib/uktimeconv/Makefile.uk b/lib/uktimeconv/Makefile.uk index 0f44984..19175fb 100644 --- a/lib/uktimeconv/Makefile.uk +++ b/lib/uktimeconv/Makefile.uk @@ -1,6 +1,6 @@ -$(eval $(call addlib_s,libuktimeconv,$(LIBUKTIMECONV))) +$(eval $(call addlib_s,libuktimeconv,$(CONFIG_LIBUKTIMECONV))) -CINCLUDES-$(LIBUKTIMECONV) += -I$(LIBUKTIMECONV_BASE)/include -CXXINCLUDES-$(LIBUKTIMECONV) += -I$(LIBUKTIMECONV_BASE)/include +CINCLUDES-$(CONFIG_LIBUKTIMECONV) += -I$(LIBUKTIMECONV_BASE)/include +CXXINCLUDES-$(CONFIG_LIBUKTIMECONV) += -I$(LIBUKTIMECONV_BASE)/include LIBUKTIMECONV_SRCS-y += $(LIBUKTIMECONV_BASE)/timeconv.c diff --git a/plat/Makefile.uk b/plat/Makefile.uk index 4f8fa34..6ff632c 100644 --- a/plat/Makefile.uk +++ b/plat/Makefile.uk @@ -1,4 +1,4 @@ -UK_PLAT_BASE := $(UK_BASE)/plat +UK_PLAT_BASE := $(CONFIG_UK_BASE)/plat UK_PLAT_COMMON_BASE := $(UK_PLAT_BASE)/common $(eval $(call _import_lib,$(UK_PLAT_BASE)/xen)) diff --git a/plat/kvm/Linker.uk b/plat/kvm/Linker.uk index a91a786..fa92abf 100644 --- a/plat/kvm/Linker.uk +++ b/plat/kvm/Linker.uk @@ -1,30 +1,30 @@ -ifeq (x86_64,$(UK_ARCH)) -KVM_LDSCRIPT := -Wl,-T,$(UK_BASE)/plat/kvm/x86/link64.ld +ifeq (x86_64,$(CONFIG_UK_ARCH)) +KVM_LDSCRIPT := -Wl,-T,$(CONFIG_UK_BASE)/plat/kvm/x86/link64.ld KVM_LDFLAGS-y += -Wl,-m,elf_x86_64 endif ## ## Link image ## -KVM_IMAGE := $(BUILD_DIR)/$(UK_NAME)_kvm-$(UK_ARCH) +KVM_IMAGE := $(BUILD_DIR)/$(CONFIG_UK_NAME)_kvm-$(CONFIG_UK_ARCH) $(KVM_IMAGE): $(KVM_LINK) $(KVM_LINK-y) $(UK_LINK) $(UK_LINK-y) $(call build_cmd,LD,,$@.ld.o,\ $(LD) -r $(LIBLDFLAGS) $(LIBLDFLAGS-y) $(KVM_LDFLAGS) $(KVM_LDFLAGS-y) $^ -o $@.ld.o) $(call build_cmd,OBJCOPY,,$@.o,\ $(OBJCOPY) -w -G kvmos_* -G _libkvmplat_entry $@.ld.o $@.o) -ifeq (x86_64,$(UK_ARCH)) +ifeq (x86_64,$(CONFIG_UK_ARCH)) $(call build_cmd,LD,,$@,\ $(LD) $(LDFLAGS) $(LDFLAGS-y) $(KVM_LDFLAGS) $(KVM_LDFLAGS-y) $(KVM_LDSCRIPT) $@.o -o $@) -ifeq ($(OPTIMIZE_DBGFILE),y) +ifeq ($(CONFIG_OPTIMIZE_DBGFILE),y) $(call build_cmd,OBJCOPY,,$@.dbg,\ $(OBJCOPY) --only-keep-debug $@ $@.dbg) endif -ifeq ($(OPTIMIZE_SYMFILE),y) +ifeq ($(CONFIG_OPTIMIZE_SYMFILE),y) $(call build_cmd,NM,,$@.sym,\ $(NM) -n $@ > $@.sym) endif -ifeq ($(OPTIMIZE_STRIP),y) +ifeq ($(CONFIG_OPTIMIZE_STRIP),y) $(call verbose_cmd,STRIP,$(notdir $@),\ $(STRIP) -s $@) endif @@ -33,7 +33,7 @@ endif endif # register image to the build -UK_IMAGES-$(PLAT_KVM) += $(KVM_IMAGE) +UK_IMAGES-$(CONFIG_PLAT_KVM) += $(KVM_IMAGE) # ...for cleaning: LIBKVMPLAT_CLEAN += $(call build_clean,$(KVM_IMAGE)) diff --git a/plat/kvm/Makefile.uk b/plat/kvm/Makefile.uk index dcfa517..b840c2f 100644 --- a/plat/kvm/Makefile.uk +++ b/plat/kvm/Makefile.uk @@ -1,7 +1,7 @@ ## ## KVM platform registration ## -$(eval $(call addplat_s,kvm,$(PLAT_KVM))) +$(eval $(call addplat_s,kvm,$(CONFIG_PLAT_KVM))) ## ## KVM platform library registration @@ -16,21 +16,21 @@ LIBKVMPLAT_ASINCLUDES-y += -I$(UK_PLAT_COMMON_BASE)/include LIBKVMPLAT_CINCLUDES-y += -I$(LIBKVMPLAT_BASE)/include LIBKVMPLAT_CINCLUDES-y += -I$(UK_PLAT_COMMON_BASE)/include -LIBKVMPLAT_SRCS-$(ARCH_X86_64) += $(UK_PLAT_COMMON_BASE)/x86/trace.c|common -LIBKVMPLAT_SRCS-$(ARCH_X86_64) += $(UK_PLAT_COMMON_BASE)/x86/traps.c|common -LIBKVMPLAT_SRCS-$(ARCH_X86_64) += $(UK_PLAT_COMMON_BASE)/x86/cpu_native.c|common -ifeq ($(HAVE_SCHED),y) -LIBKVMPLAT_SRCS-$(ARCH_X86_64) += $(UK_PLAT_COMMON_BASE)/x86/thread_start.S|common -LIBKVMPLAT_SRCS-$(ARCH_X86_64) += $(UK_PLAT_COMMON_BASE)/thread.c|common -LIBKVMPLAT_SRCS-$(ARCH_X86_64) += $(UK_PLAT_COMMON_BASE)/sw_ctx.c|common +LIBKVMPLAT_SRCS-$(CONFIG_ARCH_X86_64) += $(UK_PLAT_COMMON_BASE)/x86/trace.c|common +LIBKVMPLAT_SRCS-$(CONFIG_ARCH_X86_64) += $(UK_PLAT_COMMON_BASE)/x86/traps.c|common +LIBKVMPLAT_SRCS-$(CONFIG_ARCH_X86_64) += $(UK_PLAT_COMMON_BASE)/x86/cpu_native.c|common +ifeq ($(CONFIG_HAVE_SCHED),y) +LIBKVMPLAT_SRCS-$(CONFIG_ARCH_X86_64) += $(UK_PLAT_COMMON_BASE)/x86/thread_start.S|common +LIBKVMPLAT_SRCS-$(CONFIG_ARCH_X86_64) += $(UK_PLAT_COMMON_BASE)/thread.c|common +LIBKVMPLAT_SRCS-$(CONFIG_ARCH_X86_64) += $(UK_PLAT_COMMON_BASE)/sw_ctx.c|common endif -LIBKVMPLAT_SRCS-$(ARCH_X86_64) += $(LIBKVMPLAT_BASE)/x86/entry64.S -LIBKVMPLAT_SRCS-$(ARCH_X86_64) += $(LIBKVMPLAT_BASE)/x86/traps.c -LIBKVMPLAT_SRCS-$(ARCH_X86_64) += $(LIBKVMPLAT_BASE)/x86/cpu_vectors_x86_64.S -LIBKVMPLAT_SRCS-$(ARCH_X86_64) += $(LIBKVMPLAT_BASE)/x86/setup.c -LIBKVMPLAT_SRCS-$(ARCH_X86_64) += $(LIBKVMPLAT_BASE)/x86/console.c -LIBKVMPLAT_SRCS-$(ARCH_X86_64) += $(LIBKVMPLAT_BASE)/x86/lcpu.c -LIBKVMPLAT_SRCS-$(ARCH_X86_64) += $(LIBKVMPLAT_BASE)/x86/intctrl.c +LIBKVMPLAT_SRCS-$(CONFIG_ARCH_X86_64) += $(LIBKVMPLAT_BASE)/x86/entry64.S +LIBKVMPLAT_SRCS-$(CONFIG_ARCH_X86_64) += $(LIBKVMPLAT_BASE)/x86/traps.c +LIBKVMPLAT_SRCS-$(CONFIG_ARCH_X86_64) += $(LIBKVMPLAT_BASE)/x86/cpu_vectors_x86_64.S +LIBKVMPLAT_SRCS-$(CONFIG_ARCH_X86_64) += $(LIBKVMPLAT_BASE)/x86/setup.c +LIBKVMPLAT_SRCS-$(CONFIG_ARCH_X86_64) += $(LIBKVMPLAT_BASE)/x86/console.c +LIBKVMPLAT_SRCS-$(CONFIG_ARCH_X86_64) += $(LIBKVMPLAT_BASE)/x86/lcpu.c +LIBKVMPLAT_SRCS-$(CONFIG_ARCH_X86_64) += $(LIBKVMPLAT_BASE)/x86/intctrl.c LIBKVMPLAT_SRCS-y += $(LIBKVMPLAT_BASE)/shutdown.c LIBKVMPLAT_SRCS-y += $(LIBKVMPLAT_BASE)/memory.c LIBKVMPLAT_SRCS-y += $(LIBKVMPLAT_BASE)/irq.c diff --git a/plat/kvm/memory.c b/plat/kvm/memory.c index d2fd235..3fe1558 100644 --- a/plat/kvm/memory.c +++ b/plat/kvm/memory.c @@ -49,7 +49,7 @@ int ukplat_memregion_get(int i, struct ukplat_memregion_desc *m) m->len = (size_t) &_etext - (size_t) &_text; m->flags = (UKPLAT_MEMRF_RESERVED | UKPLAT_MEMRF_READABLE); -#if UKPLAT_MEMRNAME +#if CONFIG_UKPLAT_MEMRNAME m->name = "text"; #endif ret = 0; @@ -59,7 +59,7 @@ int ukplat_memregion_get(int i, struct ukplat_memregion_desc *m) m->len = (size_t) &_erodata - (size_t) &_rodata; m->flags = (UKPLAT_MEMRF_RESERVED | UKPLAT_MEMRF_READABLE); -#if UKPLAT_MEMRNAME +#if CONFIG_UKPLAT_MEMRNAME m->name = "rodata"; #endif ret = 0; @@ -69,7 +69,7 @@ int ukplat_memregion_get(int i, struct ukplat_memregion_desc *m) m->len = (size_t) &_ectors - (size_t) &_ctors; m->flags = (UKPLAT_MEMRF_RESERVED | UKPLAT_MEMRF_READABLE); -#if UKPLAT_MEMRNAME +#if CONFIG_UKPLAT_MEMRNAME m->name = "ctors"; #endif ret = 0; @@ -80,7 +80,7 @@ int ukplat_memregion_get(int i, struct ukplat_memregion_desc *m) m->flags = (UKPLAT_MEMRF_RESERVED | UKPLAT_MEMRF_READABLE | UKPLAT_MEMRF_WRITABLE); -#if UKPLAT_MEMRNAME +#if CONFIG_UKPLAT_MEMRNAME m->name = "data"; #endif ret = 0; @@ -91,7 +91,7 @@ int ukplat_memregion_get(int i, struct ukplat_memregion_desc *m) m->flags = (UKPLAT_MEMRF_RESERVED | UKPLAT_MEMRF_READABLE | UKPLAT_MEMRF_WRITABLE); -#if UKPLAT_MEMRNAME +#if CONFIG_UKPLAT_MEMRNAME m->name = "bss"; #endif ret = 0; @@ -101,7 +101,7 @@ int ukplat_memregion_get(int i, struct ukplat_memregion_desc *m) m->len = (size_t) _libkvmplat_stack_top - (size_t) _libkvmplat_heap_start; m->flags = UKPLAT_MEMRF_ALLOCATABLE; -#if UKPLAT_MEMRNAME +#if CONFIG_UKPLAT_MEMRNAME m->name = "heap"; #endif ret = 0; @@ -114,7 +114,7 @@ int ukplat_memregion_get(int i, struct ukplat_memregion_desc *m) | UKPLAT_MEMRF_READABLE | UKPLAT_MEMRF_WRITABLE); ret = 0; -#if UKPLAT_MEMRNAME +#if CONFIG_UKPLAT_MEMRNAME m->name = "bstack"; #endif break; @@ -122,7 +122,7 @@ int ukplat_memregion_get(int i, struct ukplat_memregion_desc *m) m->base = __NULL; m->len = 0; m->flags = 0x0; -#if UKPLAT_MEMRNAME +#if CONFIG_UKPLAT_MEMRNAME m->name = __NULL; #endif ret = -1; diff --git a/plat/kvm/x86/setup.c b/plat/kvm/x86/setup.c index f1196ef..d4348a4 100644 --- a/plat/kvm/x86/setup.c +++ b/plat/kvm/x86/setup.c @@ -73,7 +73,7 @@ static inline void _mb_get_cmdline(struct multiboot_info *mi, char *cmdline, : (maxlen - 1)] = '\0'; } else { uk_printd(DLVL_INFO, "No command line found\n"); - strcpy(cmdline, UK_NAME); + strcpy(cmdline, CONFIG_UK_NAME); } } diff --git a/plat/linuxu/Linker.uk b/plat/linuxu/Linker.uk index d50401f..abef585 100644 --- a/plat/linuxu/Linker.uk +++ b/plat/linuxu/Linker.uk @@ -3,26 +3,26 @@ LINUXU_LDFLAGS-y += -Wl,-e,_liblinuxuplat_start ## ## Link image ## -LINUXU_IMAGE := $(BUILD_DIR)/$(UK_NAME)_linuxu-$(UK_ARCH) +LINUXU_IMAGE := $(BUILD_DIR)/$(CONFIG_UK_NAME)_linuxu-$(CONFIG_UK_ARCH) $(LINUXU_IMAGE): $(LINUXU_LINK) $(LINUXU_LINK-y) $(UK_LINK) $(UK_LINK-y) $(call build_cmd,LD,,$@,\ $(LD) $(LDFLAGS) $(LDFLAGS-y) $(LINUXU_LDFLAGS) $(LINUXU_LDFLAGS-y) $^ -o $@) -ifeq ($(OPTIMIZE_DBGFILE),y) +ifeq ($(CONFIG_OPTIMIZE_DBGFILE),y) $(call build_cmd,OBJCOPY,,$@.dbg,\ $(OBJCOPY) --only-keep-debug $@ $@.dbg) endif -ifeq ($(OPTIMIZE_SYMFILE),y) +ifeq ($(CONFIG_OPTIMIZE_SYMFILE),y) $(call build_cmd,NM,,$@.sym,\ $(NM) -n $@ > $@.sym) endif -ifeq ($(OPTIMIZE_STRIP),y) +ifeq ($(CONFIG_OPTIMIZE_STRIP),y) $(call verbose_cmd,STRIP,$(notdir $@),\ $(STRIP) -s $@) endif # register image to the build -UK_IMAGES-$(PLAT_LINUXU) += $(LINUXU_IMAGE) +UK_IMAGES-$(CONFIG_PLAT_LINUXU) += $(LINUXU_IMAGE) # ...for cleaning: LIBLINUXUPLAT_CLEAN += $(call build_clean,$(LINUXU_IMAGE)) diff --git a/plat/linuxu/Makefile.uk b/plat/linuxu/Makefile.uk index 38f92ac..8d79fd7 100644 --- a/plat/linuxu/Makefile.uk +++ b/plat/linuxu/Makefile.uk @@ -1,7 +1,7 @@ ## ## Linux user platform registration ## -$(eval $(call addplat_s,linuxu,$(PLAT_LINUXU))) +$(eval $(call addplat_s,linuxu,$(CONFIG_PLAT_LINUXU))) ## ## Linux user platform library registration @@ -14,8 +14,8 @@ $(eval $(call addplatlib,linuxu,liblinuxuplat)) LIBLINUXUPLAT_CINCLUDES-y += -I$(LIBLINUXUPLAT_BASE)/include LIBLINUXUPLAT_SRCS-$(ARCH_X86_32) += $(LIBLINUXUPLAT_BASE)/x86/entry32.S -LIBLINUXUPLAT_SRCS-$(ARCH_X86_64) += $(LIBLINUXUPLAT_BASE)/x86/entry64.S -LIBLINUXUPLAT_SRCS-$(ARCH_ARM_32) += $(LIBLINUXUPLAT_BASE)/arm/entry32.S +LIBLINUXUPLAT_SRCS-$(CONFIG_ARCH_X86_64) += $(LIBLINUXUPLAT_BASE)/x86/entry64.S +LIBLINUXUPLAT_SRCS-$(CONFIG_ARCH_ARM_32) += $(LIBLINUXUPLAT_BASE)/arm/entry32.S LIBLINUXUPLAT_SRCS-$(ARCH_ARM_64) += $(LIBLINUXUPLAT_BASE)/arm/entry64.S LIBLINUXUPLAT_SRCS-y += $(LIBLINUXUPLAT_BASE)/setup.c LIBLINUXUPLAT_SRCS-y += $(LIBLINUXUPLAT_BASE)/console.c diff --git a/plat/linuxu/memory.c b/plat/linuxu/memory.c index f0f3d7e..b7dbc43 100644 --- a/plat/linuxu/memory.c +++ b/plat/linuxu/memory.c @@ -52,7 +52,7 @@ int ukplat_memregion_get(int i, struct ukplat_memregion_desc *m) m->base = _liblinuxuplat_opts.heap.base; m->len = _liblinuxuplat_opts.heap.len; m->flags = UKPLAT_MEMRF_ALLOCATABLE; -#if UKPLAT_MEMRNAME +#if CONFIG_UKPLAT_MEMRNAME m->name = "heap"; #endif ret = 0; @@ -61,7 +61,7 @@ int ukplat_memregion_get(int i, struct ukplat_memregion_desc *m) m->base = __NULL; m->len = 0; m->flags = 0x0; -#if UKPLAT_MEMRNAME +#if CONFIG_UKPLAT_MEMRNAME m->name = __NULL; #endif ret = -1; diff --git a/plat/linuxu/setup.c b/plat/linuxu/setup.c index 95b7d02..acb67d2 100644 --- a/plat/linuxu/setup.c +++ b/plat/linuxu/setup.c @@ -87,7 +87,7 @@ static int parseopts(int argc, char *argv[], struct liblinuxuplat_opts *opts) * Clear & set default options */ memset(opts, 0, sizeof(*opts)); - _liblinuxuplat_opts.heap.len = (size_t)(LINUXU_DEFAULT_HEAPMB) + _liblinuxuplat_opts.heap.len = (size_t)(CONFIG_LINUXU_DEFAULT_HEAPMB) * 1024 * 1024; /* diff --git a/plat/xen/Linker.uk b/plat/xen/Linker.uk index 3890196..e3f5a9a 100644 --- a/plat/xen/Linker.uk +++ b/plat/xen/Linker.uk @@ -1,40 +1,40 @@ -ifeq (x86_64,$(UK_ARCH)) -XEN_LDSCRIPT := -Wl,-T,$(UK_BASE)/plat/xen/x86/link64.ld +ifeq (x86_64,$(CONFIG_UK_ARCH)) +XEN_LDSCRIPT := -Wl,-T,$(CONFIG_UK_BASE)/plat/xen/x86/link64.ld XEN_LDFLAGS-y += -Wl,-m,elf_x86_64 endif -ifeq (x86_32,$(UK_ARCH)) -XEN_LDSCRIPT := -Wl,-T,$(UK_BASE)/plat/xen/x86/link32.ld +ifeq (x86_32,$(CONFIG_UK_ARCH)) +XEN_LDSCRIPT := -Wl,-T,$(CONFIG_UK_BASE)/plat/xen/x86/link32.ld XEN_LDFLAGS-y += -Wl,-m,elf_x86_32 endif -ifeq (arm_64,$(UK_ARCH)) -XEN_LDSCRIPT := -Wl,-T,$(UK_BASE)/plat/xen/arm/link64.ld +ifeq (arm_64,$(CONFIG_UK_ARCH)) +XEN_LDSCRIPT := -Wl,-T,$(CONFIG_UK_BASE)/plat/xen/arm/link64.ld endif -ifeq (arm,$(UK_ARCH)) -XEN_LDSCRIPT := -Wl,-T,$(UK_BASE)/plat/xen/arm/link32.ld +ifeq (arm,$(CONFIG_UK_ARCH)) +XEN_LDSCRIPT := -Wl,-T,$(CONFIG_UK_BASE)/plat/xen/arm/link32.ld endif ## ## Link image ## -XEN_IMAGE := $(BUILD_DIR)/$(UK_NAME)_xen-$(UK_ARCH) +XEN_IMAGE := $(BUILD_DIR)/$(CONFIG_UK_NAME)_xen-$(CONFIG_UK_ARCH) $(XEN_IMAGE): $(XEN_LINK) $(XEN_LINK-y) $(UK_LINK) $(UK_LINK-y) $(call build_cmd,LD,,$@.ld.o,\ $(LD) -r $(LIBLDFLAGS) $(LIBLDFLAGS-y) $(XEN_LDFLAGS) $(XEN_LDFLAGS-y) $^ -o $@.ld.o) $(call build_cmd,OBJCOPY,,$@.o,\ $(OBJCOPY) -w -G xenos_* -G _libxenplat_start $@.ld.o $@.o) -ifeq (arm,$(UK_ARCH)) +ifeq (arm,$(CONFIG_UK_ARCH)) $(call build_cmd,LD,,$@.elf,\ $(LD) $(LDFLAGS) $(LDFLAGS-y) $(XEN_LDFLAGS) $(XEN_LDFLAGS-y) $(XEN_LDSCRIPT) $@.o -o $@.elf) -ifeq ($(OPTIMIZE_DBGFILE),y) +ifeq ($(CONFIG_OPTIMIZE_DBGFILE),y) $(call build_cmd,OBJCOPY,,$@.dbg,\ $(OBJCOPY) --only-keep-debug $@.elf $@.dbg) endif -ifeq ($(OPTIMIZE_SYMFILE),y) +ifeq ($(CONFIG_OPTIMIZE_SYMFILE),y) $(call build_cmd,NM,,$@.sym,\ $(NM) -n $@.elf > $@.sym) endif -ifeq ($(OPTIMIZE_STRIP),y) +ifeq ($(CONFIG_OPTIMIZE_STRIP),y) $(call verbose_cmd,STRIP,$(notdir $@),\ $(STRIP) -s $@.elf) endif @@ -45,15 +45,15 @@ endif else $(call build_cmd,LD,,$@,\ $(LD) $(LDFLAGS) $(LDFLAGS-y) $(XEN_LDFLAGS) $(XEN_LDFLAGS-y) $(XEN_LDSCRIPT) $@.o -o $@) -ifeq ($(OPTIMIZE_DBGFILE),y) +ifeq ($(CONFIG_OPTIMIZE_DBGFILE),y) $(call build_cmd,OBJCOPY,,$@.dbg,\ $(OBJCOPY) --only-keep-debug $@ $@.dbg) endif -ifeq ($(OPTIMIZE_SYMFILE),y) +ifeq ($(CONFIG_OPTIMIZE_SYMFILE),y) $(call build_cmd,NM,,$@.sym,\ $(NM) -n $@ > $@.sym) endif -ifeq ($(OPTIMIZE_STRIP),y) +ifeq ($(CONFIG_OPTIMIZE_STRIP),y) $(call verbose_cmd,STRIP,$(notdir $@),\ $(STRIP) -s $@) endif @@ -62,7 +62,7 @@ endif endif # register image to the build -UK_IMAGES-$(PLAT_XEN) += $(XEN_IMAGE) +UK_IMAGES-$(CONFIG_PLAT_XEN) += $(XEN_IMAGE) # ...for cleaning: LIBXENPLAT_CLEAN += $(call build_clean,$(XEN_IMAGE).ld.o) diff --git a/plat/xen/Makefile.uk b/plat/xen/Makefile.uk index 4a2f9bf..1341da8 100644 --- a/plat/xen/Makefile.uk +++ b/plat/xen/Makefile.uk @@ -3,7 +3,7 @@ XEN_INTERFACE_VERSION := 0x00030205 ## ## Xen platform registration ## -$(eval $(call addplat_s,xen,$(PLAT_XEN))) +$(eval $(call addplat_s,xen,$(CONFIG_PLAT_XEN))) ## ## Xen platform library registration @@ -29,18 +29,18 @@ LIBXENPLAT_SRCS-y += $(LIBXENPLAT_BASE)/hypervisor.c LIBXENPLAT_SRCS-y += $(LIBXENPLAT_BASE)/memory.c LIBXENPLAT_SRCS-y += $(UK_PLAT_COMMON_BASE)/lcpu.c|common -ifneq (,$(filter x86_32 x86_64,$(UK_ARCH))) -LIBXENPLAT_SRCS-$(ARCH_X86_64) += $(UK_PLAT_COMMON_BASE)/x86/trace.c|common -LIBXENPLAT_SRCS-$(ARCH_X86_64) += $(UK_PLAT_COMMON_BASE)/x86/traps.c|common -ifeq ($(HAVE_SCHED),y) -LIBXENPLAT_SRCS-$(ARCH_X86_64) += $(UK_PLAT_COMMON_BASE)/x86/thread_start.S|common -LIBXENPLAT_SRCS-$(ARCH_X86_64) += $(UK_PLAT_COMMON_BASE)/thread.c|common -LIBXENPLAT_SRCS-$(ARCH_X86_64) += $(UK_PLAT_COMMON_BASE)/sw_ctx.c|common +ifneq (,$(filter x86_32 x86_64,$(CONFIG_UK_ARCH))) +LIBXENPLAT_SRCS-$(CONFIG_ARCH_X86_64) += $(UK_PLAT_COMMON_BASE)/x86/trace.c|common +LIBXENPLAT_SRCS-$(CONFIG_ARCH_X86_64) += $(UK_PLAT_COMMON_BASE)/x86/traps.c|common +ifeq ($(CONFIG_HAVE_SCHED),y) +LIBXENPLAT_SRCS-$(CONFIG_ARCH_X86_64) += $(UK_PLAT_COMMON_BASE)/x86/thread_start.S|common +LIBXENPLAT_SRCS-$(CONFIG_ARCH_X86_64) += $(UK_PLAT_COMMON_BASE)/thread.c|common +LIBXENPLAT_SRCS-$(CONFIG_ARCH_X86_64) += $(UK_PLAT_COMMON_BASE)/sw_ctx.c|common endif LIBXENPLAT_SRCS-y += $(LIBXENPLAT_BASE)/x86/setup.c LIBXENPLAT_SRCS-y += $(LIBXENPLAT_BASE)/x86/traps.c LIBXENPLAT_SRCS-$(ARCH_X86_32) += $(LIBXENPLAT_BASE)/x86/entry32.S -LIBXENPLAT_SRCS-$(ARCH_X86_64) += $(LIBXENPLAT_BASE)/x86/entry64.S +LIBXENPLAT_SRCS-$(CONFIG_ARCH_X86_64) += $(LIBXENPLAT_BASE)/x86/entry64.S LIBXENPLAT_SRCS-y += $(LIBXENPLAT_BASE)/x86/mm.c LIBXENPLAT_SRCS-y += $(LIBXENPLAT_BASE)/x86/arch_events.c LIBXENPLAT_SRCS-y += $(LIBXENPLAT_BASE)/x86/arch_time.c @@ -54,14 +54,14 @@ LIBXENPLAT_SRCS-y += $(UK_PLAT_COMMON_BASE)/x86/cpu_native.c endif endif -ifneq (,$(filter arm arm_64,$(UK_ARCH))) +ifneq (,$(filter arm arm_64,$(CONFIG_UK_ARCH))) LIBXENPLAT_SRCS-y += $(LIBXENPLAT_BASE)/arm/setup.c LIBXENPLAT_SRCS-y += $(LIBXENPLAT_BASE)/arm/traps.c -LIBXENPLAT_SRCS-$(ARCH_ARM_32) += $(LIBXENPLAT_BASE)/arm/entry32.S +LIBXENPLAT_SRCS-$(CONFIG_ARCH_ARM_32) += $(LIBXENPLAT_BASE)/arm/entry32.S LIBXENPLAT_SRCS-$(ARCH_ARM_64) += $(LIBXENPLAT_BASE)/arm/entry64.S LIBXENPLAT_SRCS-y += $(LIBXENPLAT_BASE)/arm/arch_events.c LIBXENPLAT_SRCS-y += $(LIBXENPLAT_BASE)/arm/arch_time.c -LIBXENPLAT_SRCS-$(ARCH_ARM_32) += $(LIBXENPLAT_BASE)/arm/hypercalls32.S +LIBXENPLAT_SRCS-$(CONFIG_ARCH_ARM_32) += $(LIBXENPLAT_BASE)/arm/hypercalls32.S LIBXENPLAT_SRCS-$(ARCH_ARM_64) += $(LIBXENPLAT_BASE)/arm/hypercalls64.S endif diff --git a/plat/xen/arm/setup.c b/plat/xen/arm/setup.c index c247db5..5a055f3 100644 --- a/plat/xen/arm/setup.c +++ b/plat/xen/arm/setup.c @@ -100,7 +100,7 @@ static inline void _dtb_get_cmdline(char *cmdline, size_t maxlen) enocmdl: uk_printd(DLVL_INFO, "No command line found\n"); - strcpy(cmdline, UK_NAME); + strcpy(cmdline, CONFIG_UK_NAME); } static inline void _dtb_init_mem(uint32_t physical_offset) @@ -172,7 +172,7 @@ static inline void _dtb_init_mem(uint32_t physical_offset) _libxenplat_mrd[0].len = (size_t) to_virt(max_pfn_p << __PAGE_SHIFT) - (size_t) to_virt(start_pfn_p << __PAGE_SHIFT); _libxenplat_mrd[0].flags = (UKPLAT_MEMRF_ALLOCATABLE); -#if UKPLAT_MEMRNAME +#if CONFIG_UKPLAT_MEMRNAME _libxenplat_mrd[0].name = "heap"; #endif /* dtb */ @@ -180,7 +180,7 @@ static inline void _dtb_init_mem(uint32_t physical_offset) _libxenplat_mrd[1].len = fdt_size; _libxenplat_mrd[1].flags = (UKPLAT_MEMRF_RESERVED | UKPLAT_MEMRF_READABLE); -#if UKPLAT_MEMRNAME +#if CONFIG_UKPLAT_MEMRNAME _libxenplat_mrd[1].name = "dtb"; #endif _libxenplat_mrd_num = 2; @@ -205,7 +205,7 @@ void _libxenplat_armentry(void *dtb_pointer, uint32_t physical_offset) _dtb_get_cmdline(cmdline, sizeof(cmdline)); - ukplat_entry_argp(UK_NAME, cmdline, sizeof(cmdline)); + ukplat_entry_argp(CONFIG_UK_NAME, cmdline, sizeof(cmdline)); } void _libxenplat_armpanic(int *saved_regs) __noreturn; diff --git a/plat/xen/console.c b/plat/xen/console.c index fa74e8a..2c3ce5a 100644 --- a/plat/xen/console.c +++ b/plat/xen/console.c @@ -121,7 +121,7 @@ void _libxenplat_prepare_console(void) } #endif -#if XEN_DBGEMERGENCY +#if CONFIG_XEN_DBGEMERGENCY static int emergency_output(const char *str, unsigned int len) { int rc; @@ -229,7 +229,7 @@ int ukplat_coutd(const char *str, unsigned int len) if (unlikely(len == 0)) len = strnlen(str, len); -#if XEN_DBGEMERGENCY +#if CONFIG_XEN_DBGEMERGENCY return emergency_output(str, len); #else return hvconsole_output(str, len); diff --git a/plat/xen/include/xen-x86/mm.h b/plat/xen/include/xen-x86/mm.h index 9bb4880..a1dbb26 100644 --- a/plat/xen/include/xen-x86/mm.h +++ b/plat/xen/include/xen-x86/mm.h @@ -144,7 +144,7 @@ typedef unsigned long pgentry_t; #endif -#ifndef HAVE_LIBC +#ifndef CONFIG_HAVE_LIBC #define HEAP_PAGES 0 #else #define HEAP_PAGES HEAP_PAGES_MAX diff --git a/plat/xen/memory.c b/plat/xen/memory.c index df56616..18df5da 100644 --- a/plat/xen/memory.c +++ b/plat/xen/memory.c @@ -60,7 +60,7 @@ int ukplat_memregion_get(int i, struct ukplat_memregion_desc *m) m->len = (size_t) &_etext - (size_t) &_text; m->flags = (UKPLAT_MEMRF_RESERVED | UKPLAT_MEMRF_READABLE); -#if UKPLAT_MEMRNAME +#if CONFIG_UKPLAT_MEMRNAME m->name = "text"; #endif break; @@ -69,7 +69,7 @@ int ukplat_memregion_get(int i, struct ukplat_memregion_desc *m) m->len = (size_t) &_erodata - (size_t) &_rodata; m->flags = (UKPLAT_MEMRF_RESERVED | UKPLAT_MEMRF_READABLE); -#if UKPLAT_MEMRNAME +#if CONFIG_UKPLAT_MEMRNAME m->name = "rodata"; #endif break; @@ -78,7 +78,7 @@ int ukplat_memregion_get(int i, struct ukplat_memregion_desc *m) m->len = (size_t) &_ectors - (size_t) &_ctors; m->flags = (UKPLAT_MEMRF_RESERVED | UKPLAT_MEMRF_READABLE); -#if UKPLAT_MEMRNAME +#if CONFIG_UKPLAT_MEMRNAME m->name = "ctors"; #endif break; @@ -88,7 +88,7 @@ int ukplat_memregion_get(int i, struct ukplat_memregion_desc *m) m->flags = (UKPLAT_MEMRF_RESERVED | UKPLAT_MEMRF_READABLE | UKPLAT_MEMRF_WRITABLE); -#if UKPLAT_MEMRNAME +#if CONFIG_UKPLAT_MEMRNAME m->name = "data"; #endif break; @@ -98,7 +98,7 @@ int ukplat_memregion_get(int i, struct ukplat_memregion_desc *m) m->flags = (UKPLAT_MEMRF_RESERVED | UKPLAT_MEMRF_READABLE | UKPLAT_MEMRF_WRITABLE); -#if UKPLAT_MEMRNAME +#if CONFIG_UKPLAT_MEMRNAME m->name = "bss"; #endif break; @@ -107,7 +107,7 @@ int ukplat_memregion_get(int i, struct ukplat_memregion_desc *m) m->base = __NULL; m->len = 0; m->flags = 0x0; -#if UKPLAT_MEMRNAME +#if CONFIG_UKPLAT_MEMRNAME m->name = __NULL; #endif return -1; diff --git a/plat/xen/x86/setup.c b/plat/xen/x86/setup.c index 8885415..ad603de 100644 --- a/plat/xen/x86/setup.c +++ b/plat/xen/x86/setup.c @@ -162,7 +162,7 @@ static inline void _init_mem(void) _libxenplat_mrd[0].len = (size_t) to_virt(max_pfn << __PAGE_SHIFT) - (size_t) to_virt(start_pfn << __PAGE_SHIFT); _libxenplat_mrd[0].flags = (UKPLAT_MEMRF_ALLOCATABLE); -#if UKPLAT_MEMRNAME +#if CONFIG_UKPLAT_MEMRNAME _libxenplat_mrd[0].name = "heap"; #endif _libxenplat_mrd_num = 1; @@ -195,5 +195,5 @@ void _libxenplat_x86entry(void *start_info) _libxenplat_init_console(); - ukplat_entry_argp(UK_NAME, cmdline, MAX_CMDLINE_SIZE); + ukplat_entry_argp(CONFIG_UK_NAME, cmdline, MAX_CMDLINE_SIZE); } diff --git a/support/build/Makefile.rules b/support/build/Makefile.rules index cebdd12..e317e3d 100644 --- a/support/build/Makefile.rules +++ b/support/build/Makefile.rules @@ -169,12 +169,12 @@ endif # Calls a command that creates an object # # build_cmd $quietlabel,$libname(optional),$target,$command -ifeq ($(RECORD_BUILDTIME_TIME),y) +ifeq ($(CONFIG_RECORD_BUILDTIME_TIME),y) define build_cmd = $(call verbose_cmd,$(1),$(if $(2),$(2)':' ,)$(notdir $(3)),$(TIME) $(TIMEFLAGS) -o $(addsuffix .time,$(3)) $(4)) endef else -ifeq ($(RECORD_BUILDTIME_LIFTOFF),y) +ifeq ($(CONFIG_RECORD_BUILDTIME_LIFTOFF),y) define build_cmd = $(call verbose_cmd,$(1),$(if $(2),$(2)':' ,)$(notdir $(3)),$(LIFTOFF) $(LITFOFFFLAGS) -o $(addsuffix .liftoff,$(3)) -- $(4)) endef @@ -188,10 +188,10 @@ endif # Returns a list of files to be cleaned when build_cmd was used # # build_clean $target -ifeq ($(RECORD_BUILDTIME_TIME),y) +ifeq ($(CONFIG_RECORD_BUILDTIME_TIME),y) build_clean = $(1) $(addsuffix .time,$(1)) else -ifeq ($(RECORD_BUILDTIME_LIFTOFF),y) +ifeq ($(CONFIG_RECORD_BUILDTIME_LIFTOFF),y) build_clean = $(1) $(addsuffix .liftoff,$(1)) else build_clean = $(1) -- 2.17.0 _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |