X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fsyscall-alternative.h;h=a3d5bc97c2ee08d1939e878da5fc705988cf5b5d;hb=1bd485daf1544e9b7b9bf020783f6aa0b0085c0b;hp=46d6fe44082dcda023a0fbf0b8b6c233a71260d5;hpb=b40331ee937c33d3f3fead33c0a973638b1b34e8;p=util-vserver.git diff --git a/lib/syscall-alternative.h b/lib/syscall-alternative.h index 46d6fe4..a3d5bc9 100644 --- a/lib/syscall-alternative.h +++ b/lib/syscall-alternative.h @@ -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 @@ -90,6 +90,32 @@ #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. @@ -111,6 +137,7 @@ #warning syscall arch arm not tested yet +#endif /* ***************************************** @@ -269,7 +296,8 @@ __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,...) \ @@ -278,11 +306,11 @@ : __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" ,)\