diff --git a/sys/compat/linux/arch/amd64/linux_machdep.h b/sys/compat/linux/arch/amd64/linux_machdep.h index b42f29ed00c8..440a6253fc20 100644 --- a/sys/compat/linux/arch/amd64/linux_machdep.h +++ b/sys/compat/linux/arch/amd64/linux_machdep.h @@ -1,4 +1,4 @@ -/* $NetBSD: linux_machdep.h,v 1.5 2005/11/23 16:14:57 manu Exp $ */ +/* $NetBSD: linux_machdep.h,v 1.6 2007/03/14 12:44:39 njoly Exp $ */ /*- * Copyright (c) 2005 Emmanuel Dreyfus, all rights reserved. @@ -34,6 +34,8 @@ #ifndef _AMD64_LINUX_MACHDEP_H #define _AMD64_LINUX_MACHDEP_H +#define LINUX_STATFS_64BIT /* Needed for full 64bit struct statfs */ + #include #include #include diff --git a/sys/compat/linux/arch/amd64/syscalls.master b/sys/compat/linux/arch/amd64/syscalls.master index 5248c87a4191..0b691ada5b47 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.17 2007/03/04 06:01:19 christos Exp $ + $NetBSD: syscalls.master,v 1.18 2007/03/14 12:44:39 njoly Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 @@ -298,10 +298,10 @@ #endif 135 STD { int linux_sys_personality(int per); } 136 UNIMPL ustat -137 STD { int linux_sys_statfs64(const char *path, \ - size_t sz, struct linux_statfs64 *sp); } -138 STD { int linux_sys_fstatfs64(int fd, \ - size_t sz, struct linux_statfs64 *sp); } +137 STD { int linux_sys_statfs(const char *path, \ + struct linux_statfs *sp); } +138 STD { int linux_sys_fstatfs(int fd, \ + struct linux_statfs *sp); } 139 UNIMPL sysfs 140 STD { int linux_sys_getpriority(int which, int who); } 141 NOARGS { int sys_setpriority(int which, int who, int prio); } diff --git a/sys/compat/linux/common/linux_misc.c b/sys/compat/linux/common/linux_misc.c index 7484685f309b..c7a1adf2afb1 100644 --- a/sys/compat/linux/common/linux_misc.c +++ b/sys/compat/linux/common/linux_misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_misc.c,v 1.167 2007/03/04 06:01:24 christos Exp $ */ +/* $NetBSD: linux_misc.c,v 1.168 2007/03/14 12:44:39 njoly Exp $ */ /*- * Copyright (c) 1995, 1998, 1999 The NetBSD Foundation, Inc. @@ -64,7 +64,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.167 2007/03/04 06:01:24 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.168 2007/03/14 12:44:39 njoly Exp $"); #if defined(_KERNEL_OPT) #include "opt_ptrace.h" @@ -177,10 +177,8 @@ const int linux_fstypes_cnt = sizeof(linux_fstypes) / sizeof(linux_fstypes[0]); # endif /* Local linux_misc.c functions: */ -# ifndef __amd64__ static void bsd_to_linux_statfs __P((const struct statvfs *, struct linux_statfs *)); -# endif static void linux_to_bsd_mmap_args __P((struct sys_mmap_args *, const struct linux_sys_mmap_args *)); static int linux_mmap __P((struct lwp *, struct linux_sys_mmap_args *, @@ -312,7 +310,6 @@ linux_sys_brk(l, v, retval) return 0; } -# ifndef __amd64__ /* * Convert NetBSD statvfs structure to Linux statfs structure. * Linux doesn't have f_flag, and we can't set f_frsize due @@ -446,7 +443,6 @@ out: STATVFSBUF_PUT(btmp); return error; } -# endif /* !__amd64__ */ /* * uname(). Just copy the info from the various strings stored in the diff --git a/sys/compat/linux/common/linux_misc_notalpha.c b/sys/compat/linux/common/linux_misc_notalpha.c index 1f4fb45d4587..096ece7f3e81 100644 --- a/sys/compat/linux/common/linux_misc_notalpha.c +++ b/sys/compat/linux/common/linux_misc_notalpha.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_misc_notalpha.c,v 1.86 2007/03/04 06:01:24 christos Exp $ */ +/* $NetBSD: linux_misc_notalpha.c,v 1.87 2007/03/14 12:44:40 njoly Exp $ */ /*- * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_misc_notalpha.c,v 1.86 2007/03/04 06:01:24 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_misc_notalpha.c,v 1.87 2007/03/14 12:44:40 njoly Exp $"); #include #include @@ -82,7 +82,7 @@ __KERNEL_RCSID(0, "$NetBSD: linux_misc_notalpha.c,v 1.86 2007/03/04 06:01:24 chr #endif #ifndef COMPAT_LINUX32 -#if !defined(__m68k__) +#if !defined(__m68k__) && !defined(__amd64__) static void bsd_to_linux_statfs64(const struct statvfs *, struct linux_statfs64 *); #endif @@ -410,7 +410,7 @@ linux_sys_stime(struct lwp *l, void *v, register_t *retval) } #endif /* !amd64 */ -#if !defined(__m68k__) +#if !defined(__m68k__) && !defined(__amd64__) /* * Convert NetBSD statvfs structure to Linux statfs64 structure. * See comments in bsd_to_linux_statfs() for further background. @@ -542,5 +542,5 @@ out: STATVFSBUF_PUT(btmp); return error; } -#endif /* !__m68k__ */ +#endif /* !__m68k__ && !__amd64__ */ #endif /* !COMPAT_LINUX32 */ diff --git a/sys/compat/linux/common/linux_types.h b/sys/compat/linux/common/linux_types.h index bfd634fc3929..d495cfbdca43 100644 --- a/sys/compat/linux/common/linux_types.h +++ b/sys/compat/linux/common/linux_types.h @@ -1,4 +1,4 @@ -/* $NetBSD: linux_types.h,v 1.24 2006/11/16 01:32:42 christos Exp $ */ +/* $NetBSD: linux_types.h,v 1.25 2007/03/14 12:44:40 njoly Exp $ */ /*- * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc. @@ -106,11 +106,38 @@ struct linux___sysctl { #include /* - * From Linux include/asm-generic/statfs.h - * This is _almost_ generic - Linux/sparc64 uses different (fully 64bit) - * struct statfs. However, we don't support Linux/sparc64 ATM. + * Generic statfs structure from Linux include/asm-generic/statfs.h + * Linux/x86_64 uses different (fully 64bit) struct statfs. */ -#ifndef __sparc64__ +#ifdef LINUX_STATFS_64BIT +struct linux_statfs { + long l_ftype; + long l_fbsize; + long l_fblocks; + long l_fbfree; + long l_fbavail; + long l_ffiles; + long l_fffree; + linux_fsid_t l_ffsid; + long l_fnamelen; + long l_ffrsize; + long l_fspare[5]; +}; + +struct linux_statfs64 { + long l_ftype; + long l_fbsize; + long l_fblocks; + long l_fbfree; + long l_fbavail; + long l_ffiles; + long l_fffree; + linux_fsid_t l_ffsid; + long l_fnamelen; + long l_ffrsize; + long l_fspare[5]; +}; +#else /* !LINUX_STATFS_64BIT */ struct linux_statfs { u_int32_t l_ftype; u_int32_t l_fbsize; @@ -138,6 +165,6 @@ struct linux_statfs64 { u_int32_t l_ffrsize; u_int32_t l_fspare[5]; }; -#endif /* !__sparc64__ */ +#endif /* !LINUX_STATFS_64BIT */ #endif /* !_LINUX_TYPES_H */