Message ID | 1478114813-3526-13-git-send-email-adhemerval.zanella@linaro.org |
---|---|
State | New |
Headers | show |
On Wednesday, November 2, 2016 5:26:49 PM CET Adhemerval Zanella wrote: > @@ -31,17 +28,19 @@ > void * > shmat (int shmid, const void *shmaddr, int shmflg) > { > +#ifdef __ASSUME_SYSVIPC_SYSCALL > + return INLINE_SYSCALL_CALL (shmat, shmid, shmaddr, shmflg); > +#else > INTERNAL_SYSCALL_DECL(err); > unsigned long resultvar; > void *raddr; > I looked at the cross-reference for system call tables and found that alpha does not define __NR_shmat but instead has __NR_osf_shmat Will that get handled correctly by your code? Arnd
On 07/11/2016 09:02, Arnd Bergmann wrote: > On Wednesday, November 2, 2016 5:26:49 PM CET Adhemerval Zanella wrote: >> @@ -31,17 +28,19 @@ >> void * >> shmat (int shmid, const void *shmaddr, int shmflg) >> { >> +#ifdef __ASSUME_SYSVIPC_SYSCALL >> + return INLINE_SYSCALL_CALL (shmat, shmid, shmaddr, shmflg); >> +#else >> INTERNAL_SYSCALL_DECL(err); >> unsigned long resultvar; >> void *raddr; >> > > I looked at the cross-reference for system call tables and found > that alpha does not define __NR_shmat but instead has __NR_osf_shmat > > Will that get handled correctly by your code? > > Arnd No, but at least it does not prevent alpha build since it uses the syscalls.list instead. However adjusting it should be simple, it would be something like __NR_fadvise64_64 for arm (where it should be __NR_arm_fadvise64_64 and it is handled on kernel-features.h). I tried to avoid remove the syscalls.list usage for architecture that is already using it, but thinking twice for consolidation idea it would be better to have all architecture to use only a simple syscall generation mechanism for a syscall. I will add it on the patch and send a v3.
diff --git a/sysdeps/unix/sysv/linux/shmat.c b/sysdeps/unix/sysv/linux/shmat.c index 5afc93c..97a15c2 100644 --- a/sysdeps/unix/sysv/linux/shmat.c +++ b/sysdeps/unix/sysv/linux/shmat.c @@ -16,13 +16,10 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#include <errno.h> -#include <sys/shm.h> +#include <sys/msg.h> #include <ipc_priv.h> - #include <sysdep.h> -#include <unistd.h> -#include <sys/syscall.h> +#include <errno.h> /* Attach the shared memory segment associated with SHMID to the data segment of the calling process. SHMADDR and SHMFLG determine how @@ -31,17 +28,19 @@ void * shmat (int shmid, const void *shmaddr, int shmflg) { +#ifdef __ASSUME_SYSVIPC_SYSCALL + return INLINE_SYSCALL_CALL (shmat, shmid, shmaddr, shmflg); +#else INTERNAL_SYSCALL_DECL(err); unsigned long resultvar; void *raddr; - resultvar = INTERNAL_SYSCALL (ipc, err, 5, IPCOP_shmat, - shmid, shmflg, - (long int) &raddr, - (void *) shmaddr); + resultvar = INTERNAL_SYSCALL_CALL (ipc, err, IPCOP_shmat, shmid, shmflg, + &raddr, shmaddr); if (INTERNAL_SYSCALL_ERROR_P (resultvar, err)) return (void *) INLINE_SYSCALL_ERROR_RETURN_VALUE (INTERNAL_SYSCALL_ERRNO (resultvar, err)); return raddr; +#endif }