gentoo: use /var/run for new /run compatibility
[util-vserver.git] / lib / syscall-alternative.h
index 46d6fe4..a3d5bc9 100644 (file)
@@ -1,4 +1,4 @@
- // from http://vserver.13thfloor.at/Experimental/SYSCALL/syscall_shiny16.h
+ // from http://vserver.13thfloor.at/Experimental/SYSCALL/syscall_shiny17.h
 
 #ifndef        __SYSCALL_NEW_H
 #define        __SYSCALL_NEW_H
 
 #elif  defined(__arm__)
 
+#ifdef __ARM_EABI__
+
+/*     The Arm calling convention uses stack args after four arguments
+       but the Linux kernel gets up to seven arguments in registers.
+       
+       scnr:   r7
+       args:   a1(r0), a2(r1), a3(r2), a4(r3), a5(r4), a6(r5),
+       sret:   r0(r0)
+       serr:   (sret >= (unsigned)-EMAXERRNO)
+       call:   swi
+       clob:   memory
+       move:   mov $dR,$sR
+*/
+
+#define        __sysc_max_err  125
+
+#define        __sysc_cmd(n)   "swi $0x0"
+
+#define        __sysc_regs     "r0", "r1", "r2", "r3", "r4", "r5"
+#define        __sysc_reg_cid  "r7"
+#define        __sysc_reg_ret  "r0"
+
+#warning syscall arch armel not tested yet
+
+#else
+
 /*     The Arm calling convention uses stack args after four arguments
        but the Linux kernel gets up to seven arguments in registers.
        
 
 #warning syscall arch arm not tested yet
 
+#endif
 
 
 /*     *****************************************
        __cm    __sc_rvcs("D", N),)
 
 #define        __sc_arg1(n,...) __Casm(n,1,6,0,,       \
-       __sc_rvcs("ri", __sc_reg1(__VA_ARGS__)),\
+       __sc_rvcs(__pic("ri") __nopic("b"),     \
+       __sc_reg1(__VA_ARGS__)),                \
        __sc_rvcs("0", &__scs))
 
 #define        __sc_syscall(n,N,...) \
          : __sc_cidval(N) __sc_null(n)         \
            __sc_arg1(n,__VA_ARGS__)            \
            __con_##n(__sc_rvrd,__VA_ARGS__)    \
-         : "memory" __nopic(__cm "ebx"))
+         : "memory" )
 
 #define        __sysc_cmd(n)   \
        __pasm(n,1,1,   "pushl  %%ebx"          ,)\
-       __Casm(n,1,6,1,,"movl   %2, %%ebx"      ,)\
+       __Pasm(n,1,5,1,,"movl   %2, %%ebx"      ,)\
        __casm(n,6,1,   "pushl  %%ebp"          ,)\
        __casm(n,6,1,   "movl   0(%2), %%ebx"   ,)\
        __casm(n,6,1,   "movl   4(%2), %%ebp"   ,)\