From 432f035fa68b817858566f07050400a7306400ca Mon Sep 17 00:00:00 2001 From: manu Date: Thu, 24 Aug 2006 16:36:59 +0000 Subject: [PATCH] The return value for Linux shmat on amd64 does not suffer the same horrible hack as on i386. --- sys/compat/linux/arch/amd64/linux_syscall.h | 4 ++-- sys/compat/linux/arch/amd64/linux_syscallargs.h | 11 ++--------- sys/compat/linux/arch/amd64/linux_syscalls.c | 4 ++-- sys/compat/linux/arch/amd64/linux_sysent.c | 8 ++++---- sys/compat/linux/arch/amd64/syscalls.master | 8 ++++---- sys/compat/linux/common/linux_ipc.c | 6 ++++-- 6 files changed, 18 insertions(+), 23 deletions(-) diff --git a/sys/compat/linux/arch/amd64/linux_syscall.h b/sys/compat/linux/arch/amd64/linux_syscall.h index 815e92245f83..62843e11a235 100644 --- a/sys/compat/linux/arch/amd64/linux_syscall.h +++ b/sys/compat/linux/arch/amd64/linux_syscall.h @@ -1,4 +1,4 @@ -/* $NetBSD: linux_syscall.h,v 1.13 2006/06/25 16:16:52 manu Exp $ */ +/* $NetBSD: linux_syscall.h,v 1.14 2006/08/24 16:36:59 manu Exp $ */ /* * System call numbers. @@ -101,7 +101,7 @@ /* syscall: "shmget" ret: "int" args: "key_t" "size_t" "int" */ #define LINUX_SYS_shmget 29 -/* syscall: "shmat" ret: "int" args: "int" "void *" "int" "u_long *" */ +/* syscall: "shmat" ret: "int" args: "int" "void *" "int" */ #define LINUX_SYS_shmat 30 /* syscall: "shmctl" ret: "int" args: "int" "int" "struct linux_shmid_ds *" */ diff --git a/sys/compat/linux/arch/amd64/linux_syscallargs.h b/sys/compat/linux/arch/amd64/linux_syscallargs.h index 348b779c2365..9eff68e94d78 100644 --- a/sys/compat/linux/arch/amd64/linux_syscallargs.h +++ b/sys/compat/linux/arch/amd64/linux_syscallargs.h @@ -1,4 +1,4 @@ -/* $NetBSD: linux_syscallargs.h,v 1.13 2006/06/25 16:16:52 manu Exp $ */ +/* $NetBSD: linux_syscallargs.h,v 1.14 2006/08/24 16:36:59 manu Exp $ */ /* * System call argument lists. @@ -129,13 +129,6 @@ struct linux_sys_shmget_args { syscallarg(int) shmflg; }; -struct linux_sys_shmat_args { - syscallarg(int) shmid; - syscallarg(void *) shmaddr; - syscallarg(int) shmflg; - syscallarg(u_long *) raddr; -}; - struct linux_sys_shmctl_args { syscallarg(int) shmid; syscallarg(int) cmd; @@ -789,7 +782,7 @@ int sys_madvise(struct lwp *, void *, register_t *); #ifdef SYSVSHM int linux_sys_shmget(struct lwp *, void *, register_t *); -int linux_sys_shmat(struct lwp *, void *, register_t *); +int sys_shmat(struct lwp *, void *, register_t *); int linux_sys_shmctl(struct lwp *, void *, register_t *); diff --git a/sys/compat/linux/arch/amd64/linux_syscalls.c b/sys/compat/linux/arch/amd64/linux_syscalls.c index ea37f2c7d2d0..dfabb8becc8a 100644 --- a/sys/compat/linux/arch/amd64/linux_syscalls.c +++ b/sys/compat/linux/arch/amd64/linux_syscalls.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_syscalls.c,v 1.13 2006/06/25 16:16:52 manu Exp $ */ +/* $NetBSD: linux_syscalls.c,v 1.14 2006/08/24 16:36:59 manu Exp $ */ /* * System call names. @@ -8,7 +8,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.13 2006/06/25 16:16:52 manu Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.14 2006/08/24 16:36:59 manu Exp $"); #if defined(_KERNEL_OPT) #if defined(_KERNEL_OPT) diff --git a/sys/compat/linux/arch/amd64/linux_sysent.c b/sys/compat/linux/arch/amd64/linux_sysent.c index 212ff19664e9..79226952b16a 100644 --- a/sys/compat/linux/arch/amd64/linux_sysent.c +++ b/sys/compat/linux/arch/amd64/linux_sysent.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_sysent.c,v 1.13 2006/06/25 16:16:52 manu Exp $ */ +/* $NetBSD: linux_sysent.c,v 1.14 2006/08/24 16:36:59 manu Exp $ */ /* * System call switch table. @@ -8,7 +8,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.13 2006/06/25 16:16:52 manu Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.14 2006/08/24 16:36:59 manu Exp $"); #if defined(_KERNEL_OPT) #include "opt_sysv.h" @@ -94,8 +94,8 @@ struct sysent linux_sysent[] = { #ifdef SYSVSHM { 3, s(struct linux_sys_shmget_args), 0, linux_sys_shmget }, /* 29 = shmget */ - { 4, s(struct linux_sys_shmat_args), 0, - linux_sys_shmat }, /* 30 = shmat */ + { 3, s(struct sys_shmat_args), 0, + sys_shmat }, /* 30 = shmat */ { 3, s(struct linux_sys_shmctl_args), 0, linux_sys_shmctl }, /* 31 = shmctl */ #else diff --git a/sys/compat/linux/arch/amd64/syscalls.master b/sys/compat/linux/arch/amd64/syscalls.master index ee5d9507d798..7b18b2350321 100644 --- a/sys/compat/linux/arch/amd64/syscalls.master +++ b/sys/compat/linux/arch/amd64/syscalls.master @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.12 2006/06/25 16:15:39 manu Exp $ + $NetBSD: syscalls.master,v 1.13 2006/08/24 16:36:59 manu Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 @@ -111,9 +111,9 @@ 27 NOARGS { int sys_mincore(void *addr, size_t len, char *vec); } 28 NOARGS { int sys_madvise(void *addr, size_t len, int behav); } #ifdef SYSVSHM -29 STD { int linux_sys_shmget(key_t key, size_t size, int shmflg); } -30 STD { int linux_sys_shmat(int shmid, void *shmaddr, \ - int shmflg, u_long *raddr); } +29 STD { int linux_sys_shmget(key_t key, size_t size, \ + int shmflg); } +30 NOARGS { int sys_shmat(int shmid, void *shmaddr, int shmflg); } 31 STD { int linux_sys_shmctl(int shmid, int cmd, \ struct linux_shmid_ds *buf); } #else diff --git a/sys/compat/linux/common/linux_ipc.c b/sys/compat/linux/common/linux_ipc.c index fa515df140d4..b8453827c582 100644 --- a/sys/compat/linux/common/linux_ipc.c +++ b/sys/compat/linux/common/linux_ipc.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_ipc.c,v 1.35 2006/07/23 22:06:09 ad Exp $ */ +/* $NetBSD: linux_ipc.c,v 1.36 2006/08/24 16:36:59 manu Exp $ */ /*- * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_ipc.c,v 1.35 2006/07/23 22:06:09 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_ipc.c,v 1.36 2006/08/24 16:36:59 manu Exp $"); #if defined(_KERNEL_OPT) #include "opt_sysv.h" @@ -407,6 +407,7 @@ linux_sys_shmget(l, v, retval) * in which the return value is to be passed. This is subsequently * handled by libc, apparently. */ +#ifndef __amd64__ int linux_sys_shmat(l, v, retval) struct lwp *l; @@ -431,6 +432,7 @@ linux_sys_shmat(l, v, retval) retval[0] = 0; return 0; } +#endif /* __amd64__ */ /* * Convert between Linux and NetBSD shmid_ds structures.