From 666c74345fe35c7d92b3e8a7a97a00371a7ecaf3 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Wed, 15 Oct 2014 18:26:10 +0200 Subject: [PATCH] sel4: add patch for sel4/syscalls.h --- repos/base-sel4/doc/notes.txt | 13 +++++++++++++ repos/base-sel4/ports/sel4.hash | 2 +- repos/base-sel4/ports/sel4.port | 3 +++ repos/base-sel4/src/kernel/syscalls.patch | 13 +++++++++++++ 4 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 repos/base-sel4/src/kernel/syscalls.patch diff --git a/repos/base-sel4/doc/notes.txt b/repos/base-sel4/doc/notes.txt index 9e5d5b8db4..6c968c1b0f 100644 --- a/repos/base-sel4/doc/notes.txt +++ b/repos/base-sel4/doc/notes.txt @@ -777,6 +777,19 @@ compiling position-independent code (as is the case for Genode). For now, we have are not compiling with '-fPIC' enabled but this issue is clear in front of us. +Patches for the seL4 code will be reside at _base-sel4/src/kernel/_. E.g., +we just added the current modification of the _syscalls.h_ header by +copying a git diff to the file _base-sel4/src/kernel/syscalls.patch_. +To apply the patch automatically when preparing the seL4 port, we need +to modify the _base-sel4/ports/sel4.port_ file by adding the following +lines: + +! PATCHES := src/kernel/syscalls.patch +! PATCH_OPT := -p1 -d src/kernel/sel4 + +Since we modified the port-description file, we need to update the +accompanied hash via './tool/ports/update_hash sel4'. + Anyway, after all the steps, our test-sel4 program can be successfully built. Executing the run script produces the result that we longed for: diff --git a/repos/base-sel4/ports/sel4.hash b/repos/base-sel4/ports/sel4.hash index 7c2d6b1eae..484dee7db3 100644 --- a/repos/base-sel4/ports/sel4.hash +++ b/repos/base-sel4/ports/sel4.hash @@ -1 +1 @@ -c538b91d215024f21be14837192141004c9e3561 +39b692f97c6a83fdc35e22909b80ce804cc3aa84 diff --git a/repos/base-sel4/ports/sel4.port b/repos/base-sel4/ports/sel4.port index 06269f12dc..f93aacfeaf 100644 --- a/repos/base-sel4/ports/sel4.port +++ b/repos/base-sel4/ports/sel4.port @@ -6,3 +6,6 @@ URL(sel4) := https://github.com/seL4/seL4.git # experimental branch REV(sel4) := b6fbb78cb1233aa8549ea3acb90524306f49a8d2 DIR(sel4) := src/kernel/sel4 + +PATCHES := src/kernel/syscalls.patch +PATCH_OPT := -p1 -d src/kernel/sel4 diff --git a/repos/base-sel4/src/kernel/syscalls.patch b/repos/base-sel4/src/kernel/syscalls.patch new file mode 100644 index 0000000000..8c2083223f --- /dev/null +++ b/repos/base-sel4/src/kernel/syscalls.patch @@ -0,0 +1,13 @@ +diff --git a/libsel4/arch_include/ia32/sel4/arch/syscalls.h b/libsel4/arch_include/ia32/sel4/arch/syscalls.h +index aef583b..d550343 100644 +--- a/libsel4/arch_include/ia32/sel4/arch/syscalls.h ++++ b/libsel4/arch_include/ia32/sel4/arch/syscalls.h +@@ -475,7 +475,7 @@ seL4_DebugPutChar(char c) + "sysenter \n" + "popl %%ebp \n" + : +- : "a" (seL4_SysDebugPutChar), ++ : "a" ((int)seL4_SysDebugPutChar), + "b" (c) + : "%ecx", "%edx", "%esi", "%edi", "memory" + );