Adapt base-codezero to new ports mechanism

Fixes #1425
This commit is contained in:
Norman Feske 2015-03-02 12:16:36 +01:00
parent 54ef87c979
commit f9269f5cb1
14 changed files with 58 additions and 125 deletions

View File

@ -4,51 +4,22 @@
# \date 2011-08-05 # \date 2011-08-05
# #
VERBOSE ?= @ VERBOSE ?= @
ECHO = @echo ECHO := @echo
GIT_URL = https://github.com/nfeske/codezero.git
GIT_REV = 6fa4884a5a1cf6207372f69ae01e5faa6d5a39c8
CONTRIB_DIR = contrib
PATCHES = $(shell find patches -name *.patch)
#
# Utility to check if a tool is installed
#
check_tool = $(if $(shell which $(1)),,$(error Need to have '$(1)' installed.))
$(call check_tool,git)
$(call check_tool,patch)
$(call check_tool,python2.6)
$(call check_tool,scons)
# #
# Print help information by default # Print help information by default
# #
help:: help::
prepare: $(CONTRIB_DIR) prepare:
$(VERBOSE)../../tool/ports/prepare_port codezero
help:: help::
$(ECHO) $(ECHO)
$(ECHO) "Check out upstream source code of the Codezero kernel" $(ECHO) "Prepare the codezero base repository"
$(ECHO)
$(ECHO) "The source code will be located at the '$(CONTRIB_DIR)/' directory."
$(ECHO) $(ECHO)
$(ECHO) "--- available commands ---" $(ECHO) "--- available commands ---"
$(ECHO) "prepare - checkout upstream source codes" $(ECHO) "prepare - checkout upstream source codes"
$(ECHO) "clean - remove upstream source codes" $(ECHO) "clean - remove upstream source codes"
$(ECHO) $(ECHO)
$(CONTRIB_DIR)/.git:
$(VERBOSE)git clone $(GIT_URL) $(CONTRIB_DIR)
$(CONTRIB_DIR): $(CONTRIB_DIR)/.git
$(VERBOSE)cd $(CONTRIB_DIR); git reset --hard $(GIT_REV)
$(ECHO) "applying patches to '$(CONTRIB_DIR)/'"
$(VERBOSE)for i in $(PATCHES); do patch -d $@ -p1 < $$i; done
.PHONY: $(CONTRIB_DIR)
clean::
$(VERBOSE)rm -rf $(CONTRIB_DIR)

View File

@ -1,3 +1,5 @@
CODEZERO_DIR := $(call select_from_ports,codezero)/src/kernel/codezero
LIBL4_DIR = $(CODEZERO_DIR)/conts/userlibs/libl4 LIBL4_DIR = $(CODEZERO_DIR)/conts/userlibs/libl4
INC_DIR += $(CODEZERO_DIR)/conts/userlibs/libc/include INC_DIR += $(CODEZERO_DIR)/conts/userlibs/libc/include

View File

@ -1,3 +1,5 @@
CODEZERO_DIR := $(call select_from_ports,codezero)/src/kernel/codezero
LIBL4_DIR = $(CODEZERO_DIR)/conts/userlibs/libl4 LIBL4_DIR = $(CODEZERO_DIR)/conts/userlibs/libl4
SRC_C += init.c irq.c mutex.c SRC_C += init.c irq.c mutex.c

View File

@ -2,17 +2,7 @@
# Specifics for the Codezero kernel API # Specifics for the Codezero kernel API
# #
# CODEZERO_DIR := $(call select_from_ports,codezero)/src/kernel/codezero
# Read default and builddir-specific config files
#
# In these config files, we expect to find the definition of CODEZERO_DIR
#
-include $(call select_from_repositories,etc/codezero.conf)
-include $(BUILD_BASE_DIR)/etc/codezero.conf
ifeq ($(CODEZERO_DIR),)
$(error Could not find the definition of CODEZERO_DIR in etc/codezero.conf)
endif
# #
# Convert path to absolute directory # Convert path to absolute directory
@ -28,11 +18,9 @@ INC_DIR += $(BUILD_BASE_DIR)/include
# #
# Codezero headers # Codezero headers
# #
CODEZERO_ABS_DIR = $(call absdir,$(CODEZERO_DIR)) INC_DIR += $(CODEZERO_DIR)/include
INC_DIR += $(CODEZERO_DIR)/conts/userlibs/libl4/include
INC_DIR += $(CODEZERO_ABS_DIR)/include INC_DIR += $(CODEZERO_DIR)/conts/userlibs/libdev/uart/include
INC_DIR += $(CODEZERO_ABS_DIR)/conts/userlibs/libl4/include
INC_DIR += $(CODEZERO_ABS_DIR)/conts/userlibs/libdev/uart/include
# #
# Allow programs to test for the Codezero kernel # Allow programs to test for the Codezero kernel

View File

@ -1,7 +1,5 @@
diff --git a/src/arch/arm/vectors.S b/src/arch/arm/vectors.S --- src/kernel/codezero/src/arch/arm/vectors.S
index 0475389..62f3c38 100644 +++ src/kernel/codezero/src/arch/arm/vectors.S
--- a/src/arch/arm/vectors.S
+++ b/src/arch/arm/vectors.S
@@ -503,7 +503,7 @@ BEGIN_PROC(arm_irq_exception_basic) @@ -503,7 +503,7 @@ BEGIN_PROC(arm_irq_exception_basic)
mov lr, pc mov lr, pc
ldr pc, =do_irq ldr pc, =do_irq
@ -11,20 +9,16 @@ index 0475389..62f3c38 100644
/* Minimal IRQ state saved on irq stack right after irq vector enters: */ /* Minimal IRQ state saved on irq stack right after irq vector enters: */
#define IRQ_R0 0 #define IRQ_R0 0
diff --git a/conts/userlibs/libc/src/arch-arm/memcpy.S b/conts/userlibs/libc/src/arch-arm/memcpy.S --- src/kernel/codezero/conts/userlibs/libc/src/arch-arm/memcpy.S
index 383f5d2..b4df27f 100644 +++ src/kernel/codezero/conts/userlibs/libc/src/arch-arm/memcpy.S
--- a/conts/userlibs/libc/src/arch-arm/memcpy.S
+++ b/conts/userlibs/libc/src/arch-arm/memcpy.S
@@ -57,4 +57,4 @@ BEGIN_PROC(memcpy) @@ -57,4 +57,4 @@ BEGIN_PROC(memcpy)
bne last bne last
1: 1:
pop {r0, r4 - r11, pc} pop {r0, r4 - r11, pc}
-END_PROC(_memcpy) -END_PROC(_memcpy)
+END_PROC(memcpy) +END_PROC(memcpy)
diff --git a/conts/userlibs/libc/src/arch-arm/memset.S b/conts/userlibs/libc/src/arch-arm/memset.S --- src/kernel/codezero/conts/userlibs/libc/src/arch-arm/memset.S
index ce9b06c..3746955 100644 +++ src/kernel/codezero/conts/userlibs/libc/src/arch-arm/memset.S
--- a/conts/userlibs/libc/src/arch-arm/memset.S
+++ b/conts/userlibs/libc/src/arch-arm/memset.S
@@ -65,4 +65,4 @@ BEGIN_PROC(memset) @@ -65,4 +65,4 @@ BEGIN_PROC(memset)
bne end bne end

View File

@ -1,7 +1,5 @@
diff --git a/src/api/map.c b/src/api/map.c --- src/kernel/codezero/src/api/map.c
index 1d15086..6139b4c 100644 +++ src/kernel/codezero/src/api/map.c
--- a/src/api/map.c
+++ b/src/api/map.c
@@ -78,6 +78,6 @@ int sys_unmap(unsigned long virtual, unsigned long npages, unsigned int tid) @@ -78,6 +78,6 @@ int sys_unmap(unsigned long virtual, unsigned long npages, unsigned int tid)
retval = ret; retval = ret;
} }
@ -10,10 +8,8 @@ index 1d15086..6139b4c 100644
+ return retval; + return retval;
} }
diff --git a/src/api/thread.c b/src/api/thread.c --- src/kernel/codezero/src/api/thread.c
index 985c425..579e4fb 100644 +++ src/kernel/codezero/src/api/thread.c
--- a/src/api/thread.c
+++ b/src/api/thread.c
@@ -497,7 +497,7 @@ out_err: @@ -497,7 +497,7 @@ out_err:
*/ */
int sys_thread_control(unsigned int flags, struct task_ids *ids) int sys_thread_control(unsigned int flags, struct task_ids *ids)
@ -32,10 +28,8 @@ index 985c425..579e4fb 100644
/* /*
* Caller may operate on a thread if it shares * Caller may operate on a thread if it shares
* the same address space with that thread's pager * the same address space with that thread's pager
diff --git a/src/arch/arm/mapping-common.c b/src/arch/arm/mapping-common.c --- src/kernel/codezero/src/arch/arm/mapping-common.c
index 385f7c2..55b4bea 100644 +++ src/kernel/codezero/src/arch/arm/mapping-common.c
--- a/src/arch/arm/mapping-common.c
+++ b/src/arch/arm/mapping-common.c
@@ -313,12 +313,11 @@ int check_mapping(unsigned long vaddr, unsigned long size, @@ -313,12 +313,11 @@ int check_mapping(unsigned long vaddr, unsigned long size,
int remove_mapping_space(struct address_space *space, unsigned long vaddr) int remove_mapping_space(struct address_space *space, unsigned long vaddr)
{ {
@ -50,10 +44,8 @@ index 385f7c2..55b4bea 100644
pmd_i = PMD_INDEX(vaddr); pmd_i = PMD_INDEX(vaddr);
/* /*
diff --git a/src/glue/arm/init.c b/src/glue/arm/init.c --- src/kernel/codezero/src/glue/arm/init.c
index 2373c66..43c6fda 100644 +++ src/kernel/codezero/src/glue/arm/init.c
--- a/src/glue/arm/init.c
+++ b/src/glue/arm/init.c
@@ -68,8 +68,6 @@ void print_sections(void) @@ -68,8 +68,6 @@ void print_sections(void)
/* The kip is non-standard, using 0xBB to indicate mine for now ;-) */ /* The kip is non-standard, using 0xBB to indicate mine for now ;-) */
void kip_init() void kip_init()
@ -73,10 +65,8 @@ index 2373c66..43c6fda 100644
add_boot_mapping(virt_to_phys(&kip), USER_KIP_PAGE, PAGE_SIZE, add_boot_mapping(virt_to_phys(&kip), USER_KIP_PAGE, PAGE_SIZE,
MAP_USR_RO); MAP_USR_RO);
printk("%s: Kernel built on %s, %s\n", __KERNELNAME__, printk("%s: Kernel built on %s, %s\n", __KERNELNAME__,
diff --git a/loader/libs/elf/src/elf.c b/loader/libs/elf/src/elf.c --- src/kernel/codezero/loader/libs/elf/src/elf.c
index 4a1b5e0..f97273b 100644 +++ src/kernel/codezero/loader/libs/elf/src/elf.c
--- a/loader/libs/elf/src/elf.c
+++ b/loader/libs/elf/src/elf.c
@@ -339,16 +339,12 @@ elf_loadFile(void *elfFile, bool phys) @@ -339,16 +339,12 @@ elf_loadFile(void *elfFile, bool phys)
{ {
int i; int i;
@ -103,10 +93,8 @@ index 4a1b5e0..f97273b 100644
// Comment // Comment
printf("Copying to range from 0x%x to 0x%x of size: 0x%x\n", (unsigned int)dest, (unsigned int)dest + (unsigned int)len, (unsigned int)len); printf("Copying to range from 0x%x to 0x%x of size: 0x%x\n", (unsigned int)dest, (unsigned int)dest + (unsigned int)len, (unsigned int)len);
memcpy((void*) (uintptr_t) dest, (void*) (uintptr_t) src, len); memcpy((void*) (uintptr_t) dest, (void*) (uintptr_t) src, len);
diff --git a/loader/libs/elf/src/elf32.c b/loader/libs/elf/src/elf32.c --- src/kernel/codezero/loader/libs/elf/src/elf32.c
index 2d13798..78bbf33 100644 +++ src/kernel/codezero/loader/libs/elf/src/elf32.c
--- a/loader/libs/elf/src/elf32.c
+++ b/loader/libs/elf/src/elf32.c
@@ -248,7 +248,6 @@ elf32_fprintf(FILE *f, struct Elf32_Header *file, int size, const char *name, in @@ -248,7 +248,6 @@ elf32_fprintf(FILE *f, struct Elf32_Header *file, int size, const char *name, in
struct Elf32_Shdr *sections; struct Elf32_Shdr *sections;
unsigned numSections; unsigned numSections;
@ -123,10 +111,8 @@ index 2d13798..78bbf33 100644
printf("Section Headers:\n"); printf("Section Headers:\n");
printf(" [Nr] Name Type Addr Off\n"); printf(" [Nr] Name Type Addr Off\n");
diff --git a/src/generic/capability.c b/src/generic/capability.c --- src/kernel/codezero/src/generic/capability.c
index 0860ea5..ef44445 100644 +++ src/kernel/codezero/src/generic/capability.c
--- a/src/generic/capability.c
+++ b/src/generic/capability.c
@@ -403,7 +403,7 @@ struct capability *cap_match_mem(struct capability *cap, @@ -403,7 +403,7 @@ struct capability *cap_match_mem(struct capability *cap,
{ {
struct sys_map_args *args = args_ptr; struct sys_map_args *args = args_ptr;
@ -144,10 +130,8 @@ index 0860ea5..ef44445 100644
pfn_point = pfn; pfn_point = pfn;
if (start > pfn_point || cap->end < pfn_point + args->npages) if (start > pfn_point || cap->end < pfn_point + args->npages)
return 0; return 0;
diff --git a/loader/main.c b/loader/main.c --- src/kernel/codezero/loader/main.c
index 7d21a4c..8d7d6db 100644 +++ src/kernel/codezero/loader/main.c
--- a/loader/main.c
+++ b/loader/main.c
@@ -26,7 +26,6 @@ int load_elf_image(unsigned long **entry, void *filebuf); @@ -26,7 +26,6 @@ int load_elf_image(unsigned long **entry, void *filebuf);
int load_container_image(void *cont_section) int load_container_image(void *cont_section)
{ {

View File

@ -1,7 +1,5 @@
diff --git a/loader/main.c b/loader/main.c --- src/kernel/codezero/loader/main.c
index 7d21a4c..ee03918 100644 +++ src/kernel/codezero/loader/main.c
--- a/loader/main.c
+++ b/loader/main.c
@@ -135,3 +135,5 @@ int main(void) @@ -135,3 +135,5 @@ int main(void)
return -1; return -1;
} }

View File

@ -1,7 +1,5 @@
diff --git a/conts/userlibs/SConstruct b/conts/userlibs/SConstruct --- src/kernel/codezero/conts/userlibs/SConstruct
index 41c7913..421b563 100644 +++ src/kernel/codezero/conts/userlibs/SConstruct
--- a/conts/userlibs/SConstruct
+++ b/conts/userlibs/SConstruct
@@ -11,6 +11,7 @@ PROJRELROOT = '../..' @@ -11,6 +11,7 @@ PROJRELROOT = '../..'
sys.path.append(PROJRELROOT) sys.path.append(PROJRELROOT)

View File

@ -1,7 +1,5 @@
diff --git a/src/drivers/SConscript b/src/drivers/SConscript --- src/kernel/codezero/src/drivers/SConscript
index eedb59f..8f5cd5d 100644 +++ src/kernel/codezero/src/drivers/SConscript
--- a/src/drivers/SConscript
+++ b/src/drivers/SConscript
@@ -8,24 +8,24 @@ src_local = [] @@ -8,24 +8,24 @@ src_local = []
objs = [] objs = []
@ -34,10 +32,8 @@ index eedb59f..8f5cd5d 100644
+ duplicate=0, variant_dir = join(bdir, 'omap/timer')) + duplicate=0, variant_dir = join(bdir, 'omap/timer'))
Return('objs') Return('objs')
diff --git a/conts/baremetal/empty/SConstruct b/conts/baremetal/empty/SConstruct --- src/kernel/codezero/conts/baremetal/empty/SConstruct
index b70d69a..4889d8e 100644 +++ src/kernel/codezero/conts/baremetal/empty/SConstruct
--- a/conts/baremetal/empty/SConstruct
+++ b/conts/baremetal/empty/SConstruct
@@ -48,7 +48,7 @@ env = Environment(CC = config.toolchain_userspace + 'gcc', @@ -48,7 +48,7 @@ env = Environment(CC = config.toolchain_userspace + 'gcc',
CPPFLAGS = '-include l4/config.h -include l4/macros.h -include l4/types.h') CPPFLAGS = '-include l4/config.h -include l4/macros.h -include l4/types.h')
@ -47,10 +43,8 @@ index b70d69a..4889d8e 100644
Depends(objs, join(PROJROOT, CONFIG_H)) Depends(objs, join(PROJROOT, CONFIG_H))
prog = env.Program(join(builddir, 'main.elf'), objs) prog = env.Program(join(builddir, 'main.elf'), objs)
diff --git a/SConstruct b/SConstruct --- src/kernel/codezero/SConstruct
index 2abc190..58c983d 100644 +++ src/kernel/codezero/SConstruct
--- a/SConstruct
+++ b/SConstruct
@@ -71,35 +71,35 @@ env = Environment(CC = config.toolchain_kernel + 'gcc', @@ -71,35 +71,35 @@ env = Environment(CC = config.toolchain_kernel + 'gcc',
objects = [] objects = []
objects += SConscript('src/generic/SConscript', objects += SConscript('src/generic/SConscript',

View File

@ -1,7 +1,5 @@
diff --git a/include/l4/generic/tcb.h b/include/l4/generic/tcb.h --- src/kernel/codezero/include/l4/generic/tcb.h
index 7b315b8..ace38d8 100644 +++ src/kernel/codezero/include/l4/generic/tcb.h
--- a/include/l4/generic/tcb.h
+++ b/include/l4/generic/tcb.h
@@ -70,7 +70,7 @@ struct task_ids { @@ -70,7 +70,7 @@ struct task_ids {
struct container; struct container;

View File

@ -0,0 +1 @@
fb29b6a49c1e6ee759e034da8a59cf66b7ed74ef

View File

@ -0,0 +1,9 @@
LICENSE := GPLv3
VERSION := git
DOWNLOADS := codezero.git
URL(codezero) := https://github.com/nfeske/codezero.git
REV(codezero) := 6fa4884a5a1cf6207372f69ae01e5faa6d5a39c8
DIR(codezero) := src/kernel/codezero
PATCHES := $(wildcard $(REP_DIR)/patches/*.patch)

View File

@ -1,9 +1,6 @@
TARGET = codezero TARGET = codezero
-include $(BUILD_BASE_DIR)/etc/codezero.conf CODEZERO_DIR := $(call select_from_ports,codezero)/src/kernel/codezero
ifeq ($(wildcard $(CODEZERO_DIR)),)
$(error No valid kernel configured in 'etc/codezero.conf')
endif
include $(REP_DIR)/lib/mk/codezero_cml.inc include $(REP_DIR)/lib/mk/codezero_cml.inc

View File

@ -206,9 +206,6 @@ foc_imx53::
foc_arndale:: foc_arndale::
@echo "SPECS = genode foc_arndale" > $(BUILD_DIR)/etc/specs.conf @echo "SPECS = genode foc_arndale" > $(BUILD_DIR)/etc/specs.conf
codezero_vpb926::
@echo "CODEZERO_DIR = $(GENODE_DIR)/repos/base-codezero/contrib" > $(BUILD_DIR)/etc/codezero.conf
# #
# On all other platforms, the performance counter is assumed to be active by # On all other platforms, the performance counter is assumed to be active by
# default. On HW, its activation is done by an optional core lib. To be # default. On HW, its activation is done by an optional core lib. To be