xref: /netbsd-src/sys/compat/linux/arch/m68k/linux_types.h (revision 461a86f9bdbf4658bc4b37796e978427095f94a7)
1 /*	$NetBSD: linux_types.h,v 1.9 2009/01/11 02:45:48 christos 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 _M68K_LINUX_TYPES_H
33 #define _M68K_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 int linux_speed_t;
50 typedef unsigned int 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 short	lst_dev;
80 	unsigned char	__pad0[10];
81 
82 #define LINUX_STAT64_HAS_BROKEN_ST_INO	1
83 	unsigned long	__lst_ino;
84 	unsigned int	lst_mode;
85 	unsigned int	lst_nlink;
86 
87 	unsigned long	lst_uid;
88 	unsigned long	lst_gid;
89 
90 	unsigned short	lst_rdev;
91 	unsigned char	__pad3[10];
92 
93 	long long	lst_size;
94 	unsigned long	lst_blksize;
95 
96 	unsigned long	lst_blocks;	/* Number 512-byte blocks allocated. */
97 	unsigned long	__pad4;		/* future possible st_blocks high bits */
98 
99 	unsigned long	lst_atime;
100 	unsigned long	__pad5;
101 
102 	unsigned long	lst_mtime;
103 	unsigned long	__pad6;
104 
105 	unsigned long	lst_ctime;
106 	unsigned long	__pad7;		/* will be high 32 bits of ctime someday */
107 
108 	unsigned long long	lst_ino;
109 };
110 
111 #endif /* !_M68K_LINUX_TYPES_H */
112