This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 2/2] Enable ILP32 mode on aarch64 (version 3)
- From: Yury Norov <ynorov at caviumnetworks dot com>
- To: Steve Ellcey <sellcey at caviumnetworks dot com>
- Cc: libc-alpha <libc-alpha at sourceware dot org>
- Date: Tue, 20 Dec 2016 10:54:24 +0530
- Subject: Re: [PATCH 2/2] Enable ILP32 mode on aarch64 (version 3)
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Yuri dot Norov at caviumnetworks dot com;
- References: <1482187587.7649.20.camel@caviumnetworks.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
On Mon, Dec 19, 2016 at 02:46:27PM -0800, Steve Ellcey wrote:
> I added an aarch64
> specific statfs.h header file so that the statfs and statfs64
> structures match and we can alias the statfs and statfs64 calls to each
> other.> diff --git a/sysdeps/unix/sysv/linux/aarch64/bits/statfs.h b/sysdeps/unix/sysv/linux/aarch64/bits/statfs.h
> new file mode 100644
> index 0000000..b4fd145
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/aarch64/bits/statfs.h
> @@ -0,0 +1,67 @@
> +/* Copyright (C) 2016 Free Software Foundation, Inc.
> + This file is part of the GNU C Library.
> + Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
> +
> + The GNU C Library is free software; you can redistribute it and/or
> + modify it under the terms of the GNU Lesser General Public
> + License as published by the Free Software Foundation; either
> + version 2.1 of the License, or (at your option) any later version.
> +
> + The GNU C Library is distributed in the hope that it will be useful,
> + but WITHOUT ANY WARRANTY; without even the implied warranty of
> + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> + Lesser General Public License for more details.
> +
> + You should have received a copy of the GNU Lesser General Public
> + License along with the GNU C Library. If not, see
> + <http://www.gnu.org/licenses/>. */
> +
> +#ifndef _SYS_STATFS_H
> +# error "Never include <bits/statfs.h> directly; use <sys/statfs.h> instead."
> +#endif
> +
> +#include <endian.h>
> +#include <bits/types.h>
> +#include <bits/wordsize.h>
> +
> +/* On AArch64 both the 32-bit and 64-bit libc's use the kernels
> + 'struct statfs' with 64 bit f_blocks/f_bfree/f_bavail/f_files/f_ffree
> + fields. This means the statfs and statfs64 structs are identical
> + and the statfs and statfs64 calls can be aliases. */
> +
> +struct statfs
> + {
> + __SWORD_TYPE f_type;
> + __SWORD_TYPE f_bsize;
> + __fsblkcnt64_t f_blocks;
> + __fsblkcnt64_t f_bfree;
> + __fsblkcnt64_t f_bavail;
> + __fsfilcnt64_t f_files;
> + __fsfilcnt64_t f_ffree;
This should be __fsfilcnt_t etc types. In fact, no difference, but
this is the POSIX requirement.
> + __fsid_t f_fsid;
> + __SWORD_TYPE f_namelen;
> + __SWORD_TYPE f_frsize;
> + __SWORD_TYPE f_flags;
> + __SWORD_TYPE f_spare[4];
> + };
> +
> +struct statfs64
> + {
> + __SWORD_TYPE f_type;
> + __SWORD_TYPE f_bsize;
> + __fsblkcnt64_t f_blocks;
> + __fsblkcnt64_t f_bfree;
> + __fsblkcnt64_t f_bavail;
> + __fsfilcnt64_t f_files;
> + __fsfilcnt64_t f_ffree;
> + __fsid_t f_fsid;
> + __SWORD_TYPE f_namelen;
> + __SWORD_TYPE f_frsize;
> + __SWORD_TYPE f_flags;
> + __SWORD_TYPE f_spare[4];
> + };