12061Sjkh/*
250479Speter * Copyright (c) 2007 Pawel Jakub Dawidek <pjd@FreeBSD.org>
32061Sjkh * All rights reserved.
438666Sjb *
532427Sjb * Redistribution and use in source and binary forms, with or without
6111131Sru * modification, are permitted provided that the following conditions
7111131Sru * are met:
838666Sjb * 1. Redistributions of source code must retain the above copyright
938666Sjb *    notice, this list of conditions and the following disclaimer.
1038666Sjb * 2. Redistributions in binary form must reproduce the above copyright
11159363Strhodes *    notice, this list of conditions and the following disclaimer in the
1264049Salex *    documentation and/or other materials provided with the distribution.
1364049Salex *
14116679Ssimokawa * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
1566071Smarkm * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16116679Ssimokawa * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1773504Sobrien * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
18158962Snetchild * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1938666Sjb * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20169597Sdes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21169597Sdes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22169597Sdes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23169597Sdes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24169597Sdes * SUCH DAMAGE.
25169597Sdes *
26169597Sdes * $FreeBSD$
27169597Sdes */
2832427Sjb
2938666Sjb#ifndef _SPL_SYS_TYPES_H_
30108451Sschweikh#define	_SPL_SYS_TYPES_H_
3138666Sjb
3238666Sjb#pragma once
3338666Sjb/*
3438666Sjb * This is a bag of dirty hacks to keep things compiling.
3517308Speter */
3691606Skeramida#include_next <sys/types.h>
3719175Sbde
3896205Sjwd#ifdef __ILP32__
39177794Spavtypedef __uint64_t u_longlong_t;
4038042Sbdetypedef __int64_t longlong_t;
4196205Sjwd#else
4296205Sjwdtypedef unsigned long long	u_longlong_t;
4338042Sbdetypedef long long		longlong_t;
4496205Sjwd#endif
45159363Strhodes#include <sys/stdint.h>
46159363Strhodes
4717308Speter#define	_CLOCK_T_DECLARED
4896205Sjwd
4996205Sjwd#include <sys/types32.h>
5017308Speter#include <sys/_stdarg.h>
51148330Snetchild#include <linux/types.h>
52148330Snetchild
53148330Snetchild#define	MAXNAMELEN	256
54148330Snetchild
55159831Sobrien
56148330Snetchild
57148330Snetchildtypedef	void zfs_kernel_param_t;
58148330Snetchild
59148330Snetchildtypedef	struct timespec	timestruc_t;
60178653Srwatsontypedef	struct timespec	timespec_t;
61148330Snetchildtypedef struct timespec inode_timespec_t;
62148330Snetchild/* BEGIN CSTYLED */
6396205Sjwdtypedef u_int		uint_t;
6496205Sjwdtypedef u_char		uchar_t;
6596205Sjwdtypedef u_short		ushort_t;
66162147Srutypedef u_long		ulong_t;
67162147Sru/* END CSTYLED */
6898723Sdillontypedef	int		minor_t;
6998723Sdillon#ifndef	_OFF64_T_DECLARED
7098723Sdillon#define	_OFF64_T_DECLARED
7138666Sjbtypedef off_t		off64_t;
7238666Sjb#endif
7317308Spetertypedef id_t		taskid_t;
74123311Spetertypedef id_t		projid_t;
75123311Spetertypedef id_t		poolid_t;
76123311Spetertypedef uint_t		zoneid_t;
77123311Spetertypedef id_t		ctid_t;
78175833Sjhbtypedef	mode_t		o_mode_t;
79175833Sjhbtypedef	uint64_t	pgcnt_t;
80169597Sdes
81169597Sdestypedef	short		index_t;
82169597Sdestypedef	off_t		offset_t;
83169597Sdes#ifndef _PTRDIFF_T_DECLARED
84159349Simptypedef	__ptrdiff_t		ptrdiff_t;	/* pointer difference */
85158962Snetchild#define	_PTRDIFF_T_DECLARED
86158962Snetchild#endif
87158962Snetchildtypedef	int64_t		rlim64_t;
88156840Srutypedef	int		major_t;
89123311Speter
90137288Speter#ifdef NEED_SOLARIS_BOOLEAN
91147425Sru#if defined(__XOPEN_OR_POSIX)
92156740Srutypedef enum { _B_FALSE, _B_TRUE }	boolean_t;
932061Sjkh#else
9497769Srutypedef enum { B_FALSE, B_TRUE }	boolean_t;
9597252Sru#endif /* defined(__XOPEN_OR_POSIX) */
96119579Sru#else
9797252Sru
9895730Sru#define	B_FALSE	0
9995793Sru#define	B_TRUE	1
100111617Sru
10195730Sru#endif
102116679Ssimokawa
10395730Srutypedef	u_longlong_t	u_offset_t;
104116679Ssimokawatypedef	u_longlong_t	len_t;
10595730Sru
106110035Srutypedef	longlong_t	diskaddr_t;
107107516Sru
108138921Srutypedef void		zidmap_t;
109156145Syar
110138921Sru#include <sys/debug.h>
111133942Sru#endif	/* !_OPENSOLARIS_SYS_TYPES_H_ */
112133942Sru