Re: _syscall2 in PIC code on ix86

From: Alan Modra (alan@SPRI.Levels.UniSA.Edu.Au)
Date: Sun Jan 16 2000 - 20:32:51 EST


On Mon, 17 Jan 2000, Keith Owens wrote:

> solution. I have these working defines for syscall_pic, but they
> should not go in the kernel.

They won't work with -fomit-frame-pointer !!!

The following should work. Trim as required for _syscall4_pic etc.

#define _syscall5_pic(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
          type5,arg5) \
type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
{ \
long __res; \
__asm__ volatile ( \
        "pushl %%ebx\n\t" \
        "movl %%eax,%%ebx\n\t" \
        "movl %1,%%eax\n\t" \
        "int $0x80\n\t" \
        "popl %%ebx" \
        : "=a" (__res) \
        : "i" (__NR_##name),"a" ((long)(arg1)),"c" ((long)(arg2)), \
          "d" ((long)(arg3)),"S" ((long)(arg4)),"D" ((long)(arg5))); \
__syscall_return(type,__res); \
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Jan 23 2000 - 21:00:14 EST