1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License.  See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1995, 1999, 2000 Ralf Baechle
7 * Copyright (C) 2000 Silicon Graphics, Inc.
8 */
9#ifndef _ASM_STAT_H
10#define _ASM_STAT_H
11
12#include <linux/types.h>
13
14#include <asm/sgidefs.h>
15
16#if (_MIPS_SIM == _MIPS_SIM_ABI32) || (_MIPS_SIM == _MIPS_SIM_NABI32)
17
18struct stat {
19	unsigned	st_dev;
20	long		st_pad1[3];		/* Reserved for network id */
21	ino_t		st_ino;
22	mode_t		st_mode;
23	nlink_t		st_nlink;
24	uid_t		st_uid;
25	gid_t		st_gid;
26	unsigned 	st_rdev;
27	long		st_pad2[2];
28	off_t		st_size;
29	long		st_pad3;
30	/*
31	 * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
32	 * but we don't have it under Linux.
33	 */
34	time_t		st_atime;
35	long		st_atime_nsec;
36	time_t		st_mtime;
37	long		st_mtime_nsec;
38	time_t		st_ctime;
39	long		st_ctime_nsec;
40	long		st_blksize;
41	long		st_blocks;
42	long		st_pad4[14];
43};
44
45/*
46 * This matches struct stat64 in glibc2.1, hence the absolutely insane
47 * amounts of padding around dev_t's.  The memory layout is the same as of
48 * struct stat of the 64-bit kernel.
49 */
50
51struct stat64 {
52	unsigned long	st_dev;
53	unsigned long	st_pad0[3];	/* Reserved for st_dev expansion  */
54
55	unsigned long long	st_ino;
56
57	mode_t		st_mode;
58	nlink_t		st_nlink;
59
60	uid_t		st_uid;
61	gid_t		st_gid;
62
63	unsigned long	st_rdev;
64	unsigned long	st_pad1[3];	/* Reserved for st_rdev expansion  */
65
66	long long	st_size;
67
68	/*
69	 * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
70	 * but we don't have it under Linux.
71	 */
72	time_t		st_atime;
73	unsigned long	st_atime_nsec;	/* Reserved for st_atime expansion  */
74
75	time_t		st_mtime;
76	unsigned long	st_mtime_nsec;	/* Reserved for st_mtime expansion  */
77
78	time_t		st_ctime;
79	unsigned long	st_ctime_nsec;	/* Reserved for st_ctime expansion  */
80
81	unsigned long	st_blksize;
82	unsigned long	st_pad2;
83
84	long long	st_blocks;
85};
86
87#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
88
89#if _MIPS_SIM == _MIPS_SIM_ABI64
90
91/* The memory layout is the same as of struct stat64 of the 32-bit kernel.  */
92struct stat {
93	unsigned int		st_dev;
94	unsigned int		st_pad0[3]; /* Reserved for st_dev expansion */
95
96	unsigned long		st_ino;
97
98	mode_t			st_mode;
99	nlink_t			st_nlink;
100
101	uid_t			st_uid;
102	gid_t			st_gid;
103
104	unsigned int		st_rdev;
105	unsigned int		st_pad1[3]; /* Reserved for st_rdev expansion */
106
107	off_t			st_size;
108
109	/*
110	 * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
111	 * but we don't have it under Linux.
112	 */
113	unsigned int		st_atime;
114	unsigned int		st_atime_nsec;
115
116	unsigned int		st_mtime;
117	unsigned int		st_mtime_nsec;
118
119	unsigned int		st_ctime;
120	unsigned int		st_ctime_nsec;
121
122	unsigned int		st_blksize;
123	unsigned int		st_pad2;
124
125	unsigned long		st_blocks;
126};
127
128#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
129
130#define STAT_HAVE_NSEC 1
131
132#endif /* _ASM_STAT_H */
133