- use VC_RANDCTX instead of VC_NOCTX
authorEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Tue, 18 Nov 2003 20:21:43 +0000 (20:21 +0000)
committerEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Tue, 18 Nov 2003 20:21:43 +0000 (20:21 +0000)
- use the conditionalized CTX_USER2KERNEL/CTX_KERNEL2USER transformations

git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/branches/SYSCALL_SWITCH@401 94cd875c-1c1d-0410-91d2-eb244daf1a30

util-vserver/lib/vserver-internal.h

index 28f4e8e..01e2170 100644 (file)
 #  define CALL_VC_V11(F,...)   CALL_VC_NOOP
 #endif
 
-  // gcc does not optimize it; disable it for now, since ctx_t is an uint32_t
-#if 0
+#if 1
 #  define CTX_KERNEL2USER(X)   (((X)==(uint32_t)(-1)) ? VC_NOCTX   : \
                                 ((X)==(uint32_t)(-2)) ? VC_SAMECTX : \
-                                (X))
+                                (ctx_t)(X))
 
-#  define CTX_USER2KERNEL(X)   (((X)==VC_NOCTX)   ? (uint32_t)(-1) : \
+#  define CTX_USER2KERNEL(X)   (((X)==VC_RANDCTX) ? (uint32_t)(-1) : \
                                 ((X)==VC_SAMECTX) ? (uint32_t)(-2) : \
-                                (X))
+                                (uint32_t)(X))
 #else
 #  define CTX_USER2KERNEL(X)   (X)
 #  define CTX_KERNEL2USER(X)   (X)