diff --git a/repos/base-sel4/doc/notes.txt b/repos/base-sel4/doc/notes.txt index 83e39344d..46024b4ea 100644 --- a/repos/base-sel4/doc/notes.txt +++ b/repos/base-sel4/doc/notes.txt @@ -789,6 +789,12 @@ lines: Since we modified the port-description file, we need to update the accompanied hash via './tool/ports/update_hash sel4'. +_Edit: After consulting the seL4 mailing list, Adrian Danis pointed out that_ +_the actual issue is an off-by-one bug in the SEL4_FORCE_LONG_ENUM macro._ +_So instead of explicitly casting all opcodes to integers, the macro_ +_can be fixed at one place. Hence, I replaced the syscalls.patch by a_ +_macros.patch until the fix appears upstream._ + 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 484dee7db..07b3b68bd 100644 --- a/repos/base-sel4/ports/sel4.hash +++ b/repos/base-sel4/ports/sel4.hash @@ -1 +1 @@ -39b692f97c6a83fdc35e22909b80ce804cc3aa84 +aaedf65867d799944024bab904c344c160069c0f diff --git a/repos/base-sel4/ports/sel4.port b/repos/base-sel4/ports/sel4.port index f93aacfea..2da589b9b 100644 --- a/repos/base-sel4/ports/sel4.port +++ b/repos/base-sel4/ports/sel4.port @@ -7,5 +7,5 @@ URL(sel4) := https://github.com/seL4/seL4.git REV(sel4) := b6fbb78cb1233aa8549ea3acb90524306f49a8d2 DIR(sel4) := src/kernel/sel4 -PATCHES := src/kernel/syscalls.patch +PATCHES := src/kernel/macros.patch PATCH_OPT := -p1 -d src/kernel/sel4 diff --git a/repos/base-sel4/src/kernel/macros.patch b/repos/base-sel4/src/kernel/macros.patch new file mode 100644 index 000000000..27816dac5 --- /dev/null +++ b/repos/base-sel4/src/kernel/macros.patch @@ -0,0 +1,13 @@ +diff --git a/libsel4/include/sel4/macros.h b/libsel4/include/sel4/macros.h +index 99b18e1..0eea3fb 100644 +--- a/libsel4/include/sel4/macros.h ++++ b/libsel4/include/sel4/macros.h +@@ -17,7 +17,7 @@ + * the same size as an 'int'. + */ + #define SEL4_FORCE_LONG_ENUM(type) \ +- _enum_pad_ ## type = (1U << ((sizeof(int)*8) - 1)) ++ _enum_pad_ ## type = ((1U << ((sizeof(int)*8) - 1)) - 1) + + #ifndef CONST + #define CONST __attribute__((__const__)) diff --git a/repos/base-sel4/src/kernel/syscalls.patch b/repos/base-sel4/src/kernel/syscalls.patch deleted file mode 100644 index 8c2083223..000000000 --- a/repos/base-sel4/src/kernel/syscalls.patch +++ /dev/null @@ -1,13 +0,0 @@ -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" - );