2004-06-09 Jeff Johnston <jjohnstn@redhat.com>

* libc/sys/linux/Makefile.am: Change siglist.inc to be generated
        from /usr/include/asm/signal.h instead of kernel sources.  Also
        default max to 32 if not found in header file.
        * libc/sys/linux/Makefile.in: Regenerated.
        * libc/sys/linux/machine/i386/socketcall.h: Fix for Fedora Core 2
        systems where __syscall_return is not defined.
        * libc/sys/linux/machine/i386/syscall.h: Change for Fedora Core 2
        systems to use syscall() function instead of assembler interrupt.
This commit is contained in:
Jeff Johnston 2004-06-09 20:43:43 +00:00
parent a7364adeb9
commit db7033a958
5 changed files with 130 additions and 35 deletions

View File

@ -1,3 +1,14 @@
2004-06-09 Jeff Johnston <jjohnstn@redhat.com>
* libc/sys/linux/Makefile.am: Change siglist.inc to be generated
from /usr/include/asm/signal.h instead of kernel sources. Also
default max to 32 if not found in header file.
* libc/sys/linux/Makefile.in: Regenerated.
* libc/sys/linux/machine/i386/socketcall.h: Fix for Fedora Core 2
systems where __syscall_return is not defined.
* libc/sys/linux/machine/i386/syscall.h: Change for Fedora Core 2
systems to use syscall() function instead of assembler interrupt.
2004-06-09 Toralf Lund <toralf@procaptura.com> 2004-06-09 Toralf Lund <toralf@procaptura.com>
* libc/sys/arm/setjmp.S, libc/sys/arm/access.c: Move * libc/sys/arm/setjmp.S, libc/sys/arm/access.c: Move

View File

@ -166,7 +166,7 @@ endif
# This will handle both /usr/src/linux-2.4/include/asm/signal.h (in Red Hat Linux 7.1) # This will handle both /usr/src/linux-2.4/include/asm/signal.h (in Red Hat Linux 7.1)
# and also /usr/src/linux/include/asm/signal.h in older versions of Red Hat Linux # and also /usr/src/linux/include/asm/signal.h in older versions of Red Hat Linux
SIGNAL_H = /usr/src/$(shell ls /usr/src/ | grep ^linux | head -n 1)/include/asm/signal.h SIGNAL_H = /usr/include/asm/signal.h
liblinux_la_LDFLAGS = -Xcompiler -nostdlib liblinux_la_LDFLAGS = -Xcompiler -nostdlib
@ -230,7 +230,8 @@ machine/crt0.o: ; @true
sig.$(oext): siglist.inc sig.$(oext): siglist.inc
siglist.inc: siglist.inc:
$(AWK) '/#define.SIG.*[1-9][0-9]*/ { n[$$3] = $$2 } \ $(AWK) '{ max = 32 } \
/#define.SIG.*[1-9][0-9]*/ { n[$$3] = $$2 } \
/#define.NSIG.*[1-9][0-9]*/ { max = $$3 } \ /#define.NSIG.*[1-9][0-9]*/ { max = $$3 } \
/#define.SIGUNUSED/ \ /#define.SIGUNUSED/ \
{ for (i = 0; i <= max; i++) print "\"" n[i] "\"," }' \ { for (i = 0; i <= max; i++) print "\"" n[i] "\"," }' \

View File

@ -127,7 +127,7 @@ ELIX_4_OBJS = getlogin.$(oext) getpwnam.$(oext) getpwuid.$(oext) stack.$(oe
# This will handle both /usr/src/linux-2.4/include/asm/signal.h (in Red Hat Linux 7.1) # This will handle both /usr/src/linux-2.4/include/asm/signal.h (in Red Hat Linux 7.1)
# and also /usr/src/linux/include/asm/signal.h in older versions of Red Hat Linux # and also /usr/src/linux/include/asm/signal.h in older versions of Red Hat Linux
SIGNAL_H = /usr/src/$(shell ls /usr/src/ | grep ^linux | head -n 1)/include/asm/signal.h SIGNAL_H = /usr/include/asm/signal.h
liblinux_la_LDFLAGS = -Xcompiler -nostdlib liblinux_la_LDFLAGS = -Xcompiler -nostdlib
@ -590,7 +590,8 @@ machine/crt0.o: ; @true
sig.$(oext): siglist.inc sig.$(oext): siglist.inc
siglist.inc: siglist.inc:
$(AWK) '/#define.SIG.*[1-9][0-9]*/ { n[$$3] = $$2 } \ $(AWK) '{ max = 32 } \
/#define.SIG.*[1-9][0-9]*/ { n[$$3] = $$2 } \
/#define.NSIG.*[1-9][0-9]*/ { max = $$3 } \ /#define.NSIG.*[1-9][0-9]*/ { max = $$3 } \
/#define.SIGUNUSED/ \ /#define.SIGUNUSED/ \
{ for (i = 0; i <= max; i++) print "\"" n[i] "\"," }' \ { for (i = 0; i <= max; i++) print "\"" n[i] "\"," }' \

View File

@ -15,6 +15,8 @@
* PIC uses %ebx, so we need to save it during system calls * PIC uses %ebx, so we need to save it during system calls
*/ */
#ifdef __syscall_return
#define __sockcall_base(type, name) \ #define __sockcall_base(type, name) \
{ \ { \
long __res; \ long __res; \
@ -24,6 +26,30 @@ __asm__ volatile ("push %%ebx; movl %2,%%ebx; lea 8(%%ebp),%%ecx; int $0x80; pop
__syscall_return(type,__res); \ __syscall_return(type,__res); \
} }
#else /* !defined(__syscall_return) */
/* FIXME: we need to rewrite this for a vsyscall system. */
#define __syscall_return(type, res) \
do { \
if ((unsigned long)(res) >= (unsigned long)(-125)) { \
errno = -(res); \
res = -1; \
} \
return (type) (res); \
} while (0)
#define __sockcall_base(type, name) \
{ \
long __res; \
__asm__ volatile ("push %%ebx; movl %2,%%ebx; lea 8(%%ebp),%%ecx; int $0x80; pop %%ebx" \
: "=a" (__res) \
: "0" (__NR_socketcall),"r" (SOCK_##name)); \
__syscall_return(type,__res); \
}
#endif /* !defined(__syscall_return) */
#undef _sockcall1 #undef _sockcall1
#define _sockcall1(type,name,type1,arg1) \ #define _sockcall1(type,name,type1,arg1) \
type __libc_##name(type1 arg1) \ type __libc_##name(type1 arg1) \

View File

@ -8,6 +8,7 @@
#include <machine/weakalias.h> #include <machine/weakalias.h>
#include <sys/errno.h> #include <sys/errno.h>
#include <asm/unistd.h> #include <asm/unistd.h>
#include <unistd.h>
/* /*
@ -23,6 +24,8 @@
* PIC uses %ebx, so we need to save it during system calls * PIC uses %ebx, so we need to save it during system calls
*/ */
#ifdef __syscall_return
#undef __inline_syscall0 #undef __inline_syscall0
#define __inline_syscall0(name,ret) \ #define __inline_syscall0(name,ret) \
__asm__ volatile ("int $0x80" \ __asm__ volatile ("int $0x80" \
@ -77,11 +80,6 @@ __inline_syscall0(name,__res) \
__syscall_return(type,__res); \ __syscall_return(type,__res); \
} }
#undef _syscall0
#define _syscall0(type,name) \
_syscall0_base(type,name) \
weak_alias(__libc_##name,name);
#undef _syscall1_base #undef _syscall1_base
#define _syscall1_base(type,name,type1,arg1) \ #define _syscall1_base(type,name,type1,arg1) \
type __libc_##name (type1 arg1) \ type __libc_##name (type1 arg1) \
@ -91,11 +89,6 @@ __inline_syscall1(name,__res,arg1) \
__syscall_return(type,__res); \ __syscall_return(type,__res); \
} }
#undef _syscall1
#define _syscall1(type,name,type1,arg1) \
_syscall1_base(type,name,type1,arg1) \
weak_alias(__libc_##name,name);
#undef _syscall2_base #undef _syscall2_base
#define _syscall2_base(type,name,type1,arg1,type2,arg2) \ #define _syscall2_base(type,name,type1,arg1,type2,arg2) \
type __libc_##name (type1 arg1,type2 arg2) \ type __libc_##name (type1 arg1,type2 arg2) \
@ -105,11 +98,6 @@ __inline_syscall2(name,__res,arg1,arg2) \
__syscall_return(type,__res); \ __syscall_return(type,__res); \
} }
#undef _syscall2
#define _syscall2(type,name,type1,arg1,type2,arg2) \
_syscall2_base(type,name,type1,arg1,type2,arg2) \
weak_alias(__libc_##name,name);
#undef _syscall3_base #undef _syscall3_base
#define _syscall3_base(type,name,type1,arg1,type2,arg2,type3,arg3) \ #define _syscall3_base(type,name,type1,arg1,type2,arg2,type3,arg3) \
type __libc_##name (type1 arg1,type2 arg2,type3 arg3) \ type __libc_##name (type1 arg1,type2 arg2,type3 arg3) \
@ -119,11 +107,6 @@ __inline_syscall3(name,__res,arg1,arg2,arg3) \
__syscall_return(type,__res); \ __syscall_return(type,__res); \
} }
#undef _syscall3
#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
_syscall3_base(type,name,type1,arg1,type2,arg2,type3,arg3) \
weak_alias(__libc_##name,name);
#undef _syscall4_base #undef _syscall4_base
#define _syscall4_base(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \ #define _syscall4_base(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
type __libc_##name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \ type __libc_##name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
@ -133,11 +116,6 @@ __inline_syscall4(name,__res,arg1,arg2,arg3,arg4) \
__syscall_return(type,__res); \ __syscall_return(type,__res); \
} }
#undef _syscall4
#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
_syscall4_base(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
weak_alias(__libc_##name,name);
#undef _syscall5_base #undef _syscall5_base
#define _syscall5_base(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \ #define _syscall5_base(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
type5,arg5) \ type5,arg5) \
@ -148,12 +126,6 @@ __inline_syscall5(name,__res,arg1,arg2,arg3,arg4,arg5) \
__syscall_return(type,__res); \ __syscall_return(type,__res); \
} \ } \
#undef _syscall5
#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
type5,arg5) \
_syscall5_base(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
weak_alias(__libc_##name,name);
#undef _syscall6_base #undef _syscall6_base
#define _syscall6_base(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \ #define _syscall6_base(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
type5,arg5,type6,arg6) \ type5,arg5,type6,arg6) \
@ -164,6 +136,90 @@ __inline_syscall6(name,__res,arg1,arg2,arg3,arg4,arg5,arg6) \
__syscall_return(type,__res); \ __syscall_return(type,__res); \
} }
#else /* !__syscall_return */
#undef _syscall0_base
#define _syscall0_base(type,name) \
type __libc_##name (void) \
{ \
return (type)syscall (__NR_##name); \
}
#undef _syscall1_base
#define _syscall1_base(type,name,type1,arg1) \
type __libc_##name (type1 arg1) \
{ \
return (type)syscall (__NR_##name, arg1); \
}
#undef _syscall2_base
#define _syscall2_base(type,name,type1,arg1,type2,arg2) \
type __libc_##name (type1 arg1, type2 arg2) \
{ \
return (type)syscall (__NR_##name, arg1, arg2); \
}
#undef _syscall3_base
#define _syscall3_base(type,name,type1,arg1,type2,arg2,type3,arg3) \
type __libc_##name (type1 arg1, type2 arg2, type3 arg3) \
{ \
return (type)syscall (__NR_##name, arg1, arg2, arg3); \
}
#undef _syscall4_base
#define _syscall4_base(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
type __libc_##name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
{ \
return (type)syscall (__NR_##name, arg1, arg2, arg3, arg4); \
}
#undef _syscall5_base
#define _syscall5_base(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
type __libc_##name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
{ \
return (type)syscall (__NR_##name, arg1, arg2, arg3, arg4, arg5); \
}
#undef _syscall6_base
#define _syscall6_base(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5,type6,arg6) \
type __libc_##name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,type6 arg6) \
{ \
return (type)syscall (__NR_##name, arg1, arg2, arg3, arg4, arg5, arg6); \
}
#endif /* !__syscall_return */
#undef _syscall0
#define _syscall0(type,name) \
_syscall0_base(type,name) \
weak_alias(__libc_##name,name);
#undef _syscall1
#define _syscall1(type,name,type1,arg1) \
_syscall1_base(type,name,type1,arg1) \
weak_alias(__libc_##name,name);
#undef _syscall2
#define _syscall2(type,name,type1,arg1,type2,arg2) \
_syscall2_base(type,name,type1,arg1,type2,arg2) \
weak_alias(__libc_##name,name);
#undef _syscall3
#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
_syscall3_base(type,name,type1,arg1,type2,arg2,type3,arg3) \
weak_alias(__libc_##name,name);
#undef _syscall4
#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
_syscall4_base(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
weak_alias(__libc_##name,name);
#undef _syscall5
#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
type5,arg5) \
_syscall5_base(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
weak_alias(__libc_##name,name);
#undef _syscall6 #undef _syscall6
#define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \ #define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
type5,arg5,type6,arg6) \ type5,arg5,type6,arg6) \