18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * This file is subject to the terms and conditions of the GNU General Public
48c2ecf20Sopenharmony_ci * License.  See the file "COPYING" in the main directory of this archive
58c2ecf20Sopenharmony_ci * for more details.
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * Copyright (C) 1995, 1999, 2000 Ralf Baechle
88c2ecf20Sopenharmony_ci * Copyright (C) 2000 Silicon Graphics, Inc.
98c2ecf20Sopenharmony_ci */
108c2ecf20Sopenharmony_ci#ifndef _ASM_STAT_H
118c2ecf20Sopenharmony_ci#define _ASM_STAT_H
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci#include <linux/types.h>
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci#include <asm/sgidefs.h>
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci#if (_MIPS_SIM == _MIPS_SIM_ABI32) || (_MIPS_SIM == _MIPS_SIM_NABI32)
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_cistruct stat {
208c2ecf20Sopenharmony_ci	unsigned	st_dev;
218c2ecf20Sopenharmony_ci	long		st_pad1[3];		/* Reserved for network id */
228c2ecf20Sopenharmony_ci	ino_t		st_ino;
238c2ecf20Sopenharmony_ci	mode_t		st_mode;
248c2ecf20Sopenharmony_ci	__u32		st_nlink;
258c2ecf20Sopenharmony_ci	uid_t		st_uid;
268c2ecf20Sopenharmony_ci	gid_t		st_gid;
278c2ecf20Sopenharmony_ci	unsigned	st_rdev;
288c2ecf20Sopenharmony_ci	long		st_pad2[2];
298c2ecf20Sopenharmony_ci	long		st_size;
308c2ecf20Sopenharmony_ci	long		st_pad3;
318c2ecf20Sopenharmony_ci	/*
328c2ecf20Sopenharmony_ci	 * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
338c2ecf20Sopenharmony_ci	 * but we don't have it under Linux.
348c2ecf20Sopenharmony_ci	 */
358c2ecf20Sopenharmony_ci	long		st_atime;
368c2ecf20Sopenharmony_ci	long		st_atime_nsec;
378c2ecf20Sopenharmony_ci	long		st_mtime;
388c2ecf20Sopenharmony_ci	long		st_mtime_nsec;
398c2ecf20Sopenharmony_ci	long		st_ctime;
408c2ecf20Sopenharmony_ci	long		st_ctime_nsec;
418c2ecf20Sopenharmony_ci	long		st_blksize;
428c2ecf20Sopenharmony_ci	long		st_blocks;
438c2ecf20Sopenharmony_ci	long		st_pad4[14];
448c2ecf20Sopenharmony_ci};
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci/*
478c2ecf20Sopenharmony_ci * This matches struct stat64 in glibc2.1, hence the absolutely insane
488c2ecf20Sopenharmony_ci * amounts of padding around dev_t's.  The memory layout is the same as of
498c2ecf20Sopenharmony_ci * struct stat of the 64-bit kernel.
508c2ecf20Sopenharmony_ci */
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_cistruct stat64 {
538c2ecf20Sopenharmony_ci	unsigned long	st_dev;
548c2ecf20Sopenharmony_ci	unsigned long	st_pad0[3];	/* Reserved for st_dev expansion  */
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_ci	unsigned long long	st_ino;
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ci	mode_t		st_mode;
598c2ecf20Sopenharmony_ci	__u32		st_nlink;
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ci	uid_t		st_uid;
628c2ecf20Sopenharmony_ci	gid_t		st_gid;
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ci	unsigned long	st_rdev;
658c2ecf20Sopenharmony_ci	unsigned long	st_pad1[3];	/* Reserved for st_rdev expansion  */
668c2ecf20Sopenharmony_ci
678c2ecf20Sopenharmony_ci	long long	st_size;
688c2ecf20Sopenharmony_ci
698c2ecf20Sopenharmony_ci	/*
708c2ecf20Sopenharmony_ci	 * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
718c2ecf20Sopenharmony_ci	 * but we don't have it under Linux.
728c2ecf20Sopenharmony_ci	 */
738c2ecf20Sopenharmony_ci	long		st_atime;
748c2ecf20Sopenharmony_ci	unsigned long	st_atime_nsec;	/* Reserved for st_atime expansion  */
758c2ecf20Sopenharmony_ci
768c2ecf20Sopenharmony_ci	long		st_mtime;
778c2ecf20Sopenharmony_ci	unsigned long	st_mtime_nsec;	/* Reserved for st_mtime expansion  */
788c2ecf20Sopenharmony_ci
798c2ecf20Sopenharmony_ci	long		st_ctime;
808c2ecf20Sopenharmony_ci	unsigned long	st_ctime_nsec;	/* Reserved for st_ctime expansion  */
818c2ecf20Sopenharmony_ci
828c2ecf20Sopenharmony_ci	unsigned long	st_blksize;
838c2ecf20Sopenharmony_ci	unsigned long	st_pad2;
848c2ecf20Sopenharmony_ci
858c2ecf20Sopenharmony_ci	long long	st_blocks;
868c2ecf20Sopenharmony_ci};
878c2ecf20Sopenharmony_ci
888c2ecf20Sopenharmony_ci#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
898c2ecf20Sopenharmony_ci
908c2ecf20Sopenharmony_ci#if _MIPS_SIM == _MIPS_SIM_ABI64
918c2ecf20Sopenharmony_ci
928c2ecf20Sopenharmony_ci/* The memory layout is the same as of struct stat64 of the 32-bit kernel.  */
938c2ecf20Sopenharmony_cistruct stat {
948c2ecf20Sopenharmony_ci	unsigned int		st_dev;
958c2ecf20Sopenharmony_ci	unsigned int		st_pad0[3]; /* Reserved for st_dev expansion */
968c2ecf20Sopenharmony_ci
978c2ecf20Sopenharmony_ci	unsigned long		st_ino;
988c2ecf20Sopenharmony_ci
998c2ecf20Sopenharmony_ci	mode_t			st_mode;
1008c2ecf20Sopenharmony_ci	__u32			st_nlink;
1018c2ecf20Sopenharmony_ci
1028c2ecf20Sopenharmony_ci	uid_t			st_uid;
1038c2ecf20Sopenharmony_ci	gid_t			st_gid;
1048c2ecf20Sopenharmony_ci
1058c2ecf20Sopenharmony_ci	unsigned int		st_rdev;
1068c2ecf20Sopenharmony_ci	unsigned int		st_pad1[3]; /* Reserved for st_rdev expansion */
1078c2ecf20Sopenharmony_ci
1088c2ecf20Sopenharmony_ci	long			st_size;
1098c2ecf20Sopenharmony_ci
1108c2ecf20Sopenharmony_ci	/*
1118c2ecf20Sopenharmony_ci	 * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
1128c2ecf20Sopenharmony_ci	 * but we don't have it under Linux.
1138c2ecf20Sopenharmony_ci	 */
1148c2ecf20Sopenharmony_ci	unsigned int		st_atime;
1158c2ecf20Sopenharmony_ci	unsigned int		st_atime_nsec;
1168c2ecf20Sopenharmony_ci
1178c2ecf20Sopenharmony_ci	unsigned int		st_mtime;
1188c2ecf20Sopenharmony_ci	unsigned int		st_mtime_nsec;
1198c2ecf20Sopenharmony_ci
1208c2ecf20Sopenharmony_ci	unsigned int		st_ctime;
1218c2ecf20Sopenharmony_ci	unsigned int		st_ctime_nsec;
1228c2ecf20Sopenharmony_ci
1238c2ecf20Sopenharmony_ci	unsigned int		st_blksize;
1248c2ecf20Sopenharmony_ci	unsigned int		st_pad2;
1258c2ecf20Sopenharmony_ci
1268c2ecf20Sopenharmony_ci	unsigned long		st_blocks;
1278c2ecf20Sopenharmony_ci};
1288c2ecf20Sopenharmony_ci
1298c2ecf20Sopenharmony_ci#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
1308c2ecf20Sopenharmony_ci
1318c2ecf20Sopenharmony_ci#define STAT_HAVE_NSEC 1
1328c2ecf20Sopenharmony_ci
1338c2ecf20Sopenharmony_ci#endif /* _ASM_STAT_H */
134