xref: /netbsd-src/sys/compat/linux/arch/arm/linux_types.h (revision de7fce08a0c73578546d2bd32590e4c08f605356)
1 /*	$NetBSD: linux_types.h,v 1.9 2013/03/21 15:03:47 pooka Exp $	*/
2 
3 /*-
4  * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
5  * All rights reserved.
6  *
7  * This code is derived from software contributed to The NetBSD Foundation
8  * by Frank van der Linden and Eric Haszlakiewicz.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  * 1. Redistributions of source code must retain the above copyright
14  *    notice, this list of conditions and the following disclaimer.
15  * 2. Redistributions in binary form must reproduce the above copyright
16  *    notice, this list of conditions and the following disclaimer in the
17  *    documentation and/or other materials provided with the distribution.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  */
31 
32 #ifndef _ARM_LINUX_TYPES_H
33 #define _ARM_LINUX_TYPES_H
34 
35 typedef unsigned short linux_uid_t;
36 typedef unsigned short linux_gid_t;
37 typedef unsigned short linux_dev_t;
38 typedef unsigned long linux_ino_t;
39 typedef unsigned short linux_mode_t;
40 typedef unsigned short linux_nlink_t;
41 typedef long linux_time_t;
42 typedef long linux_suseconds_t;
43 typedef long linux_clock_t;
44 typedef long linux_off_t;
45 typedef int linux_pid_t;
46 
47 /* From linux_termios.h */
48 typedef unsigned char linux_cc_t;
49 typedef unsigned long linux_speed_t;
50 typedef unsigned long linux_tcflag_t;
51 
52 struct linux_stat {
53 	linux_dev_t		lst_dev;
54 	unsigned short		pad1;
55 	linux_ino_t		lst_ino;
56 	linux_mode_t		lst_mode;
57 	linux_nlink_t		lst_nlink;
58 	linux_uid_t		lst_uid;
59 	linux_gid_t		lst_gid;
60 	linux_dev_t		lst_rdev;
61 	unsigned short		pad2;
62 	linux_off_t		lst_size;
63 	unsigned long		lst_blksize;
64 	unsigned long		lst_blocks;
65 	linux_time_t		lst_atime;
66 	unsigned long		unused1;
67 	linux_time_t		lst_mtime;
68 	unsigned long		unused2;
69 	linux_time_t		lst_ctime;
70 	unsigned long		unused3;
71 	unsigned long		unused4;
72 	unsigned long		unused5;
73 };
74 
75 /* This matches struct stat64 in glibc2.1, hence the absolutely
76  * insane amounts of padding around dev_t's.
77  */
78 struct linux_stat64 {
79 	unsigned long long lst_dev;
80 	unsigned int	__pad1;
81 
82 #define LINUX_STAT64_HAS_BROKEN_ST_INO	1
83 	unsigned int	__lst_ino;
84 	unsigned int	lst_mode;
85 	unsigned int	lst_nlink;
86 
87 	unsigned int	lst_uid;
88 	unsigned int	lst_gid;
89 
90 	unsigned long long	lst_rdev;
91 	unsigned int	__pad2;
92 
93 	long long	lst_size;
94 	unsigned int	lst_blksize;
95 
96 	unsigned long long lst_blocks;	/* Number 512-byte blocks allocated. */
97 
98 	unsigned int	lst_atime;
99 	unsigned int	lst_atime_nsec;
100 
101 	unsigned int	lst_mtime;
102 	unsigned int	lst_mtime_nsec;
103 
104 	unsigned int	lst_ctime;
105 	unsigned int	lst_ctime_nsec;
106 
107 	unsigned long long lst_ino;
108 };
109 
110 #endif /* !_ARM_LINUX_TYPES_H */
111