From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14064 invoked by alias); 6 Dec 2006 13:26:02 -0000 Received: (qmail 14032 invoked by uid 22791); 6 Dec 2006 13:26:01 -0000 X-Spam-Check-By: sourceware.org Received: from sunsite.ms.mff.cuni.cz (HELO sunsite.mff.cuni.cz) (195.113.15.26) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 06 Dec 2006 13:25:49 +0000 Received: from sunsite.mff.cuni.cz (sunsite.mff.cuni.cz [127.0.0.1]) by sunsite.mff.cuni.cz (8.13.1/8.13.1) with ESMTP id kB6DP6o4009225; Wed, 6 Dec 2006 14:25:06 +0100 Received: (from jj@localhost) by sunsite.mff.cuni.cz (8.13.1/8.13.1/Submit) id kB6DP2T0009214; Wed, 6 Dec 2006 14:25:02 +0100 Date: Wed, 06 Dec 2006 13:26:00 -0000 From: Jakub Jelinek To: Ulrich Drepper , Martin Schwidefsky Cc: Glibc hackers Subject: [PATCH] Fix glibc build on s390{,x} Message-ID: <20061206132501.GK9556@sunsite.mff.cuni.cz> Reply-To: Jakub Jelinek Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i Mailing-List: contact libc-hacker-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sourceware.org X-SW-Source: 2006-12/txt/msg00006.txt.bz2 Hi! When asm/unistd.h contains __NR_epoll_pwait on s390/s390x, glibc fails to build. While sysdeps/unix/sysv/linux/s390/s390-{32,64}/sysdep.h has been extended some month ago to handle 6 argument syscalls, sysdep-cancel.h has not and epoll_pwait is a 6 argument cancellable syscall. 2006-12-06 Jakub Jelinek * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Handle 6 argument cancellable syscalls. (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define. * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO): Handle 6 argument cancellable syscalls. (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define. --- libc/nptl/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h.jj 2006-10-30 00:24:40.000000000 +0100 +++ libc/nptl/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h 2006-12-06 11:58:40.000000000 +0100 @@ -45,7 +45,13 @@ L(pseudo_cancel): \ bas %r14,0(%r1,%r13); \ lr %r0,%r2; \ LM_##args \ - DO_CALL(syscall_name, args); \ + .if SYS_ify (syscall_name) < 256; \ + svc SYS_ify (syscall_name); \ + .else; \ + lhi %r1,SYS_ify (syscall_name); \ + svc 0; \ + .endif; \ + LR7_##args \ l %r1,2f-0b(%r13); \ lr %r12,%r2; \ lr %r2,%r0; \ @@ -89,6 +95,7 @@ L(pseudo_end): #define STM_3 stm %r2,%r4,8(%r15); #define STM_4 stm %r2,%r5,8(%r15); #define STM_5 stm %r2,%r5,8(%r15); +#define STM_6 stm %r2,%r7,8(%r15); #define LM_0 /* Nothing */ #define LM_1 l %r2,8+96(%r15); @@ -96,6 +103,18 @@ L(pseudo_end): #define LM_3 lm %r2,%r4,8+96(%r15); #define LM_4 lm %r2,%r5,8+96(%r15); #define LM_5 lm %r2,%r5,8+96(%r15); +#define LM_6 lm %r2,%r5,8+96(%r15); \ + cfi_offset (%r7, -68); \ + l %r7,96+96(%r15); + +#define LR7_0 /* Nothing */ +#define LR7_1 /* Nothing */ +#define LR7_2 /* Nothing */ +#define LR7_3 /* Nothing */ +#define LR7_4 /* Nothing */ +#define LR7_5 /* Nothing */ +#define LR7_6 l %r7,28+96(%r15); \ + cfi_restore (%r7); # ifndef __ASSEMBLER__ # define SINGLE_THREAD_P \ --- libc/nptl/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h.jj 2006-10-30 00:24:40.000000000 +0100 +++ libc/nptl/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h 2006-12-06 12:11:14.000000000 +0100 @@ -42,7 +42,13 @@ L(pseudo_cancel): \ brasl %r14,CENABLE; \ lgr %r0,%r2; \ LM_##args \ - DO_CALL(syscall_name, args); \ + .if SYS_ify (syscall_name) < 256; \ + svc SYS_ify (syscall_name); \ + .else; \ + lghi %r1,SYS_ify (syscall_name); \ + svc 0; \ + .endif; \ + LR7_##args \ lgr %r13,%r2; \ lgr %r2,%r0; \ brasl %r14,CDISABLE; \ @@ -85,6 +91,7 @@ L(pseudo_end): #define STM_3 stmg %r2,%r4,16(%r15); #define STM_4 stmg %r2,%r5,16(%r15); #define STM_5 stmg %r2,%r5,16(%r15); +#define STM_6 stmg %r2,%r7,16(%r15); #define LM_0 /* Nothing */ #define LM_1 lg %r2,16+160(%r15); @@ -92,6 +99,18 @@ L(pseudo_end): #define LM_3 lmg %r2,%r4,16+160(%r15); #define LM_4 lmg %r2,%r5,16+160(%r15); #define LM_5 lmg %r2,%r5,16+160(%r15); +#define LM_6 lmg %r2,%r5,16+160(%r15); \ + cfi_offset (%r7, -104); \ + lg %r7,160+160(%r15); + +#define LR7_0 /* Nothing */ +#define LR7_1 /* Nothing */ +#define LR7_2 /* Nothing */ +#define LR7_3 /* Nothing */ +#define LR7_4 /* Nothing */ +#define LR7_5 /* Nothing */ +#define LR7_6 lg %r7,56+160(%r15); \ + cfi_restore (%r7); # if defined IS_IN_libpthread || !defined NOT_IN_libc # ifndef __ASSEMBLER__ Jakub