diff -NurpP --minimal util-vserver-0.30.208/lib/syscall-alternative.h util-vserver-0.30.208.x/lib/syscall-alternative.h --- util-vserver-0.30.208/lib/syscall-alternative.h 2005-07-23 10:40:57.000000000 +0200 +++ util-vserver-0.30.208.x/lib/syscall-alternative.h 2005-07-23 11:51:48.000000000 +0200 @@ -128,6 +128,13 @@ #define __arg_6(a1,a2,a3,a4,a5,a6) a6 + /* avoid clashes */ + +#undef __syscall_return +#undef __syscall_errcon + +#undef __syscall_regtype +#undef __syscall_reg_con /* ***************************************** @@ -283,6 +290,7 @@ #define __syscall_maxerrno 125 #define __syscall_reg_res "er0" +#define __syscall_regs "er1", "er2", "er3", "er4", "er5", "er6" #define __syscall_clobbers "memory" #define ____sc_asm_reg(n, ...) ____sc_asm ( \ @@ -293,7 +301,7 @@ __casm(n,5,1, "mov.l %4,er5" , )\ __casm(n,6,1, "mov.l er6,@-sp" , )\ __casm(n,6,1, "mov.l %5,er6" , )\ - ""::__input_regs(n,__VA_ARGS__)) + ""::__input_regs(n,__VA_ARGS__):__syscall_regs) #define ____sc_asm_sys(n, name) ____sc_asm_vol ( \ __casm(n,1,1, "mov.l %0,er0" , )\ @@ -368,8 +376,10 @@ */ #define __syscall_maxerrno 129 -#define __syscall_reg_res "%%eax" -#define __syscall_clobbers "memory" +#define __syscall_reg_res "eax" + +#define __syscall_regs "ebx", "ecx", "edx", "esi", "edi", "ebp" +#define __syscall_clobbers __syscall_regs, "eax", "memory" #define ____sc_asm_reg(n, ...) ____sc_asm ( \ __casm(n,6,1, "movl %5,%%eax" , )\ @@ -380,7 +390,7 @@ __pasm(n,1,1, "pushl %%ebx" , )\ __casm(n,1,1, "movl %0,%%ebx" , )\ __casm(n,6,1, "pushl %%ebp" , )\ - ""::__input_regs(n,__VA_ARGS__)) + ""::__input_regs(n,__VA_ARGS__):__syscall_regs, "eax") #define ____sc_asm_sys(n, name) ____sc_asm_vol ( \ __casm(n,6,1, "movl %%eax,%%ebp" , )\ @@ -391,7 +401,7 @@ __pasm(n,1,1, "popl %%ebx" , )\ ""::"i"(__NR_##name) : __syscall_clobbers) -#define __syscall_store(r,a) "movl "r","a +#define __syscall_store(r,a) "movl %%"r","a /* ***************************************** @@ -707,8 +717,8 @@ #define __syscall_clobbers __syscall_regs, \ "cc", "r11", "rcx", "memory" -#define __syscall_load(r,a) "movq "a","r -#define __syscall_store(r,a) "movq "r","a +#define __syscall_load(r,a) "movq "a",%%"r +#define __syscall_store(r,a) "movq %%"r","a #else @@ -718,8 +728,10 @@ /* list of all registers */ +#ifndef __syscall_regs #define __syscall_reg_list(x) x(1), x(2), x(3), x(4), x(5), x(6) #define __syscall_regs __syscall_reg_list(__syscall_reg) +#endif #ifndef __syscall_regtype #define __syscall_regtype long @@ -736,7 +748,7 @@ __casm(n,4,1, __syscall_load(__syscall_reg(4),"%3"), )\ __casm(n,5,1, __syscall_load(__syscall_reg(5),"%4"), )\ __casm(n,6,1, __syscall_load(__syscall_reg(6),"%5"), )\ - ""::__input_regs(n,__VA_ARGS__)) + ""::__input_regs(n,__VA_ARGS__):__syscall_regs) #endif #ifndef ____sc_asm_sys