l4-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] IDL4 with GNU libl4


From: Ludovic Courtès
Subject: [PATCH] IDL4 with GNU libl4
Date: Tue, 18 Nov 2003 16:19:46 +0100
User-agent: Mutt/1.5.4i [Guile enabled]

Hi,

Below is a small patch against IDL4 1.0.2-beta that modifies headers so
that IDL4-generated code (which includes these headers) can compile with
GNU libl4, the libl4 replacement written by Marcus Brinkmann.

diff --recursive -u 
/home/lcourtes/src/idl4-1.0.2-orig/src/include/user/idl4/api/v4/interface.h 
./idl4/api/v4/interface.h
--- /home/lcourtes/src/idl4-1.0.2-orig/src/include/user/idl4/api/v4/interface.h 
2003-08-25 06:44:55.000000000 +0200
+++ ./idl4/api/v4/interface.h   2003-11-18 15:43:18.000000000 +0100
@@ -162,31 +162,31 @@
 static inline int idl4_is_kernel_message(L4_MsgTag_t msgtag)
 
 {
-  return ((msgtag.X.label&0xFF00) == 0xFF00);
+  return ((L4_LABEL (msgtag) & 0xFF00) == 0xFF00);
 }
 
 static inline unsigned idl4_get_kernel_message_id(L4_MsgTag_t msgtag)
 
 {
-  return ((unsigned)-(((int)msgtag.X.label)>>4));
+  return ((unsigned)-(((int)L4_LABEL (msgtag))>>4));
 }
 
 static inline unsigned idl4_get_function_id(L4_MsgTag_t *msgtag)
 
 {
-  return (msgtag->X.label & ((1<<IDL4_FID_BITS)-1));
+  return (L4_LABEL (*msgtag) & ((1<<IDL4_FID_BITS)-1));
 }
 
 static inline unsigned idl4_get_interface_id(L4_MsgTag_t *msgtag)
 
 {
-  return ((msgtag->X.label>>IDL4_FID_BITS) & ((1<<IDL4_IID_BITS)-1));
+  return ((L4_LABEL (*msgtag) >>IDL4_FID_BITS) & ((1<<IDL4_IID_BITS)-1));
 }
 
 static inline unsigned idl4_is_error(L4_MsgTag_t *msgtag)
 
 {
-  return (msgtag->X.flags & 8);
+  return (L4_ERROR (*msgtag));
 }
 
 #endif /* __idl4_api_v4_interface_h__ */
diff --recursive -u 
/home/lcourtes/src/idl4-1.0.2-orig/src/include/user/idl4/glue/v4-ia32/runtime.h 
./idl4/glue/v4-ia32/runtime.h
--- 
/home/lcourtes/src/idl4-1.0.2-orig/src/include/user/idl4/glue/v4-ia32/runtime.h 
    2003-11-07 01:01:43.000000000 +0100
+++ ./idl4/glue/v4-ia32/runtime.h       2003-11-18 15:45:03.000000000 +0100
@@ -7,7 +7,23 @@
 #define IDL4_INLINE inline
 
 #define IDL4_IPC_ENTRY "__L4_Ipc"
- 
+
+#ifndef L4_LABEL
+# ifndef __GNU_LIBL4__
+#  define L4_LABEL(_msgtag)  ((_msgtag).X.label)
+# else
+#  define L4_LABEL(_msgtag)  (l4_label ((_msgtag)))
+# endif /* __GNU_LIBL4__ */
+#endif
+
+#ifndef L4_ERROR
+# ifndef __GNU_LIBL4__
+#  define L4_ERROR(_msgtag)  ((_msgtag).X.flags & 8)
+# else
+#  define L4_ERROR(_msgtag)  (l4_ipc_failed ((_msgtag)))
+# endif
+#endif
+
 extern inline void *MyUTCB(void)
 

Thanks,
Ludovic.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]