[okl4-developer] [PATCH] broken NONEXISTANT_TID in l4test on 64bit archs

Tomas Hruby thruby at cs.otago.ac.nz
Tue Sep 23 14:31:46 EST 2008


The 32bit constant (0x13371401UL) does not set the thread_no field of
the L4_ThreadId_t which causes failure in IPC0700 test in l4test suite
since the thread_no is 0 and lookup_ipc_cap_locked() returns a valid
tcb. The patch splits the original value (probably anything random
would work as well) and sets thread_no and version separately.

diff -ur orig/l4test/src/ipc.c fix/l4test/src/ipc.c
--- orig/l4test/src/ipc.c	2008-09-23 14:19:18.000000000 +1000
+++ fix/l4test/src/ipc.c	2008-09-23 14:20:59.000000000 +1000
@@ -81,7 +81,11 @@
 
 /* Magic numbers for checking things */
 #define MAGIC_LABEL1    0xdead
-static const L4_ThreadId_t NONEXISTANT_TID = { 0x13371401UL };
+static const L4_ThreadId_t NONEXISTANT_TID = {
+		.global.X.thread_no = 0x13371401UL >> 14,
+		.global.X.version = 0x13371401UL & ((1 << 14) - 1)
+};
+
 
 static L4_ThreadId_t main_thread;
 static L4_ThreadId_t other_thread;



More information about the Developer mailing list