vki-linux.h revision 497c69e7365352c91422a41583cf3bb5cacc1de1
173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
273b526fb4af0f60634f0078583d92b931d5c0eebnethercote/*--------------------------------------------------------------------*/
34de47b1c9bfe84ddd76a9e71e486c5085c51e3a8njn/*--- Linux-specific kernel interface.                 vki-linux.h ---*/
473b526fb4af0f60634f0078583d92b931d5c0eebnethercote/*--------------------------------------------------------------------*/
573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
673b526fb4af0f60634f0078583d92b931d5c0eebnethercote/*
7b9c427c63a278cc612ae0ec573be7bb1abaa447fnjn   This file is part of Valgrind, a dynamic binary instrumentation
8b9c427c63a278cc612ae0ec573be7bb1abaa447fnjn   framework.
973b526fb4af0f60634f0078583d92b931d5c0eebnethercote
109ebd6e0c607fa30301b1325874eb8de871c21cc5sewardj   Copyright (C) 2000-2007 Julian Seward
1173b526fb4af0f60634f0078583d92b931d5c0eebnethercote      jseward@acm.org
1273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
1373b526fb4af0f60634f0078583d92b931d5c0eebnethercote   This program is free software; you can redistribute it and/or
1473b526fb4af0f60634f0078583d92b931d5c0eebnethercote   modify it under the terms of the GNU General Public License as
1573b526fb4af0f60634f0078583d92b931d5c0eebnethercote   published by the Free Software Foundation; either version 2 of the
1673b526fb4af0f60634f0078583d92b931d5c0eebnethercote   License, or (at your option) any later version.
1773b526fb4af0f60634f0078583d92b931d5c0eebnethercote
1873b526fb4af0f60634f0078583d92b931d5c0eebnethercote   This program is distributed in the hope that it will be useful, but
1973b526fb4af0f60634f0078583d92b931d5c0eebnethercote   WITHOUT ANY WARRANTY; without even the implied warranty of
2073b526fb4af0f60634f0078583d92b931d5c0eebnethercote   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2173b526fb4af0f60634f0078583d92b931d5c0eebnethercote   General Public License for more details.
2273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
2373b526fb4af0f60634f0078583d92b931d5c0eebnethercote   You should have received a copy of the GNU General Public License
2473b526fb4af0f60634f0078583d92b931d5c0eebnethercote   along with this program; if not, write to the Free Software
2573b526fb4af0f60634f0078583d92b931d5c0eebnethercote   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
2673b526fb4af0f60634f0078583d92b931d5c0eebnethercote   02111-1307, USA.
2773b526fb4af0f60634f0078583d92b931d5c0eebnethercote
2873b526fb4af0f60634f0078583d92b931d5c0eebnethercote   The GNU General Public License is contained in the file COPYING.
2973b526fb4af0f60634f0078583d92b931d5c0eebnethercote*/
3073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
3173b526fb4af0f60634f0078583d92b931d5c0eebnethercote/* This file defines types and constants for the kernel interface, and to
3273b526fb4af0f60634f0078583d92b931d5c0eebnethercote   make that clear everything is prefixed VKI_/vki_.
3373b526fb4af0f60634f0078583d92b931d5c0eebnethercote
3473b526fb4af0f60634f0078583d92b931d5c0eebnethercote   All code is copied verbatim from kernel source files, except that:
3573b526fb4af0f60634f0078583d92b931d5c0eebnethercote   - VKI_/vki_ prefixes are added
3673b526fb4af0f60634f0078583d92b931d5c0eebnethercote   - some extra explanatory comments are included;  they are all within
3773b526fb4af0f60634f0078583d92b931d5c0eebnethercote     "[[ ]]"
3873b526fb4af0f60634f0078583d92b931d5c0eebnethercote   - for some types, we only care about the size;  for a few of them (big
3973b526fb4af0f60634f0078583d92b931d5c0eebnethercote     ones that are painful to fully drag in here), a VKI_SIZEOF_* constant
4073b526fb4af0f60634f0078583d92b931d5c0eebnethercote     is used.
4173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
4273b526fb4af0f60634f0078583d92b931d5c0eebnethercote   The files the code is taken from is indicated.
4373b526fb4af0f60634f0078583d92b931d5c0eebnethercote
4473b526fb4af0f60634f0078583d92b931d5c0eebnethercote   Note especially that the types are not the glibc versions, many of which
4573b526fb4af0f60634f0078583d92b931d5c0eebnethercote   are different to those in here.
4673b526fb4af0f60634f0078583d92b931d5c0eebnethercote
47ac7924c7eedce947578c571ae419c4c84eaa5aefnjn   Also note that this file contains all the generic header info, ie. that
48edef146c47eda894495d2b3b71b32b10349f8d91sewardj   from linux/include/linux/ *.h.  The arch-specific header info, eg. that
494de47b1c9bfe84ddd76a9e71e486c5085c51e3a8njn   from linux/include/asm-i386/ *.h, is in vki-$PLATFORM.h and
504de47b1c9bfe84ddd76a9e71e486c5085c51e3a8njn   vki_posixtypes-$PLATFORM.h.  (Two files are required to avoid
51ac7924c7eedce947578c571ae419c4c84eaa5aefnjn   circular dependencies between the generic VKI header and the
52ac7924c7eedce947578c571ae419c4c84eaa5aefnjn   arch-specific VKI header.  It's possible in the future, as more stuff
53ac7924c7eedce947578c571ae419c4c84eaa5aefnjn   gets pulled in, that we might have to split files up some more to avoid
54ac7924c7eedce947578c571ae419c4c84eaa5aefnjn   further circular dependencies.)
55ac7924c7eedce947578c571ae419c4c84eaa5aefnjn
5673b526fb4af0f60634f0078583d92b931d5c0eebnethercote   Finally, note that it is assumed that __KERNEL__ is set for all these
5773b526fb4af0f60634f0078583d92b931d5c0eebnethercote   definitions, which affects some of them.
5873b526fb4af0f60634f0078583d92b931d5c0eebnethercote*/
5973b526fb4af0f60634f0078583d92b931d5c0eebnethercote
604cfea4f9480393ed6799db463b2e0fb8865a1a2fsewardj/* The structure is (aiui, jrs 20060504):
614cfea4f9480393ed6799db463b2e0fb8865a1a2fsewardj
624cfea4f9480393ed6799db463b2e0fb8865a1a2fsewardj     #include plat-specific posix types (vki-posixtypes-ARCH-linux.h)
634cfea4f9480393ed6799db463b2e0fb8865a1a2fsewardj
644cfea4f9480393ed6799db463b2e0fb8865a1a2fsewardj     Lots more types, structs, consts, in this file
654cfea4f9480393ed6799db463b2e0fb8865a1a2fsewardj
664cfea4f9480393ed6799db463b2e0fb8865a1a2fsewardj     #include other plat-specific stuff (vki-ARCH-linux.h)
674cfea4f9480393ed6799db463b2e0fb8865a1a2fsewardj
684cfea4f9480393ed6799db463b2e0fb8865a1a2fsewardj     Even more types, structs, consts, in this file
694cfea4f9480393ed6799db463b2e0fb8865a1a2fsewardj
704cfea4f9480393ed6799db463b2e0fb8865a1a2fsewardj   The system call numbers are dealt with by
714cfea4f9480393ed6799db463b2e0fb8865a1a2fsewardj   pub_{core,tool}_vkiscnums.h, not via pub_{core,tool}_vki.h, which
724cfea4f9480393ed6799db463b2e0fb8865a1a2fsewardj   is what this file is part of.
734cfea4f9480393ed6799db463b2e0fb8865a1a2fsewardj*/
744cfea4f9480393ed6799db463b2e0fb8865a1a2fsewardj
754de47b1c9bfe84ddd76a9e71e486c5085c51e3a8njn#ifndef __VKI_LINUX_H
764de47b1c9bfe84ddd76a9e71e486c5085c51e3a8njn#define __VKI_LINUX_H
7773b526fb4af0f60634f0078583d92b931d5c0eebnethercote
7873b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
7973b526fb4af0f60634f0078583d92b931d5c0eebnethercote// Arch-specific POSIX types
8073b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
8173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
824de47b1c9bfe84ddd76a9e71e486c5085c51e3a8njn#if defined(VGA_x86)
834cfea4f9480393ed6799db463b2e0fb8865a1a2fsewardj#  include "vki-posixtypes-x86-linux.h"
844de47b1c9bfe84ddd76a9e71e486c5085c51e3a8njn#elif defined(VGA_amd64)
854cfea4f9480393ed6799db463b2e0fb8865a1a2fsewardj#  include "vki-posixtypes-amd64-linux.h"
8685665ca6fa29dd64754dabe50eb98f25896e752acerion#elif defined(VGA_ppc32)
874cfea4f9480393ed6799db463b2e0fb8865a1a2fsewardj#  include "vki-posixtypes-ppc32-linux.h"
882c48c7b0a453d32375a4df17e153011b797ef28csewardj#elif defined(VGA_ppc64)
894cfea4f9480393ed6799db463b2e0fb8865a1a2fsewardj#  include "vki-posixtypes-ppc64-linux.h"
904de47b1c9bfe84ddd76a9e71e486c5085c51e3a8njn#else
914de47b1c9bfe84ddd76a9e71e486c5085c51e3a8njn#  error Unknown platform
924de47b1c9bfe84ddd76a9e71e486c5085c51e3a8njn#endif
9373b526fb4af0f60634f0078583d92b931d5c0eebnethercote
9473b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
9573b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/compiler.h
9673b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
9773b526fb4af0f60634f0078583d92b931d5c0eebnethercote
9873b526fb4af0f60634f0078583d92b931d5c0eebnethercote# define __user
9973b526fb4af0f60634f0078583d92b931d5c0eebnethercote
10073b526fb4af0f60634f0078583d92b931d5c0eebnethercote# define __attribute_const__    /* unimplemented */
10173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
10273b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
10373b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/posix_types.h
10473b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
10573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
106f1049bfd7145c4d8ee333bb2a714700e1ab3a049nethercote#undef __VKI_NFDBITS
107f1049bfd7145c4d8ee333bb2a714700e1ab3a049nethercote#define __VKI_NFDBITS	(8 * sizeof(unsigned long))
108f1049bfd7145c4d8ee333bb2a714700e1ab3a049nethercote
109f1049bfd7145c4d8ee333bb2a714700e1ab3a049nethercote#undef __VKI_FD_SETSIZE
110f1049bfd7145c4d8ee333bb2a714700e1ab3a049nethercote#define __VKI_FD_SETSIZE	1024
111f1049bfd7145c4d8ee333bb2a714700e1ab3a049nethercote
112f1049bfd7145c4d8ee333bb2a714700e1ab3a049nethercote#undef __VKI_FDSET_LONGS
113f1049bfd7145c4d8ee333bb2a714700e1ab3a049nethercote#define __VKI_FDSET_LONGS	(__VKI_FD_SETSIZE/__VKI_NFDBITS)
114f1049bfd7145c4d8ee333bb2a714700e1ab3a049nethercote
115f1049bfd7145c4d8ee333bb2a714700e1ab3a049nethercote#undef __VKI_FDELT
116f1049bfd7145c4d8ee333bb2a714700e1ab3a049nethercote#define	__VKI_FDELT(d)	((d) / __VKI_NFDBITS)
117f1049bfd7145c4d8ee333bb2a714700e1ab3a049nethercote
118f1049bfd7145c4d8ee333bb2a714700e1ab3a049nethercote#undef __VKI_FDMASK
119f1049bfd7145c4d8ee333bb2a714700e1ab3a049nethercote#define	__VKI_FDMASK(d)	(1UL << ((d) % __VKI_NFDBITS))
120f1049bfd7145c4d8ee333bb2a714700e1ab3a049nethercote
121f1049bfd7145c4d8ee333bb2a714700e1ab3a049nethercotetypedef struct {
122f1049bfd7145c4d8ee333bb2a714700e1ab3a049nethercote	unsigned long fds_bits [__VKI_FDSET_LONGS];
123f1049bfd7145c4d8ee333bb2a714700e1ab3a049nethercote} __vki_kernel_fd_set;
124f1049bfd7145c4d8ee333bb2a714700e1ab3a049nethercote
12573b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef int __vki_kernel_key_t;
126330abb517e58fd0ee96fda7fb8563e32e029a63enethercotetypedef int __vki_kernel_mqd_t;
12773b526fb4af0f60634f0078583d92b931d5c0eebnethercote
12873b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
12973b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/types.h
13073b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
13173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
132f1049bfd7145c4d8ee333bb2a714700e1ab3a049nethercotetypedef __vki_kernel_fd_set	vki_fd_set;
13373b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef __vki_kernel_mode_t	vki_mode_t;
13473b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef __vki_kernel_off_t	vki_off_t;
13573b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef __vki_kernel_pid_t	vki_pid_t;
13673b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef __vki_kernel_key_t	vki_key_t;
13773b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef __vki_kernel_suseconds_t	vki_suseconds_t;
13873b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef __vki_kernel_timer_t	vki_timer_t;
13992b2fd542e89939b46edfa5c424af81f4a3bfe0cnethercotetypedef __vki_kernel_clockid_t	vki_clockid_t;
140330abb517e58fd0ee96fda7fb8563e32e029a63enethercotetypedef __vki_kernel_mqd_t	vki_mqd_t;
14173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
14273b526fb4af0f60634f0078583d92b931d5c0eebnethercote// [[Nb: it's a bit unclear due to a #ifdef, but I think this is right. --njn]]
14373b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef __vki_kernel_uid32_t	vki_uid_t;
14473b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef __vki_kernel_gid32_t	vki_gid_t;
14573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
146c6851dde1b46166417a2bdb096c05818f5f07f09nethercotetypedef __vki_kernel_old_uid_t	vki_old_uid_t;
147c6851dde1b46166417a2bdb096c05818f5f07f09nethercotetypedef __vki_kernel_old_gid_t	vki_old_gid_t;
148c6851dde1b46166417a2bdb096c05818f5f07f09nethercote
14973b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef __vki_kernel_loff_t	vki_loff_t;
15073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
15173b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef __vki_kernel_size_t	vki_size_t;
15273b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef __vki_kernel_time_t	vki_time_t;
15373b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef __vki_kernel_clock_t	vki_clock_t;
15473b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef __vki_kernel_caddr_t	vki_caddr_t;
15573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
1565b653bc2c60f6913e5bb6c2ebabfcf705a90c012nethercotetypedef unsigned long           vki_u_long;
1575b653bc2c60f6913e5bb6c2ebabfcf705a90c012nethercote
1587f7e4d1ac0c4ea8bf771e5490b69d0e4d619dfe9nethercotetypedef unsigned int	        vki_uint;
1597f7e4d1ac0c4ea8bf771e5490b69d0e4d619dfe9nethercote
16073b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
16173b526fb4af0f60634f0078583d92b931d5c0eebnethercote// Now the rest of the arch-specific stuff
16273b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
16373b526fb4af0f60634f0078583d92b931d5c0eebnethercote
1644de47b1c9bfe84ddd76a9e71e486c5085c51e3a8njn#if defined(VGA_x86)
1654de47b1c9bfe84ddd76a9e71e486c5085c51e3a8njn#  include "vki-x86-linux.h"
1664de47b1c9bfe84ddd76a9e71e486c5085c51e3a8njn#elif defined(VGA_amd64)
1674de47b1c9bfe84ddd76a9e71e486c5085c51e3a8njn#  include "vki-amd64-linux.h"
16885665ca6fa29dd64754dabe50eb98f25896e752acerion#elif defined(VGA_ppc32)
16985665ca6fa29dd64754dabe50eb98f25896e752acerion#  include "vki-ppc32-linux.h"
1702c48c7b0a453d32375a4df17e153011b797ef28csewardj#elif defined(VGA_ppc64)
1712c48c7b0a453d32375a4df17e153011b797ef28csewardj#  include "vki-ppc64-linux.h"
1724de47b1c9bfe84ddd76a9e71e486c5085c51e3a8njn#else
1734de47b1c9bfe84ddd76a9e71e486c5085c51e3a8njn#  error Unknown platform
1744de47b1c9bfe84ddd76a9e71e486c5085c51e3a8njn#endif
17573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
17673b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
1777f4d7e42a880cd0872f93f5178a723beb56941a4tom// From linux-2.6.20.1/include/linux/types.h
1787f4d7e42a880cd0872f93f5178a723beb56941a4tom//----------------------------------------------------------------------
1797f4d7e42a880cd0872f93f5178a723beb56941a4tom
1807f4d7e42a880cd0872f93f5178a723beb56941a4tomtypedef		__vki_s32	vki_int32_t;
1817f4d7e42a880cd0872f93f5178a723beb56941a4tom
1827f4d7e42a880cd0872f93f5178a723beb56941a4tomtypedef		__vki_u32	vki_uint32_t;
1837f4d7e42a880cd0872f93f5178a723beb56941a4tom
1847f4d7e42a880cd0872f93f5178a723beb56941a4tom//----------------------------------------------------------------------
18573b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/limits.h
18673b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
18773b526fb4af0f60634f0078583d92b931d5c0eebnethercote
18873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_PATH_MAX       4096	/* # chars in a path name including nul */
18973b526fb4af0f60634f0078583d92b931d5c0eebnethercote
19073b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
19173b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/kernel.h
19273b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
19373b526fb4af0f60634f0078583d92b931d5c0eebnethercote
19473b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_sysinfo {
19573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long uptime;			/* Seconds since boot */
19673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long loads[3];		/* 1, 5, and 15 minute load averages */
19773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long totalram;		/* Total usable main memory size */
19873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long freeram;		/* Available memory size */
19973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long sharedram;	/* Amount of shared memory */
20073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long bufferram;	/* Memory used by buffers */
20173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long totalswap;	/* Total swap space size */
20273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long freeswap;		/* swap space still available */
20373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short procs;		/* Number of current processes */
20473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short pad;		/* explicit padding for m68k */
20573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long totalhigh;	/* Total high memory size */
20673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long freehigh;		/* Available high memory size */
20773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned int mem_unit;		/* Memory unit size in bytes */
20873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	char _f[20-2*sizeof(long)-sizeof(int)];	/* Padding: libc5 uses this.. */
20973b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
21073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
21173b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
21273b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/time.h
21373b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
21473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
21573b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_timespec {
21673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	vki_time_t	tv_sec;		/* seconds */
21773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long		tv_nsec;	/* nanoseconds */
21873b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
21973b526fb4af0f60634f0078583d92b931d5c0eebnethercote
22073b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_timeval {
22173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	vki_time_t	tv_sec;		/* seconds */
22273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	vki_suseconds_t	tv_usec;	/* microseconds */
22373b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
22473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
22573b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_timezone {
22673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int	tz_minuteswest;	/* minutes west of Greenwich */
22773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int	tz_dsttime;	/* type of dst correction */
22873b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
22973b526fb4af0f60634f0078583d92b931d5c0eebnethercote
23073b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct  vki_itimerspec {
23173b526fb4af0f60634f0078583d92b931d5c0eebnethercote        struct  vki_timespec it_interval;    /* timer period */
23273b526fb4af0f60634f0078583d92b931d5c0eebnethercote        struct  vki_timespec it_value;       /* timer expiration */
23373b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
23473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
23573b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct	vki_itimerval {
23673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	struct	vki_timeval it_interval;	/* timer interval */
23773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	struct	vki_timeval it_value;	/* current value */
23873b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
23973b526fb4af0f60634f0078583d92b931d5c0eebnethercote
24073b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
24173b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/timex.h
24273b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
24373b526fb4af0f60634f0078583d92b931d5c0eebnethercote
24473b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_timex {
24573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned int modes;	/* mode selector */
24673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long offset;		/* time offset (usec) */
24773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long freq;		/* frequency offset (scaled ppm) */
24873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long maxerror;		/* maximum error (usec) */
24973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long esterror;		/* estimated error (usec) */
25073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int status;		/* clock command/status */
25173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long constant;		/* pll time constant */
25273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long precision;		/* clock precision (usec) (read only) */
25373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long tolerance;		/* clock frequency tolerance (ppm)
25473b526fb4af0f60634f0078583d92b931d5c0eebnethercote				 * (read only)
25573b526fb4af0f60634f0078583d92b931d5c0eebnethercote				 */
25673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	struct vki_timeval time;	/* (read only) */
25773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long tick;		/* (modified) usecs between clock ticks */
25873b526fb4af0f60634f0078583d92b931d5c0eebnethercote
25973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long ppsfreq;           /* pps frequency (scaled ppm) (ro) */
26073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long jitter;            /* pps jitter (us) (ro) */
26173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int shift;              /* interval duration (s) (shift) (ro) */
26273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long stabil;            /* pps stability (scaled ppm) (ro) */
26373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long jitcnt;            /* jitter limit exceeded (ro) */
26473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long calcnt;            /* calibration intervals (ro) */
26573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long errcnt;            /* calibration errors (ro) */
26673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long stbcnt;            /* stability limit exceeded (ro) */
26773b526fb4af0f60634f0078583d92b931d5c0eebnethercote
26873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int  :32; int  :32; int  :32; int  :32;
26973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int  :32; int  :32; int  :32; int  :32;
27073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int  :32; int  :32; int  :32; int  :32;
27173b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
27273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
27373b526fb4af0f60634f0078583d92b931d5c0eebnethercote//#define ADJ_OFFSET		0x0001	/* time offset */
27473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define ADJ_FREQUENCY		0x0002	/* frequency offset */
27573b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define ADJ_MAXERROR		0x0004	/* maximum time error */
27673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define ADJ_ESTERROR		0x0008	/* estimated time error */
27773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define ADJ_STATUS		0x0010	/* clock status */
27873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define ADJ_TIMECONST		0x0020	/* pll time constant */
27973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define ADJ_TICK		0x4000	/* tick value */
28073b526fb4af0f60634f0078583d92b931d5c0eebnethercote//#define ADJ_OFFSET_SINGLESHOT	0x8001	/* old-fashioned adjtime */
28173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
28273b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
28373b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/times.h
28473b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
28573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
28673b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_tms {
28773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	vki_clock_t tms_utime;
28873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	vki_clock_t tms_stime;
28973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	vki_clock_t tms_cutime;
29073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	vki_clock_t tms_cstime;
29173b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
29273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
29373b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
29473b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/utime.h
29573b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
29673b526fb4af0f60634f0078583d92b931d5c0eebnethercote
29773b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_utimbuf {
29873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	vki_time_t actime;
29973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	vki_time_t modtime;
30073b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
30173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
30273b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
30373b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/sched.h
30473b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
30573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
306b5f6f51ebcac183818061bf53427a3e7808ef10dsewardj#define VKI_CSIGNAL		0x000000ff	/* signal mask to be sent at exit */
30773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_CLONE_VM		0x00000100	/* set if VM shared between processes */
30873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_CLONE_FS		0x00000200	/* set if fs info shared between processes */
30973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_CLONE_FILES		0x00000400	/* set if open files shared between processes */
31073b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_CLONE_SIGHAND	0x00000800	/* set if signal handlers and blocked signals shared */
311b5f6f51ebcac183818061bf53427a3e7808ef10dsewardj#define VKI_CLONE_VFORK		0x00004000	/* set if the parent wants the child to wake it up on mm_release */
312b5f6f51ebcac183818061bf53427a3e7808ef10dsewardj#define VKI_CLONE_PARENT	0x00008000	/* set if we want to have the same parent as the cloner */
31373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_CLONE_THREAD	0x00010000	/* Same thread group? */
314b5f6f51ebcac183818061bf53427a3e7808ef10dsewardj#define VKI_CLONE_SYSVSEM	0x00040000	/* share system V SEM_UNDO semantics */
315b5f6f51ebcac183818061bf53427a3e7808ef10dsewardj#define VKI_CLONE_SETTLS	0x00080000	/* create a new TLS for the child */
31673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_CLONE_PARENT_SETTID	0x00100000	/* set the TID in the parent */
31773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_CLONE_CHILD_CLEARTID	0x00200000	/* clear the TID in the child */
31873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_CLONE_DETACHED	0x00400000	/* Unused, ignored */
31973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_CLONE_CHILD_SETTID	0x01000000	/* set the TID in the child */
32073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
32173b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_sched_param {
32273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int sched_priority;
32373b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
32473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
325a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom#define VKI_TASK_COMM_LEN 16
326a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom
32773b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
32873b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/asm-generic/siginfo.h
32973b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
33073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
33173b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef union vki_sigval {
33273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int sival_int;
33373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	void __user *sival_ptr;
33473b526fb4af0f60634f0078583d92b931d5c0eebnethercote} vki_sigval_t;
33573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
33673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#ifndef __VKI_ARCH_SI_PREAMBLE_SIZE
33773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define __VKI_ARCH_SI_PREAMBLE_SIZE	(3 * sizeof(int))
33873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#endif
33973b526fb4af0f60634f0078583d92b931d5c0eebnethercote
34073b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SI_MAX_SIZE	128
34173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
34273b526fb4af0f60634f0078583d92b931d5c0eebnethercote#ifndef VKI_SI_PAD_SIZE
34373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SI_PAD_SIZE	((VKI_SI_MAX_SIZE - __VKI_ARCH_SI_PREAMBLE_SIZE) / sizeof(int))
34473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#endif
34573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
34673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#ifndef __VKI_ARCH_SI_UID_T
34773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define __VKI_ARCH_SI_UID_T	vki_uid_t
34873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#endif
34973b526fb4af0f60634f0078583d92b931d5c0eebnethercote
35073b526fb4af0f60634f0078583d92b931d5c0eebnethercote#ifndef __VKI_ARCH_SI_BAND_T
35173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define __VKI_ARCH_SI_BAND_T long
35273b526fb4af0f60634f0078583d92b931d5c0eebnethercote#endif
35373b526fb4af0f60634f0078583d92b931d5c0eebnethercote
35473b526fb4af0f60634f0078583d92b931d5c0eebnethercote// [[Nb: this type changed between 2.4 and 2.6, but not in a way that
35573b526fb4af0f60634f0078583d92b931d5c0eebnethercote// affects Valgrind.]]
35673b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef struct vki_siginfo {
35773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int si_signo;
35873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int si_errno;
35973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int si_code;
36073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
36173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	union {
36273b526fb4af0f60634f0078583d92b931d5c0eebnethercote		int _pad[VKI_SI_PAD_SIZE];
36373b526fb4af0f60634f0078583d92b931d5c0eebnethercote
36473b526fb4af0f60634f0078583d92b931d5c0eebnethercote		/* kill() */
36573b526fb4af0f60634f0078583d92b931d5c0eebnethercote		struct {
36673b526fb4af0f60634f0078583d92b931d5c0eebnethercote			vki_pid_t _pid;		/* sender's pid */
36773b526fb4af0f60634f0078583d92b931d5c0eebnethercote			__VKI_ARCH_SI_UID_T _uid;	/* sender's uid */
36873b526fb4af0f60634f0078583d92b931d5c0eebnethercote		} _kill;
36973b526fb4af0f60634f0078583d92b931d5c0eebnethercote
37073b526fb4af0f60634f0078583d92b931d5c0eebnethercote		/* POSIX.1b timers */
37173b526fb4af0f60634f0078583d92b931d5c0eebnethercote		struct {
37273b526fb4af0f60634f0078583d92b931d5c0eebnethercote			vki_timer_t _tid;		/* timer id */
37373b526fb4af0f60634f0078583d92b931d5c0eebnethercote			int _overrun;		/* overrun count */
37473b526fb4af0f60634f0078583d92b931d5c0eebnethercote			char _pad[sizeof( __VKI_ARCH_SI_UID_T) - sizeof(int)];
37573b526fb4af0f60634f0078583d92b931d5c0eebnethercote			vki_sigval_t _sigval;	/* same as below */
37673b526fb4af0f60634f0078583d92b931d5c0eebnethercote			int _sys_private;       /* not to be passed to user */
37773b526fb4af0f60634f0078583d92b931d5c0eebnethercote		} _timer;
37873b526fb4af0f60634f0078583d92b931d5c0eebnethercote
37973b526fb4af0f60634f0078583d92b931d5c0eebnethercote		/* POSIX.1b signals */
38073b526fb4af0f60634f0078583d92b931d5c0eebnethercote		struct {
38173b526fb4af0f60634f0078583d92b931d5c0eebnethercote			vki_pid_t _pid;		/* sender's pid */
38273b526fb4af0f60634f0078583d92b931d5c0eebnethercote			__VKI_ARCH_SI_UID_T _uid;	/* sender's uid */
38373b526fb4af0f60634f0078583d92b931d5c0eebnethercote			vki_sigval_t _sigval;
38473b526fb4af0f60634f0078583d92b931d5c0eebnethercote		} _rt;
38573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
38673b526fb4af0f60634f0078583d92b931d5c0eebnethercote		/* SIGCHLD */
38773b526fb4af0f60634f0078583d92b931d5c0eebnethercote		struct {
38873b526fb4af0f60634f0078583d92b931d5c0eebnethercote			vki_pid_t _pid;		/* which child */
38973b526fb4af0f60634f0078583d92b931d5c0eebnethercote			__VKI_ARCH_SI_UID_T _uid;	/* sender's uid */
39073b526fb4af0f60634f0078583d92b931d5c0eebnethercote			int _status;		/* exit code */
39173b526fb4af0f60634f0078583d92b931d5c0eebnethercote			vki_clock_t _utime;
39273b526fb4af0f60634f0078583d92b931d5c0eebnethercote			vki_clock_t _stime;
39373b526fb4af0f60634f0078583d92b931d5c0eebnethercote		} _sigchld;
39473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
39573b526fb4af0f60634f0078583d92b931d5c0eebnethercote		/* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
39673b526fb4af0f60634f0078583d92b931d5c0eebnethercote		struct {
39773b526fb4af0f60634f0078583d92b931d5c0eebnethercote			void __user *_addr; /* faulting insn/memory ref. */
39873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#ifdef __ARCH_SI_TRAPNO
39973b526fb4af0f60634f0078583d92b931d5c0eebnethercote			int _trapno;	/* TRAP # which caused the signal */
40073b526fb4af0f60634f0078583d92b931d5c0eebnethercote#endif
40173b526fb4af0f60634f0078583d92b931d5c0eebnethercote		} _sigfault;
40273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
40373b526fb4af0f60634f0078583d92b931d5c0eebnethercote		/* SIGPOLL */
40473b526fb4af0f60634f0078583d92b931d5c0eebnethercote		struct {
40573b526fb4af0f60634f0078583d92b931d5c0eebnethercote			__VKI_ARCH_SI_BAND_T _band;	/* POLL_IN, POLL_OUT, POLL_MSG */
40673b526fb4af0f60634f0078583d92b931d5c0eebnethercote			int _fd;
40773b526fb4af0f60634f0078583d92b931d5c0eebnethercote		} _sigpoll;
40873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	} _sifields;
40973b526fb4af0f60634f0078583d92b931d5c0eebnethercote} vki_siginfo_t;
41073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
411148250b9e89daa1073929da9df5fe6c8896b159ctom#define __VKI_SI_FAULT	0
412148250b9e89daa1073929da9df5fe6c8896b159ctom
41373b526fb4af0f60634f0078583d92b931d5c0eebnethercote/*
41473b526fb4af0f60634f0078583d92b931d5c0eebnethercote * si_code values
41573b526fb4af0f60634f0078583d92b931d5c0eebnethercote * Digital reserves positive values for kernel-generated signals.
41673b526fb4af0f60634f0078583d92b931d5c0eebnethercote */
41773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SI_USER	0		/* sent by kill, sigsend, raise */
41873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SI_TKILL	-6		/* sent by tkill system call */
41973b526fb4af0f60634f0078583d92b931d5c0eebnethercote
420e7203a89c1e39fb1abcebebf515f62bc4c68b2c4tom/*
421148250b9e89daa1073929da9df5fe6c8896b159ctom * SIGILL si_codes
422148250b9e89daa1073929da9df5fe6c8896b159ctom */
423148250b9e89daa1073929da9df5fe6c8896b159ctom#define VKI_ILL_ILLOPC	(__VKI_SI_FAULT|1)	/* illegal opcode */
424148250b9e89daa1073929da9df5fe6c8896b159ctom#define VKI_ILL_ILLOPN	(__VKI_SI_FAULT|2)	/* illegal operand */
425148250b9e89daa1073929da9df5fe6c8896b159ctom#define VKI_ILL_ILLADR	(__VKI_SI_FAULT|3)	/* illegal addressing mode */
426148250b9e89daa1073929da9df5fe6c8896b159ctom#define VKI_ILL_ILLTRP	(__VKI_SI_FAULT|4)	/* illegal trap */
427148250b9e89daa1073929da9df5fe6c8896b159ctom#define VKI_ILL_PRVOPC	(__VKI_SI_FAULT|5)	/* privileged opcode */
428148250b9e89daa1073929da9df5fe6c8896b159ctom#define VKI_ILL_PRVREG	(__VKI_SI_FAULT|6)	/* privileged register */
429148250b9e89daa1073929da9df5fe6c8896b159ctom#define VKI_ILL_COPROC	(__VKI_SI_FAULT|7)	/* coprocessor error */
430148250b9e89daa1073929da9df5fe6c8896b159ctom#define VKI_ILL_BADSTK	(__VKI_SI_FAULT|8)	/* internal stack error */
431148250b9e89daa1073929da9df5fe6c8896b159ctom
432148250b9e89daa1073929da9df5fe6c8896b159ctom/*
433148250b9e89daa1073929da9df5fe6c8896b159ctom * SIGFPE si_codes
434148250b9e89daa1073929da9df5fe6c8896b159ctom */
435148250b9e89daa1073929da9df5fe6c8896b159ctom#define VKI_FPE_INTDIV	(__VKI_SI_FAULT|1)	/* integer divide by zero */
436148250b9e89daa1073929da9df5fe6c8896b159ctom#define VKI_FPE_INTOVF	(__VKI_SI_FAULT|2)	/* integer overflow */
437148250b9e89daa1073929da9df5fe6c8896b159ctom#define VKI_FPE_FLTDIV	(__VKI_SI_FAULT|3)	/* floating point divide by zero */
438148250b9e89daa1073929da9df5fe6c8896b159ctom#define VKI_FPE_FLTOVF	(__VKI_SI_FAULT|4)	/* floating point overflow */
439148250b9e89daa1073929da9df5fe6c8896b159ctom#define VKI_FPE_FLTUND	(__VKI_SI_FAULT|5)	/* floating point underflow */
440148250b9e89daa1073929da9df5fe6c8896b159ctom#define VKI_FPE_FLTRES	(__VKI_SI_FAULT|6)	/* floating point inexact result */
441148250b9e89daa1073929da9df5fe6c8896b159ctom#define VKI_FPE_FLTINV	(__VKI_SI_FAULT|7)	/* floating point invalid operation */
442148250b9e89daa1073929da9df5fe6c8896b159ctom#define VKI_FPE_FLTSUB	(__VKI_SI_FAULT|8)	/* subscript out of range */
443148250b9e89daa1073929da9df5fe6c8896b159ctom
444148250b9e89daa1073929da9df5fe6c8896b159ctom/*
445148250b9e89daa1073929da9df5fe6c8896b159ctom * SIGSEGV si_codes
446148250b9e89daa1073929da9df5fe6c8896b159ctom */
447148250b9e89daa1073929da9df5fe6c8896b159ctom#define VKI_SEGV_MAPERR	(__VKI_SI_FAULT|1)	/* address not mapped to object */
448148250b9e89daa1073929da9df5fe6c8896b159ctom#define VKI_SEGV_ACCERR	(__VKI_SI_FAULT|2)	/* invalid permissions for mapped object */
449148250b9e89daa1073929da9df5fe6c8896b159ctom
450148250b9e89daa1073929da9df5fe6c8896b159ctom/*
451148250b9e89daa1073929da9df5fe6c8896b159ctom * SIGBUS si_codes
452148250b9e89daa1073929da9df5fe6c8896b159ctom */
453148250b9e89daa1073929da9df5fe6c8896b159ctom#define VKI_BUS_ADRALN	(__VKI_SI_FAULT|1)	/* invalid address alignment */
454148250b9e89daa1073929da9df5fe6c8896b159ctom#define VKI_BUS_ADRERR	(__VKI_SI_FAULT|2)	/* non-existant physical address */
455148250b9e89daa1073929da9df5fe6c8896b159ctom#define VKI_BUS_OBJERR	(__VKI_SI_FAULT|3)	/* object specific hardware error */
456148250b9e89daa1073929da9df5fe6c8896b159ctom
457148250b9e89daa1073929da9df5fe6c8896b159ctom/*
45886df1559d94314c7385f79ec7f80a7063cb3e1e6sewardj * SIGTRAP si_codes
45986df1559d94314c7385f79ec7f80a7063cb3e1e6sewardj */
46086df1559d94314c7385f79ec7f80a7063cb3e1e6sewardj#define VKI_TRAP_BRKPT      (__VKI_SI_FAULT|1)  /* process breakpoint */
46186df1559d94314c7385f79ec7f80a7063cb3e1e6sewardj#define VKI_TRAP_TRACE      (__VKI_SI_FAULT|2)  /* process trace trap */
46286df1559d94314c7385f79ec7f80a7063cb3e1e6sewardj
46386df1559d94314c7385f79ec7f80a7063cb3e1e6sewardj/*
464e7203a89c1e39fb1abcebebf515f62bc4c68b2c4tom * This works because the alignment is ok on all current architectures
465e7203a89c1e39fb1abcebebf515f62bc4c68b2c4tom * but we leave open this being overridden in the future
466e7203a89c1e39fb1abcebebf515f62bc4c68b2c4tom */
467e7203a89c1e39fb1abcebebf515f62bc4c68b2c4tom#ifndef VKI___ARCH_SIGEV_PREAMBLE_SIZE
468e7203a89c1e39fb1abcebebf515f62bc4c68b2c4tom#define VKI___ARCH_SIGEV_PREAMBLE_SIZE	(sizeof(int) * 2 + sizeof(vki_sigval_t))
46973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#endif
47073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
471e7203a89c1e39fb1abcebebf515f62bc4c68b2c4tom#define VKI_SIGEV_MAX_SIZE	64
472e7203a89c1e39fb1abcebebf515f62bc4c68b2c4tom#define VKI_SIGEV_PAD_SIZE	((VKI_SIGEV_MAX_SIZE - VKI___ARCH_SIGEV_PREAMBLE_SIZE) \
473e7203a89c1e39fb1abcebebf515f62bc4c68b2c4tom		/ sizeof(int))
47473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
47573b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef struct vki_sigevent {
47673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	vki_sigval_t sigev_value;
47773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int sigev_signo;
47873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int sigev_notify;
47973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	union {
48073b526fb4af0f60634f0078583d92b931d5c0eebnethercote		int _pad[VKI_SIGEV_PAD_SIZE];
48173b526fb4af0f60634f0078583d92b931d5c0eebnethercote		 int _tid;
48273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
48373b526fb4af0f60634f0078583d92b931d5c0eebnethercote		struct {
48473b526fb4af0f60634f0078583d92b931d5c0eebnethercote			void (*_function)(vki_sigval_t);
48573b526fb4af0f60634f0078583d92b931d5c0eebnethercote			void *_attribute;	/* really pthread_attr_t */
48673b526fb4af0f60634f0078583d92b931d5c0eebnethercote		} _sigev_thread;
48773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	} _sigev_un;
48873b526fb4af0f60634f0078583d92b931d5c0eebnethercote} vki_sigevent_t;
48973b526fb4af0f60634f0078583d92b931d5c0eebnethercote
49073b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
49173b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From elsewhere...
49273b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
49373b526fb4af0f60634f0078583d92b931d5c0eebnethercote
49473b526fb4af0f60634f0078583d92b931d5c0eebnethercote// [[The kernel actually uses the numbers 0,1,2 directly here, believe it or
49573b526fb4af0f60634f0078583d92b931d5c0eebnethercote// not.  So we introduce our own constants, based on the glibc ones.]]
49673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SEEK_SET              0
49773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SEEK_CUR              1
49873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SEEK_END              2
49973b526fb4af0f60634f0078583d92b931d5c0eebnethercote
50073b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
50173b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/net.h
50273b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
50373b526fb4af0f60634f0078583d92b931d5c0eebnethercote
50473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SYS_SOCKET		1	/* sys_socket(2)		*/
50573b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SYS_BIND		2	/* sys_bind(2)			*/
50673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SYS_CONNECT		3	/* sys_connect(2)		*/
50773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SYS_LISTEN		4	/* sys_listen(2)		*/
50873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SYS_ACCEPT		5	/* sys_accept(2)		*/
50973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SYS_GETSOCKNAME	6	/* sys_getsockname(2)		*/
51073b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SYS_GETPEERNAME	7	/* sys_getpeername(2)		*/
51173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SYS_SOCKETPAIR	8	/* sys_socketpair(2)		*/
51273b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SYS_SEND		9	/* sys_send(2)			*/
51373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SYS_RECV		10	/* sys_recv(2)			*/
51473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SYS_SENDTO		11	/* sys_sendto(2)		*/
51573b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SYS_RECVFROM	12	/* sys_recvfrom(2)		*/
51673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SYS_SHUTDOWN	13	/* sys_shutdown(2)		*/
51773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SYS_SETSOCKOPT	14	/* sys_setsockopt(2)		*/
51873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SYS_GETSOCKOPT	15	/* sys_getsockopt(2)		*/
51973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SYS_SENDMSG		16	/* sys_sendmsg(2)		*/
52073b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SYS_RECVMSG		17	/* sys_recvmsg(2)		*/
52173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
522ca0518df66f8c3375a860f1a55a51f18e2a16c44njnenum vki_sock_type {
523ca0518df66f8c3375a860f1a55a51f18e2a16c44njn	VKI_SOCK_STREAM	= 1,
524ca0518df66f8c3375a860f1a55a51f18e2a16c44njn	// [[others omitted]]
525ca0518df66f8c3375a860f1a55a51f18e2a16c44njn};
526ca0518df66f8c3375a860f1a55a51f18e2a16c44njn
52773b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
52873b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/uio.h
52973b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
53073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
53173b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_iovec
53273b526fb4af0f60634f0078583d92b931d5c0eebnethercote{
53373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	void __user *iov_base;	/* BSD uses caddr_t (1003.1g requires void *) */
53473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_size_t iov_len; /* Must be size_t (1003.1g) */
53573b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
53673b526fb4af0f60634f0078583d92b931d5c0eebnethercote
53773b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
53873b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/socket.h
53973b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
54073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
54173b526fb4af0f60634f0078583d92b931d5c0eebnethercote// [[Resolved arbitrarily;  doesn't really matter whether it's '__inline__'
54273b526fb4af0f60634f0078583d92b931d5c0eebnethercote//   or 'inline']]
54373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define __KINLINE static __inline__
54473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
54573b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef unsigned short	vki_sa_family_t;
54673b526fb4af0f60634f0078583d92b931d5c0eebnethercote
54773b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_sockaddr {
54873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	vki_sa_family_t	sa_family;	/* address family, AF_xxx	*/
54973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	char		sa_data[14];	/* 14 bytes of protocol address	*/
55073b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
55173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
55273b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_msghdr {
55373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	void	*	msg_name;	/* Socket name			*/
55473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int		msg_namelen;	/* Length of name		*/
55573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	struct vki_iovec *	msg_iov;	/* Data blocks			*/
55673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_size_t	msg_iovlen;	/* Number of blocks		*/
55773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	void 	*	msg_control;	/* Per protocol magic (eg BSD file descriptor passing) */
55873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_size_t	msg_controllen;	/* Length of cmsg list */
55973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned	msg_flags;
56073b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
56173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
56273b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_cmsghdr {
56373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_size_t	cmsg_len;	/* data byte count, including hdr */
56473b526fb4af0f60634f0078583d92b931d5c0eebnethercote        int		cmsg_level;	/* originating protocol */
56573b526fb4af0f60634f0078583d92b931d5c0eebnethercote        int		cmsg_type;	/* protocol-specific type */
56673b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
56773b526fb4af0f60634f0078583d92b931d5c0eebnethercote
56873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define __VKI_CMSG_NXTHDR(ctl, len, cmsg) __vki_cmsg_nxthdr((ctl),(len),(cmsg))
56973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_CMSG_NXTHDR(mhdr, cmsg) vki_cmsg_nxthdr((mhdr), (cmsg))
57073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
57173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_CMSG_ALIGN(len) ( ((len)+sizeof(long)-1) & ~(sizeof(long)-1) )
57273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
57373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_CMSG_DATA(cmsg)	((void *)((char *)(cmsg) + VKI_CMSG_ALIGN(sizeof(struct vki_cmsghdr))))
57473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
57573b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define __VKI_CMSG_FIRSTHDR(ctl,len) ((len) >= sizeof(struct vki_cmsghdr) ? \
57673b526fb4af0f60634f0078583d92b931d5c0eebnethercote				  (struct vki_cmsghdr *)(ctl) : \
57773b526fb4af0f60634f0078583d92b931d5c0eebnethercote				  (struct vki_cmsghdr *)NULL)
57873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_CMSG_FIRSTHDR(msg)	__VKI_CMSG_FIRSTHDR((msg)->msg_control, (msg)->msg_controllen)
57973b526fb4af0f60634f0078583d92b931d5c0eebnethercote
58073b526fb4af0f60634f0078583d92b931d5c0eebnethercote// [[Urgh, this is revolting...]
58173b526fb4af0f60634f0078583d92b931d5c0eebnethercote__KINLINE struct vki_cmsghdr * __vki_cmsg_nxthdr(void *__ctl, __vki_kernel_size_t __size,
58273b526fb4af0f60634f0078583d92b931d5c0eebnethercote					       struct vki_cmsghdr *__cmsg)
58373b526fb4af0f60634f0078583d92b931d5c0eebnethercote{
58473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	struct vki_cmsghdr * __ptr;
58573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
58673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__ptr = (struct vki_cmsghdr*)(((unsigned char *) __cmsg) +  VKI_CMSG_ALIGN(__cmsg->cmsg_len));
58773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	if ((unsigned long)((char*)(__ptr+1) - (char *) __ctl) > __size)
58873b526fb4af0f60634f0078583d92b931d5c0eebnethercote		return (struct vki_cmsghdr *)0;
58973b526fb4af0f60634f0078583d92b931d5c0eebnethercote
59073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	return __ptr;
59173b526fb4af0f60634f0078583d92b931d5c0eebnethercote}
59273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
59373b526fb4af0f60634f0078583d92b931d5c0eebnethercote__KINLINE struct vki_cmsghdr * vki_cmsg_nxthdr (struct vki_msghdr *__msg, struct vki_cmsghdr *__cmsg)
59473b526fb4af0f60634f0078583d92b931d5c0eebnethercote{
59573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	return __vki_cmsg_nxthdr(__msg->msg_control, __msg->msg_controllen, __cmsg);
59673b526fb4af0f60634f0078583d92b931d5c0eebnethercote}
59773b526fb4af0f60634f0078583d92b931d5c0eebnethercote
59873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define	VKI_SCM_RIGHTS	0x01		/* rw: access rights (array of int) */
59973b526fb4af0f60634f0078583d92b931d5c0eebnethercote
60073b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_AF_UNIX	1	/* Unix domain sockets 		*/
60173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_AF_INET	2	/* Internet IP Protocol		*/
60273b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_AF_INET6	10	/* IP version 6			*/
60373b526fb4af0f60634f0078583d92b931d5c0eebnethercote
60473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_MSG_NOSIGNAL	0x4000	/* Do not generate SIGPIPE */
60573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
6061aa57373be5343c365ee6b480e205abc16008402tom#define VKI_SOL_SCTP	132
6071aa57373be5343c365ee6b480e205abc16008402tom
60873b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
60973b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/in.h
61073b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
61173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
61273b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_in_addr {
61373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32	s_addr;
61473b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
61573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
61673b526fb4af0f60634f0078583d92b931d5c0eebnethercote/* Structure describing an Internet (IP) socket address. */
61773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define __VKI_SOCK_SIZE__	16	/* sizeof(struct sockaddr)	*/
61873b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_sockaddr_in {
61973b526fb4af0f60634f0078583d92b931d5c0eebnethercote  vki_sa_family_t	sin_family;	/* Address family		*/
62073b526fb4af0f60634f0078583d92b931d5c0eebnethercote  unsigned short int	sin_port;	/* Port number			*/
62173b526fb4af0f60634f0078583d92b931d5c0eebnethercote  struct vki_in_addr	sin_addr;	/* Internet address		*/
62273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
62373b526fb4af0f60634f0078583d92b931d5c0eebnethercote  /* Pad to size of `struct sockaddr'. */
62473b526fb4af0f60634f0078583d92b931d5c0eebnethercote  unsigned char		__pad[__VKI_SOCK_SIZE__ - sizeof(short int) -
62573b526fb4af0f60634f0078583d92b931d5c0eebnethercote			sizeof(unsigned short int) - sizeof(struct vki_in_addr)];
62673b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
62773b526fb4af0f60634f0078583d92b931d5c0eebnethercote
62873b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
62973b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/in6.h
63073b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
63173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
63273b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_in6_addr
63373b526fb4af0f60634f0078583d92b931d5c0eebnethercote{
63473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	union
63573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	{
63673b526fb4af0f60634f0078583d92b931d5c0eebnethercote		__vki_u8	u6_addr8[16];
63773b526fb4af0f60634f0078583d92b931d5c0eebnethercote		__vki_u16	u6_addr16[8];
63873b526fb4af0f60634f0078583d92b931d5c0eebnethercote		__vki_u32	u6_addr32[4];
63973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	} vki_in6_u;
64073b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define vki_s6_addr		vki_in6_u.u6_addr8
64173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define vki_s6_addr16		vki_in6_u.u6_addr16
64273b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define vki_s6_addr32		vki_in6_u.u6_addr32
64373b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
64473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
64573b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_sockaddr_in6 {
64673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short int	sin6_family;    /* AF_INET6 */
64773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u16		sin6_port;      /* Transport layer port # */
64873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32		sin6_flowinfo;  /* IPv6 flow information */
64973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	struct vki_in6_addr	sin6_addr;      /* IPv6 address */
65073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32		sin6_scope_id;  /* scope id (new in RFC2553) */
65173b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
65273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
65373b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
65473b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/un.h
65573b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
65673b526fb4af0f60634f0078583d92b931d5c0eebnethercote
65773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_UNIX_PATH_MAX	108
65873b526fb4af0f60634f0078583d92b931d5c0eebnethercote
65973b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_sockaddr_un {
66073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	vki_sa_family_t sun_family;	/* AF_UNIX */
66173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	char sun_path[VKI_UNIX_PATH_MAX];	/* pathname */
66273b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
66373b526fb4af0f60634f0078583d92b931d5c0eebnethercote
66473b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
66573b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/if.h
66673b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
66773b526fb4af0f60634f0078583d92b931d5c0eebnethercote
66873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define	VKI_IFNAMSIZ	16
66973b526fb4af0f60634f0078583d92b931d5c0eebnethercote
67073b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_ifmap
67173b526fb4af0f60634f0078583d92b931d5c0eebnethercote{
67273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long mem_start;
67373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long mem_end;
67473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short base_addr;
67573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned char irq;
67673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned char dma;
67773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned char port;
67873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	/* 3 bytes spare */
67973b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
68073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
68173b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_if_settings
68273b526fb4af0f60634f0078583d92b931d5c0eebnethercote{
68373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned int type;	/* Type of physical device or protocol */
68473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned int size;	/* Size of the data allocated by the caller */
68573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	union {
68673b526fb4af0f60634f0078583d92b931d5c0eebnethercote                // [[Nb: converted these all to void* to avoid pulling in
68773b526fb4af0f60634f0078583d92b931d5c0eebnethercote                //   unnecessary headers]]]
68873b526fb4af0f60634f0078583d92b931d5c0eebnethercote		/* {atm/eth/dsl}_settings anyone ? */
68973b526fb4af0f60634f0078583d92b931d5c0eebnethercote		void /*raw_hdlc_proto		*/__user *raw_hdlc;
69073b526fb4af0f60634f0078583d92b931d5c0eebnethercote		void /*cisco_proto		*/__user *cisco;
69173b526fb4af0f60634f0078583d92b931d5c0eebnethercote		void /*fr_proto			*/__user *fr;
69273b526fb4af0f60634f0078583d92b931d5c0eebnethercote		void /*fr_proto_pvc		*/__user *fr_pvc;
69373b526fb4af0f60634f0078583d92b931d5c0eebnethercote		void /*fr_proto_pvc_info	*/__user *fr_pvc_info;
69473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
69573b526fb4af0f60634f0078583d92b931d5c0eebnethercote		/* interface settings */
69673b526fb4af0f60634f0078583d92b931d5c0eebnethercote		void /*sync_serial_settings	*/__user *sync;
69773b526fb4af0f60634f0078583d92b931d5c0eebnethercote		void /*te1_settings		*/__user *te1;
69873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	} ifs_ifsu;
69973b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
70073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
70173b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_ifreq
70273b526fb4af0f60634f0078583d92b931d5c0eebnethercote{
70373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_IFHWADDRLEN	6
70473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	union
70573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	{
70673b526fb4af0f60634f0078583d92b931d5c0eebnethercote		char	ifrn_name[VKI_IFNAMSIZ];		/* if name, e.g. "en0" */
70773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	} ifr_ifrn;
70873b526fb4af0f60634f0078583d92b931d5c0eebnethercote
70973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	union {
71073b526fb4af0f60634f0078583d92b931d5c0eebnethercote		struct	vki_sockaddr ifru_addr;
71173b526fb4af0f60634f0078583d92b931d5c0eebnethercote		struct	vki_sockaddr ifru_dstaddr;
71273b526fb4af0f60634f0078583d92b931d5c0eebnethercote		struct	vki_sockaddr ifru_broadaddr;
71373b526fb4af0f60634f0078583d92b931d5c0eebnethercote		struct	vki_sockaddr ifru_netmask;
71473b526fb4af0f60634f0078583d92b931d5c0eebnethercote		struct  vki_sockaddr ifru_hwaddr;
71573b526fb4af0f60634f0078583d92b931d5c0eebnethercote		short	ifru_flags;
71673b526fb4af0f60634f0078583d92b931d5c0eebnethercote		int	ifru_ivalue;
71773b526fb4af0f60634f0078583d92b931d5c0eebnethercote		int	ifru_mtu;
71873b526fb4af0f60634f0078583d92b931d5c0eebnethercote		struct  vki_ifmap ifru_map;
71973b526fb4af0f60634f0078583d92b931d5c0eebnethercote		char	ifru_slave[VKI_IFNAMSIZ];	/* Just fits the size */
72073b526fb4af0f60634f0078583d92b931d5c0eebnethercote		char	ifru_newname[VKI_IFNAMSIZ];
72173b526fb4af0f60634f0078583d92b931d5c0eebnethercote		void __user *	ifru_data;
72273b526fb4af0f60634f0078583d92b931d5c0eebnethercote		struct	vki_if_settings ifru_settings;
72373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	} ifr_ifru;
72473b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
72573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
72673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define vki_ifr_name	ifr_ifrn.ifrn_name	/* interface name 	*/
72773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define ifr_hwaddr	ifr_ifru.ifru_hwaddr	/* MAC address 		*/
72873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define	ifr_addr	ifr_ifru.ifru_addr	/* address		*/
72973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define	ifr_dstaddr	ifr_ifru.ifru_dstaddr	/* other end of p-p lnk	*/
73073b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define	ifr_broadaddr	ifr_ifru.ifru_broadaddr	/* broadcast address	*/
73173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define	ifr_netmask	ifr_ifru.ifru_netmask	/* interface net mask	*/
73273b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define	vki_ifr_flags	ifr_ifru.ifru_flags	/* flags		*/
73373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define	vki_ifr_metric	ifr_ifru.ifru_ivalue	/* metric		*/
73473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define	vki_ifr_mtu		ifr_ifru.ifru_mtu	/* mtu			*/
73573b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define ifr_map		ifr_ifru.ifru_map	/* device map		*/
73673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define ifr_slave	ifr_ifru.ifru_slave	/* slave device		*/
73773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define	vki_ifr_data	ifr_ifru.ifru_data	/* for use by interface	*/
73873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define vki_ifr_ifindex	ifr_ifru.ifru_ivalue	/* interface index	*/
73973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define ifr_bandwidth	ifr_ifru.ifru_ivalue    /* link bandwidth	*/
74073b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define ifr_qlen	ifr_ifru.ifru_ivalue	/* Queue length 	*/
74173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define ifr_newname	ifr_ifru.ifru_newname	/* New name		*/
74273b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define ifr_settings	ifr_ifru.ifru_settings	/* Device/proto settings*/
74373b526fb4af0f60634f0078583d92b931d5c0eebnethercote
74473b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_ifconf
74573b526fb4af0f60634f0078583d92b931d5c0eebnethercote{
74673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int	ifc_len;			/* size of buffer	*/
74773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	union
74873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	{
74973b526fb4af0f60634f0078583d92b931d5c0eebnethercote		char __user *ifcu_buf;
75073b526fb4af0f60634f0078583d92b931d5c0eebnethercote		struct vki_ifreq __user *ifcu_req;
75173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	} ifc_ifcu;
75273b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
75373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define	vki_ifc_buf	ifc_ifcu.ifcu_buf	/* buffer address	*/
75473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
75573b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
75673b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/if_arp.h
75773b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
75873b526fb4af0f60634f0078583d92b931d5c0eebnethercote
75973b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_arpreq {
76073b526fb4af0f60634f0078583d92b931d5c0eebnethercote  struct vki_sockaddr	arp_pa;		/* protocol address		*/
76173b526fb4af0f60634f0078583d92b931d5c0eebnethercote  struct vki_sockaddr	arp_ha;		/* hardware address		*/
76273b526fb4af0f60634f0078583d92b931d5c0eebnethercote  int			arp_flags;	/* flags			*/
76373b526fb4af0f60634f0078583d92b931d5c0eebnethercote  struct vki_sockaddr   arp_netmask;    /* netmask (only for proxy arps) */
76473b526fb4af0f60634f0078583d92b931d5c0eebnethercote  char			arp_dev[16];
76573b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
76673b526fb4af0f60634f0078583d92b931d5c0eebnethercote
76773b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
76873b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/route.h
76973b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
77073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
77173b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_rtentry
77273b526fb4af0f60634f0078583d92b931d5c0eebnethercote{
77373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	rt_pad1;
77473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	struct vki_sockaddr	rt_dst;		/* target address		*/
77573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	struct vki_sockaddr	rt_gateway;	/* gateway addr (RTF_GATEWAY)	*/
77673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	struct vki_sockaddr	rt_genmask;	/* target network mask (IP)	*/
77773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short	rt_flags;
77873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	short		rt_pad2;
77973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	rt_pad3;
78073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	void		*rt_pad4;
78173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	short		rt_metric;	/* +1 for binary compatibility!	*/
78273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	char __user	*rt_dev;	/* forcing the device at add	*/
78373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	rt_mtu;		/* per route MTU/Window 	*/
78473b526fb4af0f60634f0078583d92b931d5c0eebnethercote// [[Not important for Valgrind]]
78573b526fb4af0f60634f0078583d92b931d5c0eebnethercote//#ifndef __KERNEL__
78673b526fb4af0f60634f0078583d92b931d5c0eebnethercote//#define rt_mss	rt_mtu		/* Compatibility :-(            */
78773b526fb4af0f60634f0078583d92b931d5c0eebnethercote//#endif
78873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	rt_window;	/* Window clamping 		*/
78973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short	rt_irtt;	/* Initial RTT			*/
79073b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
79173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
79273b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
7931aa57373be5343c365ee6b480e205abc16008402tom// From linux-2.6.13-rc5/include/net/sctp/user.h
7941aa57373be5343c365ee6b480e205abc16008402tom//----------------------------------------------------------------------
7951aa57373be5343c365ee6b480e205abc16008402tom
7961aa57373be5343c365ee6b480e205abc16008402tomtypedef __vki_s32 vki_sctp_assoc_t;
7971aa57373be5343c365ee6b480e205abc16008402tom
7981aa57373be5343c365ee6b480e205abc16008402tomenum vki_sctp_optname {
7991aa57373be5343c365ee6b480e205abc16008402tom	VKI_SCTP_RTOINFO,
8001aa57373be5343c365ee6b480e205abc16008402tom#define VKI_SCTP_RTOINFO VKI_SCTP_RTOINFO
8011aa57373be5343c365ee6b480e205abc16008402tom	VKI_SCTP_ASSOCINFO,
8021aa57373be5343c365ee6b480e205abc16008402tom#define VKI_SCTP_ASSOCINFO VKI_SCTP_ASSOCINFO
8031aa57373be5343c365ee6b480e205abc16008402tom	VKI_SCTP_INITMSG,
8041aa57373be5343c365ee6b480e205abc16008402tom#define VKI_SCTP_INITMSG VKI_SCTP_INITMSG
8051aa57373be5343c365ee6b480e205abc16008402tom	VKI_SCTP_NODELAY, 	/* Get/set nodelay option. */
8061aa57373be5343c365ee6b480e205abc16008402tom#define VKI_SCTP_NODELAY	VKI_SCTP_NODELAY
8071aa57373be5343c365ee6b480e205abc16008402tom	VKI_SCTP_AUTOCLOSE,
8081aa57373be5343c365ee6b480e205abc16008402tom#define VKI_SCTP_AUTOCLOSE VKI_SCTP_AUTOCLOSE
8091aa57373be5343c365ee6b480e205abc16008402tom	VKI_SCTP_SET_PEER_PRIMARY_ADDR,
8101aa57373be5343c365ee6b480e205abc16008402tom#define VKI_SCTP_SET_PEER_PRIMARY_ADDR VKI_SCTP_SET_PEER_PRIMARY_ADDR
8111aa57373be5343c365ee6b480e205abc16008402tom	VKI_SCTP_PRIMARY_ADDR,
8121aa57373be5343c365ee6b480e205abc16008402tom#define VKI_SCTP_PRIMARY_ADDR VKI_SCTP_PRIMARY_ADDR
8131aa57373be5343c365ee6b480e205abc16008402tom	VKI_SCTP_ADAPTION_LAYER,
8141aa57373be5343c365ee6b480e205abc16008402tom#define VKI_SCTP_ADAPTION_LAYER VKI_SCTP_ADAPTION_LAYER
8151aa57373be5343c365ee6b480e205abc16008402tom	VKI_SCTP_DISABLE_FRAGMENTS,
8161aa57373be5343c365ee6b480e205abc16008402tom#define VKI_SCTP_DISABLE_FRAGMENTS VKI_SCTP_DISABLE_FRAGMENTS
8171aa57373be5343c365ee6b480e205abc16008402tom	VKI_SCTP_PEER_ADDR_PARAMS,
8181aa57373be5343c365ee6b480e205abc16008402tom#define VKI_SCTP_PEER_ADDR_PARAMS VKI_SCTP_PEER_ADDR_PARAMS
8191aa57373be5343c365ee6b480e205abc16008402tom	VKI_SCTP_DEFAULT_SEND_PARAM,
8201aa57373be5343c365ee6b480e205abc16008402tom#define VKI_SCTP_DEFAULT_SEND_PARAM VKI_SCTP_DEFAULT_SEND_PARAM
8211aa57373be5343c365ee6b480e205abc16008402tom	VKI_SCTP_EVENTS,
8221aa57373be5343c365ee6b480e205abc16008402tom#define VKI_SCTP_EVENTS VKI_SCTP_EVENTS
8231aa57373be5343c365ee6b480e205abc16008402tom	VKI_SCTP_I_WANT_MAPPED_V4_ADDR,  /* Turn on/off mapped v4 addresses  */
8241aa57373be5343c365ee6b480e205abc16008402tom#define VKI_SCTP_I_WANT_MAPPED_V4_ADDR VKI_SCTP_I_WANT_MAPPED_V4_ADDR
8251aa57373be5343c365ee6b480e205abc16008402tom	VKI_SCTP_MAXSEG, 	/* Get/set maximum fragment. */
8261aa57373be5343c365ee6b480e205abc16008402tom#define VKI_SCTP_MAXSEG 	VKI_SCTP_MAXSEG
8271aa57373be5343c365ee6b480e205abc16008402tom	VKI_SCTP_STATUS,
8281aa57373be5343c365ee6b480e205abc16008402tom#define VKI_SCTP_STATUS VKI_SCTP_STATUS
8291aa57373be5343c365ee6b480e205abc16008402tom	VKI_SCTP_GET_PEER_ADDR_INFO,
8301aa57373be5343c365ee6b480e205abc16008402tom#define VKI_SCTP_GET_PEER_ADDR_INFO VKI_SCTP_GET_PEER_ADDR_INFO
8311aa57373be5343c365ee6b480e205abc16008402tom
8321aa57373be5343c365ee6b480e205abc16008402tom	/* Internal Socket Options. Some of the sctp library functions are
8331aa57373be5343c365ee6b480e205abc16008402tom	 * implemented using these socket options.
8341aa57373be5343c365ee6b480e205abc16008402tom	 */
8351aa57373be5343c365ee6b480e205abc16008402tom	VKI_SCTP_SOCKOPT_BINDX_ADD = 100,/* BINDX requests for adding addresses. */
8361aa57373be5343c365ee6b480e205abc16008402tom#define VKI_SCTP_SOCKOPT_BINDX_ADD	VKI_SCTP_SOCKOPT_BINDX_ADD
8371aa57373be5343c365ee6b480e205abc16008402tom	VKI_SCTP_SOCKOPT_BINDX_REM, /* BINDX requests for removing addresses. */
8381aa57373be5343c365ee6b480e205abc16008402tom#define VKI_SCTP_SOCKOPT_BINDX_REM	VKI_SCTP_SOCKOPT_BINDX_REM
8391aa57373be5343c365ee6b480e205abc16008402tom	VKI_SCTP_SOCKOPT_PEELOFF, 	/* peel off association. */
8401aa57373be5343c365ee6b480e205abc16008402tom#define VKI_SCTP_SOCKOPT_PEELOFF	VKI_SCTP_SOCKOPT_PEELOFF
8411aa57373be5343c365ee6b480e205abc16008402tom	VKI_SCTP_GET_PEER_ADDRS_NUM, 	/* Get number of peer addresss. */
8421aa57373be5343c365ee6b480e205abc16008402tom#define VKI_SCTP_GET_PEER_ADDRS_NUM	VKI_SCTP_GET_PEER_ADDRS_NUM
8431aa57373be5343c365ee6b480e205abc16008402tom	VKI_SCTP_GET_PEER_ADDRS, 	/* Get all peer addresss. */
8441aa57373be5343c365ee6b480e205abc16008402tom#define VKI_SCTP_GET_PEER_ADDRS	VKI_SCTP_GET_PEER_ADDRS
8451aa57373be5343c365ee6b480e205abc16008402tom	VKI_SCTP_GET_LOCAL_ADDRS_NUM, 	/* Get number of local addresss. */
8461aa57373be5343c365ee6b480e205abc16008402tom#define VKI_SCTP_GET_LOCAL_ADDRS_NUM	VKI_SCTP_GET_LOCAL_ADDRS_NUM
8471aa57373be5343c365ee6b480e205abc16008402tom	VKI_SCTP_GET_LOCAL_ADDRS, 	/* Get all local addresss. */
8481aa57373be5343c365ee6b480e205abc16008402tom#define VKI_SCTP_GET_LOCAL_ADDRS	VKI_SCTP_GET_LOCAL_ADDRS
8491aa57373be5343c365ee6b480e205abc16008402tom	VKI_SCTP_SOCKOPT_CONNECTX, /* CONNECTX requests. */
8501aa57373be5343c365ee6b480e205abc16008402tom#define VKI_SCTP_SOCKOPT_CONNECTX	VKI_SCTP_SOCKOPT_CONNECTX
8511aa57373be5343c365ee6b480e205abc16008402tom};
8521aa57373be5343c365ee6b480e205abc16008402tom
8531aa57373be5343c365ee6b480e205abc16008402tomstruct vki_sctp_getaddrs {
8541aa57373be5343c365ee6b480e205abc16008402tom	vki_sctp_assoc_t        assoc_id;
8551aa57373be5343c365ee6b480e205abc16008402tom	int			addr_num;
8561aa57373be5343c365ee6b480e205abc16008402tom	struct vki_sockaddr	*addrs;
8571aa57373be5343c365ee6b480e205abc16008402tom};
8581aa57373be5343c365ee6b480e205abc16008402tom
8591aa57373be5343c365ee6b480e205abc16008402tom//----------------------------------------------------------------------
86073b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/resource.h
86173b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
86273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
86373b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct	vki_rusage {
86473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	struct vki_timeval ru_utime;	/* user time used */
86573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	struct vki_timeval ru_stime;	/* system time used */
86673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long	ru_maxrss;		/* maximum resident set size */
86773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long	ru_ixrss;		/* integral shared memory size */
86873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long	ru_idrss;		/* integral unshared data size */
86973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long	ru_isrss;		/* integral unshared stack size */
87073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long	ru_minflt;		/* page reclaims */
87173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long	ru_majflt;		/* page faults */
87273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long	ru_nswap;		/* swaps */
87373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long	ru_inblock;		/* block input operations */
87473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long	ru_oublock;		/* block output operations */
87573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long	ru_msgsnd;		/* messages sent */
87673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long	ru_msgrcv;		/* messages received */
87773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long	ru_nsignals;		/* signals received */
87873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long	ru_nvcsw;		/* voluntary context switches */
87973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long	ru_nivcsw;		/* involuntary " */
88073b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
88173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
88273b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_rlimit {
88373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	rlim_cur;
88473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	rlim_max;
88573b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
88673b526fb4af0f60634f0078583d92b931d5c0eebnethercote
88773b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
88873b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/elfcore.h
88973b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
89073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
89173b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_elf_siginfo
89273b526fb4af0f60634f0078583d92b931d5c0eebnethercote{
89373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int	si_signo;			/* signal number */
89473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int	si_code;			/* extra code */
89573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int	si_errno;			/* errno */
89673b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
89773b526fb4af0f60634f0078583d92b931d5c0eebnethercote
89873b526fb4af0f60634f0078583d92b931d5c0eebnethercote// [[Removed some commented out lines here]]
89973b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_elf_prstatus
90073b526fb4af0f60634f0078583d92b931d5c0eebnethercote{
90173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	struct vki_elf_siginfo pr_info;	/* Info associated with signal */
90273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	short	pr_cursig;		/* Current signal */
90373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long pr_sigpend;	/* Set of pending signals */
90473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long pr_sighold;	/* Set of held signals */
90573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	vki_pid_t	pr_pid;
90673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	vki_pid_t	pr_ppid;
90773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	vki_pid_t	pr_pgrp;
90873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	vki_pid_t	pr_sid;
90973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	struct vki_timeval pr_utime;	/* User time */
91073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	struct vki_timeval pr_stime;	/* System time */
91173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	struct vki_timeval pr_cutime;	/* Cumulative user time */
91273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	struct vki_timeval pr_cstime;	/* Cumulative system time */
91373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	vki_elf_gregset_t pr_reg;	/* GP registers */
91473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int pr_fpvalid;		/* True if math co-processor being used.  */
91573b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
91673b526fb4af0f60634f0078583d92b931d5c0eebnethercote
91773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_ELF_PRARGSZ	(80)	/* Number of chars for args */
91873b526fb4af0f60634f0078583d92b931d5c0eebnethercote
91973b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_elf_prpsinfo
92073b526fb4af0f60634f0078583d92b931d5c0eebnethercote{
92173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	char	pr_state;	/* numeric process state */
92273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	char	pr_sname;	/* char for pr_state */
92373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	char	pr_zomb;	/* zombie */
92473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	char	pr_nice;	/* nice val */
92573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long pr_flag;	/* flags */
92673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_uid_t	pr_uid;
92773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_gid_t	pr_gid;
92873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	vki_pid_t	pr_pid, pr_ppid, pr_pgrp, pr_sid;
92973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	/* Lots missing */
93073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	char	pr_fname[16];	/* filename of executable */
93173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	char	pr_psargs[VKI_ELF_PRARGSZ];	/* initial part of arg list */
93273b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
93373b526fb4af0f60634f0078583d92b931d5c0eebnethercote
93473b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
93540e735834f172bd304ead1fa7e5e31f9e455dc24njn// From linux-2.6.12.1/include/linux/eventpoll.h
93673b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
93773b526fb4af0f60634f0078583d92b931d5c0eebnethercote
93840e735834f172bd304ead1fa7e5e31f9e455dc24njn/* Valid opcodes to issue to sys_epoll_ctl() */
93940e735834f172bd304ead1fa7e5e31f9e455dc24njn#define VKI_EPOLL_CTL_ADD 1
94040e735834f172bd304ead1fa7e5e31f9e455dc24njn#define VKI_EPOLL_CTL_DEL 2
94140e735834f172bd304ead1fa7e5e31f9e455dc24njn#define VKI_EPOLL_CTL_MOD 3
94240e735834f172bd304ead1fa7e5e31f9e455dc24njn
94373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#ifdef __x86_64__
94473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_EPOLL_PACKED __attribute__((packed))
94573b526fb4af0f60634f0078583d92b931d5c0eebnethercote#else
94673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_EPOLL_PACKED
94773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#endif
94873b526fb4af0f60634f0078583d92b931d5c0eebnethercote
94940e735834f172bd304ead1fa7e5e31f9e455dc24njnstruct vki_epoll_event {
95073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 events;
95173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u64 data;
95273b526fb4af0f60634f0078583d92b931d5c0eebnethercote} VKI_EPOLL_PACKED;
95373b526fb4af0f60634f0078583d92b931d5c0eebnethercote
95473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
95573b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
95673b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/mqueue.h
95773b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
95873b526fb4af0f60634f0078583d92b931d5c0eebnethercote
95973b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_mq_attr {
96073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long	mq_flags;	/* message queue flags			*/
96173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long	mq_maxmsg;	/* maximum number of messages		*/
96273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long	mq_msgsize;	/* maximum message size			*/
96373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long	mq_curmsgs;	/* number of messages currently queued	*/
96473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long	__reserved[4];	/* ignored for input, zeroed for output */
96573b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
96673b526fb4af0f60634f0078583d92b931d5c0eebnethercote
96773b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
96873b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/utsname.h
96973b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
97073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
97173b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_new_utsname {
97273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	char sysname[65];
97373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	char nodename[65];
97473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	char release[65];
97573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	char version[65];
97673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	char machine[65];
97773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	char domainname[65];
97873b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
97973b526fb4af0f60634f0078583d92b931d5c0eebnethercote
98073b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
98173b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/mii.h
98273b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
98373b526fb4af0f60634f0078583d92b931d5c0eebnethercote
98473b526fb4af0f60634f0078583d92b931d5c0eebnethercote/* This structure is used in all SIOCxMIIxxx ioctl calls */
98573b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_mii_ioctl_data {
98673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	vki_u16		phy_id;
98773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	vki_u16		reg_num;
98873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	vki_u16		val_in;
98973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	vki_u16		val_out;
99073b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
99173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
99273b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
99373b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/capability.h
99473b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
99573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
99673b526fb4af0f60634f0078583d92b931d5c0eebnethercote// [[capget()/capset() man page says this, ominously:
99773b526fb4af0f60634f0078583d92b931d5c0eebnethercote//
99873b526fb4af0f60634f0078583d92b931d5c0eebnethercote//   The kernel API is likely to change and use of these functions  (in
99973b526fb4af0f60634f0078583d92b931d5c0eebnethercote//   particular the format of the cap_user_*_t types) is subject to
100073b526fb4af0f60634f0078583d92b931d5c0eebnethercote//   change with each kernel revision.
100173b526fb4af0f60634f0078583d92b931d5c0eebnethercote//
100273b526fb4af0f60634f0078583d92b931d5c0eebnethercote// However, the format hasn't changed since at least Linux 2.4.6.]]
100373b526fb4af0f60634f0078583d92b931d5c0eebnethercote
100473b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef struct __vki_user_cap_header_struct {
100573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 version;
100673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int pid;
100773b526fb4af0f60634f0078583d92b931d5c0eebnethercote} __user *vki_cap_user_header_t;
100873b526fb4af0f60634f0078583d92b931d5c0eebnethercote
100973b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef struct __vki_user_cap_data_struct {
101073b526fb4af0f60634f0078583d92b931d5c0eebnethercote        __vki_u32 effective;
101173b526fb4af0f60634f0078583d92b931d5c0eebnethercote        __vki_u32 permitted;
101273b526fb4af0f60634f0078583d92b931d5c0eebnethercote        __vki_u32 inheritable;
101373b526fb4af0f60634f0078583d92b931d5c0eebnethercote} __user *vki_cap_user_data_t;
101473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
101573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
101673b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
101773b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/module.h
101873b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
101973b526fb4af0f60634f0078583d92b931d5c0eebnethercote
102073b526fb4af0f60634f0078583d92b931d5c0eebnethercote// [[We do a VKI_SIZEOF_* here because this type is so big, and its size
102173b526fb4af0f60634f0078583d92b931d5c0eebnethercote//   depends on the word size, so see vki_arch.h]]
102273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
102373b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
102473b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/ipc.h
102573b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
102673b526fb4af0f60634f0078583d92b931d5c0eebnethercote
102773b526fb4af0f60634f0078583d92b931d5c0eebnethercote/* Obsolete, used only for backwards compatibility and libc5 compiles */
102873b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_ipc_perm
102973b526fb4af0f60634f0078583d92b931d5c0eebnethercote{
103073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_key_t	key;
103173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_uid_t	uid;
103273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_gid_t	gid;
103373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_uid_t	cuid;
103473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_gid_t	cgid;
103573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_mode_t	mode;
103673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short	seq;
103773b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
103873b526fb4af0f60634f0078583d92b931d5c0eebnethercote
103973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_IPC_CREAT  00001000   /* create if key is nonexistent */
104073b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_IPC_EXCL   00002000   /* fail if key exists */
104173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_IPC_NOWAIT 00004000   /* return error on wait */
104273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
104373b526fb4af0f60634f0078583d92b931d5c0eebnethercote//#define VKI_IPC_RMID 0     /* remove resource */
104473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_IPC_SET  1     /* set ipc_perm options */
104573b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_IPC_STAT 2     /* get ipc_perm options */
104673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_IPC_INFO 3     /* see ipcs */
104773b526fb4af0f60634f0078583d92b931d5c0eebnethercote
104873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_IPC_64  0x0100  /* New version (support 32-bit UIDs, bigger
104973b526fb4af0f60634f0078583d92b931d5c0eebnethercote			       message sizes, etc. */
105073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
105173b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
105273b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/sem.h
105373b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
105473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
105573b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_GETALL  13       /* get all semval's */
105673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SETVAL  16       /* set semval */
105773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SETALL  17       /* set all semval's */
105873b526fb4af0f60634f0078583d92b931d5c0eebnethercote
105973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SEM_STAT 18
106073b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SEM_INFO 19
106173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
106273b526fb4af0f60634f0078583d92b931d5c0eebnethercote/* Obsolete, used only for backwards compatibility and libc5 compiles */
106373b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_semid_ds {
106473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	struct vki_ipc_perm	sem_perm;		/* permissions .. see ipc.h */
106573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_time_t	sem_otime;		/* last semop time */
106673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_time_t	sem_ctime;		/* last change time */
106773b526fb4af0f60634f0078583d92b931d5c0eebnethercote        // [[Use void* to avoid excess header copying]]
106873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	void/*struct sem	*/*sem_base;		/* ptr to first semaphore in array */
106973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	void/*struct sem_queue */*sem_pending;		/* pending operations to be processed */
107073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	void/*struct sem_queue */**sem_pending_last;	/* last pending operation */
107173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	void/*struct sem_undo	*/*undo;			/* undo requests on this array */
107273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short	sem_nsems;		/* no. of semaphores in array */
107373b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
107473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
107573b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_sembuf {
107673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short  sem_num;	/* semaphore index in array */
107773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	short		sem_op;		/* semaphore operation */
107873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	short		sem_flg;	/* operation flags */
107973b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
108073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
108173b526fb4af0f60634f0078583d92b931d5c0eebnethercoteunion vki_semun {
108273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int val;			/* value for SETVAL */
108373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	struct vki_semid_ds __user *buf;	/* buffer for IPC_STAT & IPC_SET */
108473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short __user *array;	/* array for GETALL & SETALL */
108573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	struct vki_seminfo __user *__buf;	/* buffer for IPC_INFO */
108673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	void __user *__pad;
108773b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
108873b526fb4af0f60634f0078583d92b931d5c0eebnethercote
108973b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct  vki_seminfo {
109073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int semmap;
109173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int semmni;
109273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int semmns;
109373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int semmnu;
109473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int semmsl;
109573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int semopm;
109673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int semume;
109773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int semusz;
109873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int semvmx;
109973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int semaem;
110073b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
110173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
110273b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
110373b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/asm-generic/errno-base.h
110473b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
110573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
110673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define	VKI_EPERM		 1	/* Operation not permitted */
110745f4e7c91119c7d01a59f5e827c67841632c9314sewardj#define	VKI_ENOENT		 2	/* No such file or directory */
110873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define	VKI_ESRCH		 3	/* No such process */
110973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define	VKI_EINTR		 4	/* Interrupted system call */
111045f4e7c91119c7d01a59f5e827c67841632c9314sewardj#define VKI_ENOEXEC              8      /* Exec format error */
111173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define	VKI_EBADF		 9	/* Bad file number */
111298e68a4db8df087243c5f095cddb7b34adb2d19bsewardj#define VKI_ECHILD              10      /* No child processes */
1113b5f6f51ebcac183818061bf53427a3e7808ef10dsewardj#define VKI_EAGAIN		11	/* Try again */
1114b5f6f51ebcac183818061bf53427a3e7808ef10dsewardj#define VKI_EWOULDBLOCK		VKI_EAGAIN
111573b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define	VKI_ENOMEM		12	/* Out of memory */
111673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define	VKI_EACCES		13	/* Permission denied */
111773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define	VKI_EFAULT		14	/* Bad address */
111873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define	VKI_EEXIST		17	/* File exists */
111973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define	VKI_EINVAL		22	/* Invalid argument */
112073b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define	VKI_EMFILE		24	/* Too many open files */
112173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
112273b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
112373b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/asm-generic/errno.h
112473b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
112573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
112673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define	VKI_ENOSYS		38	/* Function not implemented */
1127af8a6a8cabe15435a526c6d9435fe83992b671abtom#define	VKI_EOVERFLOW		75	/* Value too large for defined data type */
112873b526fb4af0f60634f0078583d92b931d5c0eebnethercote
112973b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
113073b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/wait.h
113173b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
113273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
113373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_WNOHANG	0x00000001
113473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
113573b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define __VKI_WALL	0x40000000	/* Wait on all children, regardless of type */
113673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define __VKI_WCLONE	0x80000000	/* Wait only on non-SIGCHLD children */
113773b526fb4af0f60634f0078583d92b931d5c0eebnethercote
113873b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
113973b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/mman.h
114073b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
114173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
114273b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_MREMAP_MAYMOVE	1
114373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_MREMAP_FIXED	2
114473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
114573b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
1146b5f6f51ebcac183818061bf53427a3e7808ef10dsewardj// From linux-2.6.10-rc3-mm1/include/linux/futex.h
114773b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
114873b526fb4af0f60634f0078583d92b931d5c0eebnethercote
114973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_FUTEX_WAIT (0)
1150b5f6f51ebcac183818061bf53427a3e7808ef10dsewardj#define VKI_FUTEX_WAKE (1)
115173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_FUTEX_FD (2)
115273b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_FUTEX_REQUEUE (3)
1153b5f6f51ebcac183818061bf53427a3e7808ef10dsewardj#define VKI_FUTEX_CMP_REQUEUE (4)
1154497c69e7365352c91422a41583cf3bb5cacc1de1sewardj#define VKI_FUTEX_PRIVATE_FLAG (128)
115573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
115605b1f9a0d68e6d2c497ed4b671b8ff65e4ddbab9tomstruct vki_robust_list {
115705b1f9a0d68e6d2c497ed4b671b8ff65e4ddbab9tom	struct vki_robust_list __user *next;
115805b1f9a0d68e6d2c497ed4b671b8ff65e4ddbab9tom};
115905b1f9a0d68e6d2c497ed4b671b8ff65e4ddbab9tom
116005b1f9a0d68e6d2c497ed4b671b8ff65e4ddbab9tomstruct vki_robust_list_head {
116105b1f9a0d68e6d2c497ed4b671b8ff65e4ddbab9tom	/*
116205b1f9a0d68e6d2c497ed4b671b8ff65e4ddbab9tom	 * The head of the list. Points back to itself if empty:
116305b1f9a0d68e6d2c497ed4b671b8ff65e4ddbab9tom	 */
116405b1f9a0d68e6d2c497ed4b671b8ff65e4ddbab9tom	struct vki_robust_list list;
116505b1f9a0d68e6d2c497ed4b671b8ff65e4ddbab9tom
116605b1f9a0d68e6d2c497ed4b671b8ff65e4ddbab9tom	/*
116705b1f9a0d68e6d2c497ed4b671b8ff65e4ddbab9tom	 * This relative offset is set by user-space, it gives the kernel
116805b1f9a0d68e6d2c497ed4b671b8ff65e4ddbab9tom	 * the relative position of the futex field to examine. This way
116905b1f9a0d68e6d2c497ed4b671b8ff65e4ddbab9tom	 * we keep userspace flexible, to freely shape its data-structure,
117005b1f9a0d68e6d2c497ed4b671b8ff65e4ddbab9tom	 * without hardcoding any particular offset into the kernel:
117105b1f9a0d68e6d2c497ed4b671b8ff65e4ddbab9tom	 */
117205b1f9a0d68e6d2c497ed4b671b8ff65e4ddbab9tom	long futex_offset;
117305b1f9a0d68e6d2c497ed4b671b8ff65e4ddbab9tom
117405b1f9a0d68e6d2c497ed4b671b8ff65e4ddbab9tom	/*
117505b1f9a0d68e6d2c497ed4b671b8ff65e4ddbab9tom	 * The death of the thread may race with userspace setting
117605b1f9a0d68e6d2c497ed4b671b8ff65e4ddbab9tom	 * up a lock's links. So to handle this race, userspace first
117705b1f9a0d68e6d2c497ed4b671b8ff65e4ddbab9tom	 * sets this field to the address of the to-be-taken lock,
117805b1f9a0d68e6d2c497ed4b671b8ff65e4ddbab9tom	 * then does the lock acquire, and then adds itself to the
117905b1f9a0d68e6d2c497ed4b671b8ff65e4ddbab9tom	 * list, and then clears this field. Hence the kernel will
118005b1f9a0d68e6d2c497ed4b671b8ff65e4ddbab9tom	 * always have full knowledge of all locks that the thread
118105b1f9a0d68e6d2c497ed4b671b8ff65e4ddbab9tom	 * _might_ have taken. We check the owner TID in any case,
118205b1f9a0d68e6d2c497ed4b671b8ff65e4ddbab9tom	 * so only truly owned locks will be handled.
118305b1f9a0d68e6d2c497ed4b671b8ff65e4ddbab9tom	 */
118405b1f9a0d68e6d2c497ed4b671b8ff65e4ddbab9tom	struct vki_robust_list __user *list_op_pending;
118505b1f9a0d68e6d2c497ed4b671b8ff65e4ddbab9tom};
118605b1f9a0d68e6d2c497ed4b671b8ff65e4ddbab9tom
118773b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
118873b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/errno.h
118973b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
119073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
119173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_ERESTARTSYS	512
119273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
119373b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
119473b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/stat.h
119573b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
119673b526fb4af0f60634f0078583d92b931d5c0eebnethercote
119709b8480025cb3149879465b769058cb197bb9003njn#define VKI_S_IFMT  00170000
119809b8480025cb3149879465b769058cb197bb9003njn#define VKI_S_IFSOCK 0140000
119909b8480025cb3149879465b769058cb197bb9003njn#define VKI_S_IFLNK  0120000
120009b8480025cb3149879465b769058cb197bb9003njn#define VKI_S_IFREG  0100000
120109b8480025cb3149879465b769058cb197bb9003njn#define VKI_S_IFBLK  0060000
120209b8480025cb3149879465b769058cb197bb9003njn#define VKI_S_IFDIR  0040000
120309b8480025cb3149879465b769058cb197bb9003njn#define VKI_S_IFCHR  0020000
120409b8480025cb3149879465b769058cb197bb9003njn#define VKI_S_IFIFO  0010000
120509b8480025cb3149879465b769058cb197bb9003njn#define VKI_S_ISUID  0004000
120609b8480025cb3149879465b769058cb197bb9003njn#define VKI_S_ISGID  0002000
120709b8480025cb3149879465b769058cb197bb9003njn#define VKI_S_ISVTX  0001000
120809b8480025cb3149879465b769058cb197bb9003njn
120909b8480025cb3149879465b769058cb197bb9003njn#define VKI_S_ISLNK(m)	(((m) & VKI_S_IFMT) == VKI_S_IFLNK)
121009b8480025cb3149879465b769058cb197bb9003njn#define VKI_S_ISREG(m)	(((m) & VKI_S_IFMT) == VKI_S_IFREG)
121109b8480025cb3149879465b769058cb197bb9003njn#define VKI_S_ISDIR(m)	(((m) & VKI_S_IFMT) == VKI_S_IFDIR)
121209b8480025cb3149879465b769058cb197bb9003njn#define VKI_S_ISCHR(m)	(((m) & VKI_S_IFMT) == VKI_S_IFCHR)
121309b8480025cb3149879465b769058cb197bb9003njn#define VKI_S_ISBLK(m)	(((m) & VKI_S_IFMT) == VKI_S_IFBLK)
121409b8480025cb3149879465b769058cb197bb9003njn#define VKI_S_ISFIFO(m)	(((m) & VKI_S_IFMT) == VKI_S_IFIFO)
121509b8480025cb3149879465b769058cb197bb9003njn#define VKI_S_ISSOCK(m)	(((m) & VKI_S_IFMT) == VKI_S_IFSOCK)
121609b8480025cb3149879465b769058cb197bb9003njn
121745f4e7c91119c7d01a59f5e827c67841632c9314sewardj#define VKI_S_IRWXU 00700
121873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_S_IRUSR 00400
121973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_S_IWUSR 00200
122045f4e7c91119c7d01a59f5e827c67841632c9314sewardj#define VKI_S_IXUSR 00100
122145f4e7c91119c7d01a59f5e827c67841632c9314sewardj
122245f4e7c91119c7d01a59f5e827c67841632c9314sewardj#define VKI_S_IRWXG 00070
122345f4e7c91119c7d01a59f5e827c67841632c9314sewardj#define VKI_S_IRGRP 00040
122445f4e7c91119c7d01a59f5e827c67841632c9314sewardj#define VKI_S_IWGRP 00020
122545f4e7c91119c7d01a59f5e827c67841632c9314sewardj#define VKI_S_IXGRP 00010
122645f4e7c91119c7d01a59f5e827c67841632c9314sewardj
122745f4e7c91119c7d01a59f5e827c67841632c9314sewardj#define VKI_S_IRWXO 00007
122845f4e7c91119c7d01a59f5e827c67841632c9314sewardj#define VKI_S_IROTH 00004
122945f4e7c91119c7d01a59f5e827c67841632c9314sewardj#define VKI_S_IWOTH 00002
123045f4e7c91119c7d01a59f5e827c67841632c9314sewardj#define VKI_S_IXOTH 00001
123173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
123273b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
123373b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/dirent.h
123473b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
123573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
123673b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_dirent {
123773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long		d_ino;
123873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_off_t	d_off;
123973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short	d_reclen;
124073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	char		d_name[256]; /* We must not include limits.h! */
124173b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
124273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
124373b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
1244cfb8ad53df2d8d59757bc9477da105fc7fbb1843njn// From linux-2.6.8.1/include/linux/fcntl.h
1245cfb8ad53df2d8d59757bc9477da105fc7fbb1843njn//----------------------------------------------------------------------
1246cfb8ad53df2d8d59757bc9477da105fc7fbb1843njn
1247cfb8ad53df2d8d59757bc9477da105fc7fbb1843njn#define VKI_F_SETLEASE	(VKI_F_LINUX_SPECIFIC_BASE+0)
1248cfb8ad53df2d8d59757bc9477da105fc7fbb1843njn#define VKI_F_GETLEASE	(VKI_F_LINUX_SPECIFIC_BASE+1)
1249cfb8ad53df2d8d59757bc9477da105fc7fbb1843njn
1250cfb8ad53df2d8d59757bc9477da105fc7fbb1843njn#define VKI_F_NOTIFY	(VKI_F_LINUX_SPECIFIC_BASE+2)
1251cfb8ad53df2d8d59757bc9477da105fc7fbb1843njn
1252cfb8ad53df2d8d59757bc9477da105fc7fbb1843njn//----------------------------------------------------------------------
125373b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/sysctl.h
125473b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
125573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
125673b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct __vki_sysctl_args {
125773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int __user *name;
125873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int nlen;
125973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	void __user *oldval;
126073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	vki_size_t __user *oldlenp;
126173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	void __user *newval;
126273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	vki_size_t newlen;
126373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long __unused[4];
126473b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
126573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
126673b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
126773b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/aio_abi.h
126873b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
126973b526fb4af0f60634f0078583d92b931d5c0eebnethercote
127073b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef unsigned long	vki_aio_context_t;
127173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
127273b526fb4af0f60634f0078583d92b931d5c0eebnethercoteenum {
127373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	VKI_IOCB_CMD_PREAD = 0,
127473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	VKI_IOCB_CMD_PWRITE = 1,
127573b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
127673b526fb4af0f60634f0078583d92b931d5c0eebnethercote
127773b526fb4af0f60634f0078583d92b931d5c0eebnethercote/* read() from /dev/aio returns these structures. */
127873b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_io_event {
127973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u64	data;		/* the data field from the iocb */
128073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u64	obj;		/* what iocb this event came from */
128173b526fb4af0f60634f0078583d92b931d5c0eebnethercote        // [[Nb: These fields renamed from 'res' and 'res2' because 'res' is
128273b526fb4af0f60634f0078583d92b931d5c0eebnethercote        //   a macro in vg_syscalls.c!]]
128373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_s64	result;		/* result code for this event */
128473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_s64	result2;	/* secondary result */
128573b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
128673b526fb4af0f60634f0078583d92b931d5c0eebnethercote
128773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#if defined(VKI_LITTLE_ENDIAN)
128885665ca6fa29dd64754dabe50eb98f25896e752acerion#  define VKI_PADDED(x,y)	x, y
128973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#elif defined(VKI_BIG_ENDIAN)
129085665ca6fa29dd64754dabe50eb98f25896e752acerion#  define VKI_PADDED(x,y)	y, x
129173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#else
129273b526fb4af0f60634f0078583d92b931d5c0eebnethercote#error edit for your odd byteorder.
129373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#endif
129473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
129573b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_iocb {
129673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	/* these are internal to the kernel/libc. */
129773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u64	aio_data;	/* data to be returned in event's data */
129873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32	VKI_PADDED(aio_key, aio_reserved1);
129973b526fb4af0f60634f0078583d92b931d5c0eebnethercote				/* the kernel sets aio_key to the req # */
130073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
130173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	/* common fields */
130273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u16	aio_lio_opcode;	/* see IOCB_CMD_ above */
130373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_s16	aio_reqprio;
130473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32	aio_fildes;
130573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
130673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u64	aio_buf;
130773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u64	aio_nbytes;
130873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_s64	aio_offset;
130973b526fb4af0f60634f0078583d92b931d5c0eebnethercote
131073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	/* extra parameters */
131173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u64	aio_reserved2;	/* TODO: use this for a (struct sigevent *) */
131273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u64	aio_reserved3;
131373b526fb4af0f60634f0078583d92b931d5c0eebnethercote}; /* 64 bytes */
131473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
131573b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
131673b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/aio.h
131773b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
131873b526fb4af0f60634f0078583d92b931d5c0eebnethercote
131973b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_aio_ring {
132073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned	id;	/* kernel internal index number */
132173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned	nr;	/* number of io_events */
132273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned	head;
132373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned	tail;
132473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
132573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned	magic;
132673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned	compat_features;
132773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned	incompat_features;
132873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned	header_length;	/* size of aio_ring */
132973b526fb4af0f60634f0078583d92b931d5c0eebnethercote
133073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	struct vki_io_event		io_events[0];
133173b526fb4af0f60634f0078583d92b931d5c0eebnethercote}; /* 128 bytes + ring size */
133273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
133373b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
133473b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/msg.h
133573b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
133673b526fb4af0f60634f0078583d92b931d5c0eebnethercote
133773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_MSG_STAT 11
133873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_MSG_INFO 12
133973b526fb4af0f60634f0078583d92b931d5c0eebnethercote
134073b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_msqid_ds {
134173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	struct vki_ipc_perm msg_perm;
134273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	struct vki_msg *msg_first;		/* first message on queue,unused  */
134373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	struct vki_msg *msg_last;		/* last message in queue,unused */
134473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_time_t msg_stime;	/* last msgsnd time */
134573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_time_t msg_rtime;	/* last msgrcv time */
134673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_time_t msg_ctime;	/* last change time */
134773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long  msg_lcbytes;	/* Reuse junk fields for 32 bit */
134873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long  msg_lqbytes;	/* ditto */
134973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short msg_cbytes;	/* current number of bytes on queue */
135073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short msg_qnum;	/* number of messages in queue */
135173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short msg_qbytes;	/* max number of bytes on queue */
135273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_ipc_pid_t msg_lspid;	/* pid of last msgsnd */
135373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_ipc_pid_t msg_lrpid;	/* last receive pid */
135473b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
135573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
135673b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_msgbuf {
135773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long mtype;         /* type of message */
135873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	char mtext[1];      /* message text */
135973b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
136073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
136173b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_msginfo {
136273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int msgpool;
136373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int msgmap;
136473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int msgmax;
136573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int msgmnb;
136673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int msgmni;
136773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int msgssz;
136873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int msgtql;
136973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short  msgseg;
137073b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
137173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
137273b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
137373b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/shm.h
137473b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
137573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
137673b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_shmid_ds {
137773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	struct vki_ipc_perm		shm_perm;	/* operation perms */
137873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int			shm_segsz;	/* size of segment (bytes) */
137973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_time_t		shm_atime;	/* last attach time */
138073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_time_t		shm_dtime;	/* last detach time */
138173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_time_t		shm_ctime;	/* last change time */
138273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_ipc_pid_t	shm_cpid;	/* pid of creator */
138373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_ipc_pid_t	shm_lpid;	/* pid of last operator */
138473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short		shm_nattch;	/* no. of current attaches */
138573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short 		shm_unused;	/* compatibility */
138673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	void 			*shm_unused2;	/* ditto - used by DIPC */
138773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	void			*shm_unused3;	/* unused */
138873b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
138973b526fb4af0f60634f0078583d92b931d5c0eebnethercote
1390f61fea0d88fc6cc2a6c4ff78c49aa0343529ee20tom#define VKI_SHM_RDONLY  010000  /* read-only access */
1391f61fea0d88fc6cc2a6c4ff78c49aa0343529ee20tom
139273b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SHM_STAT 	13
139373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SHM_INFO 	14
139473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
139573b526fb4af0f60634f0078583d92b931d5c0eebnethercote/* Obsolete, used only for backwards compatibility */
139673b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct	vki_shminfo {
139773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int shmmax;
139873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int shmmin;
139973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int shmmni;
140073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int shmseg;
140173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int shmall;
140273b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
140373b526fb4af0f60634f0078583d92b931d5c0eebnethercote
140473b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_shm_info {
140573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int used_ids;
140673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long shm_tot;	/* total allocated shm */
140773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long shm_rss;	/* total resident shm */
140873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long shm_swp;	/* total swapped shm */
140973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long swap_attempts;
141073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long swap_successes;
141173b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
141273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
141373b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
141473b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/rtc.h
141573b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
141673b526fb4af0f60634f0078583d92b931d5c0eebnethercote
141773b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_rtc_time {
141873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int tm_sec;
141973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int tm_min;
142073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int tm_hour;
142173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int tm_mday;
142273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int tm_mon;
142373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int tm_year;
142473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int tm_wday;
142573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int tm_yday;
142673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int tm_isdst;
142773b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
142873b526fb4af0f60634f0078583d92b931d5c0eebnethercote
142973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_RTC_AIE_ON	_VKI_IO('p', 0x01)	/* Alarm int. enable on	*/
143073b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_RTC_AIE_OFF	_VKI_IO('p', 0x02)	/* ... off		*/
143173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_RTC_UIE_ON	_VKI_IO('p', 0x03)	/* Update int. enable on*/
143273b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_RTC_UIE_OFF	_VKI_IO('p', 0x04)	/* ... off		*/
143373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_RTC_PIE_ON	_VKI_IO('p', 0x05)	/* Periodic int. enable on*/
143473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_RTC_PIE_OFF	_VKI_IO('p', 0x06)	/* ... off		*/
143573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
143673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_RTC_ALM_SET		_VKI_IOW('p', 0x07, struct vki_rtc_time) /* Set alarm time  */
143773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_RTC_ALM_READ	_VKI_IOR('p', 0x08, struct vki_rtc_time) /* Read alarm time */
143873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_RTC_RD_TIME		_VKI_IOR('p', 0x09, struct vki_rtc_time) /* Read RTC time   */
143973b526fb4af0f60634f0078583d92b931d5c0eebnethercote//#define RTC_SET_TIME	_IOW('p', 0x0a, struct rtc_time) /* Set RTC time    */
144073b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_RTC_IRQP_READ	_VKI_IOR('p', 0x0b, unsigned long)	 /* Read IRQ rate   */
144173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_RTC_IRQP_SET	_VKI_IOW('p', 0x0c, unsigned long)	 /* Set IRQ rate    */
144273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
144373b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
144473b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/isdn.h
144573b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
144673b526fb4af0f60634f0078583d92b931d5c0eebnethercote
144795a9786cd29c06af2c1cda9ac20e5b0ea488faa4nethercote// [[Nb: Resolved this for the common case where CONFIG_COBALT_MICRO_SERVER
144895a9786cd29c06af2c1cda9ac20e5b0ea488faa4nethercote//   is not defined]]
144995a9786cd29c06af2c1cda9ac20e5b0ea488faa4nethercote#define VKI_ISDN_MAX_CHANNELS   64
145095a9786cd29c06af2c1cda9ac20e5b0ea488faa4nethercote
145173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_IIOCGETCPS  _VKI_IO('I',21)
145273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
145373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_IIOCNETGPN  _VKI_IO('I',34)
145473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
145573b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_ISDN_MSNLEN          32
145673b526fb4af0f60634f0078583d92b931d5c0eebnethercote
145773b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef struct {
145873b526fb4af0f60634f0078583d92b931d5c0eebnethercote  char name[10];
145973b526fb4af0f60634f0078583d92b931d5c0eebnethercote  char phone[VKI_ISDN_MSNLEN];
146073b526fb4af0f60634f0078583d92b931d5c0eebnethercote  int  outgoing;
146173b526fb4af0f60634f0078583d92b931d5c0eebnethercote} vki_isdn_net_ioctl_phone;
146273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
146373b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
146473b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/sockios.h
146573b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
146673b526fb4af0f60634f0078583d92b931d5c0eebnethercote
146773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIOCOUTQ		VKI_TIOCOUTQ
146873b526fb4af0f60634f0078583d92b931d5c0eebnethercote
146973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIOCADDRT		0x890B	/* add routing table entry	*/
147073b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIOCDELRT		0x890C	/* delete routing table entry	*/
147173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
147273b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIOCGIFNAME		0x8910	/* get iface name		*/
147373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIOCGIFCONF		0x8912	/* get iface list		*/
147473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIOCGIFFLAGS	0x8913	/* get flags			*/
147573b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIOCSIFFLAGS	0x8914	/* set flags			*/
147673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIOCGIFADDR		0x8915	/* get PA address		*/
147773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIOCSIFADDR		0x8916	/* set PA address		*/
147873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIOCGIFDSTADDR	0x8917	/* get remote PA address	*/
147973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIOCSIFDSTADDR	0x8918	/* set remote PA address	*/
148073b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIOCGIFBRDADDR	0x8919	/* get broadcast PA address	*/
148173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIOCSIFBRDADDR	0x891a	/* set broadcast PA address	*/
148273b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIOCGIFNETMASK	0x891b	/* get network PA mask		*/
148373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIOCSIFNETMASK	0x891c	/* set network PA mask		*/
148473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIOCGIFMETRIC	0x891d	/* get metric			*/
148573b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIOCSIFMETRIC	0x891e	/* set metric			*/
148673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIOCGIFMTU		0x8921	/* get MTU size			*/
148773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIOCSIFMTU		0x8922	/* set MTU size			*/
148873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define	VKI_SIOCSIFHWADDR	0x8924	/* set hardware address 	*/
148973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIOCGIFHWADDR	0x8927	/* Get hardware address		*/
149073b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIOCGIFINDEX	0x8933	/* name -> if_index mapping	*/
149173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
149273b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIOCGIFTXQLEN	0x8942	/* Get the tx queue length	*/
149373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIOCSIFTXQLEN	0x8943	/* Set the tx queue length 	*/
149473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
149573b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIOCGMIIPHY		0x8947	/* Get address of MII PHY in use. */
149673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIOCGMIIREG		0x8948	/* Read MII PHY register.	*/
149773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIOCSMIIREG		0x8949	/* Write MII PHY register.	*/
149873b526fb4af0f60634f0078583d92b931d5c0eebnethercote
149973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIOCDARP		0x8953	/* delete ARP table entry	*/
150073b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIOCGARP		0x8954	/* get ARP table entry		*/
150173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIOCSARP		0x8955	/* set ARP table entry		*/
150273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
150373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIOCDRARP		0x8960	/* delete RARP table entry	*/
150473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIOCGRARP		0x8961	/* get RARP table entry		*/
150573b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIOCSRARP		0x8962	/* set RARP table entry		*/
150673b526fb4af0f60634f0078583d92b931d5c0eebnethercote
150773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIOCGIFMAP		0x8970	/* Get device parameters	*/
150873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIOCSIFMAP		0x8971	/* Set device parameters	*/
150973b526fb4af0f60634f0078583d92b931d5c0eebnethercote
151073b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
151173b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/ppdev.h
151273b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
151373b526fb4af0f60634f0078583d92b931d5c0eebnethercote
151473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_PP_MAJOR	99
151573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
151673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_PP_IOCTL	'p'
151773b526fb4af0f60634f0078583d92b931d5c0eebnethercote
151873b526fb4af0f60634f0078583d92b931d5c0eebnethercote/* Set mode for read/write (e.g. IEEE1284_MODE_EPP) */
151973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_PPSETMODE	_VKI_IOW(VKI_PP_IOCTL, 0x80, int)
152073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
152173b526fb4af0f60634f0078583d92b931d5c0eebnethercote/* Read status */
152273b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_PPRSTATUS	_VKI_IOR(VKI_PP_IOCTL, 0x81, unsigned char)
152373b526fb4af0f60634f0078583d92b931d5c0eebnethercote//#define PPWSTATUS	OBSOLETE__IOW(PP_IOCTL, 0x82, unsigned char)
152473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
152573b526fb4af0f60634f0078583d92b931d5c0eebnethercote/* Read/write control */
152673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_PPRCONTROL	_VKI_IOR(VKI_PP_IOCTL, 0x83, unsigned char)
152773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_PPWCONTROL	_VKI_IOW(VKI_PP_IOCTL, 0x84, unsigned char)
152873b526fb4af0f60634f0078583d92b931d5c0eebnethercote
152973b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_ppdev_frob_struct {
153073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned char mask;
153173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned char val;
153273b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
153373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_PPFCONTROL      _VKI_IOW(VKI_PP_IOCTL, 0x8e, struct vki_ppdev_frob_struct)
153473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
153573b526fb4af0f60634f0078583d92b931d5c0eebnethercote/* Read/write data */
153673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_PPRDATA		_VKI_IOR(VKI_PP_IOCTL, 0x85, unsigned char)
153773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_PPWDATA		_VKI_IOW(VKI_PP_IOCTL, 0x86, unsigned char)
153873b526fb4af0f60634f0078583d92b931d5c0eebnethercote
153973b526fb4af0f60634f0078583d92b931d5c0eebnethercote/* Claim the port to start using it */
154073b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_PPCLAIM		_VKI_IO(VKI_PP_IOCTL, 0x8b)
154173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
154273b526fb4af0f60634f0078583d92b931d5c0eebnethercote/* Release the port when you aren't using it */
154373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_PPRELEASE	_VKI_IO(VKI_PP_IOCTL, 0x8c)
154473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
154573b526fb4af0f60634f0078583d92b931d5c0eebnethercote/* Yield the port (release it if another driver is waiting,
154673b526fb4af0f60634f0078583d92b931d5c0eebnethercote * then reclaim) */
154773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_PPYIELD		_VKI_IO(VKI_PP_IOCTL, 0x8d)
154873b526fb4af0f60634f0078583d92b931d5c0eebnethercote
154973b526fb4af0f60634f0078583d92b931d5c0eebnethercote/* Register device exclusively (must be before PPCLAIM). */
155073b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_PPEXCL		_VKI_IO(VKI_PP_IOCTL, 0x8f)
155173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
155273b526fb4af0f60634f0078583d92b931d5c0eebnethercote/* Data line direction: non-zero for input mode. */
155373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_PPDATADIR	_VKI_IOW(VKI_PP_IOCTL, 0x90, int)
155473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
155573b526fb4af0f60634f0078583d92b931d5c0eebnethercote/* Negotiate a particular IEEE 1284 mode. */
155673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_PPNEGOT	_VKI_IOW(VKI_PP_IOCTL, 0x91, int)
155773b526fb4af0f60634f0078583d92b931d5c0eebnethercote
155873b526fb4af0f60634f0078583d92b931d5c0eebnethercote/* Set control lines when an interrupt occurs. */
155973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_PPWCTLONIRQ	_VKI_IOW(VKI_PP_IOCTL, 0x92, unsigned char)
156073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
156173b526fb4af0f60634f0078583d92b931d5c0eebnethercote/* Clear (and return) interrupt count. */
156273b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_PPCLRIRQ	_VKI_IOR(VKI_PP_IOCTL, 0x93, int)
156373b526fb4af0f60634f0078583d92b931d5c0eebnethercote
156473b526fb4af0f60634f0078583d92b931d5c0eebnethercote/* Set the IEEE 1284 phase that we're in (e.g. IEEE1284_PH_FWD_IDLE) */
156573b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_PPSETPHASE	_VKI_IOW(VKI_PP_IOCTL, 0x94, int)
156673b526fb4af0f60634f0078583d92b931d5c0eebnethercote
156773b526fb4af0f60634f0078583d92b931d5c0eebnethercote/* Set and get port timeout (struct timeval's) */
156873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_PPGETTIME	_VKI_IOR(VKI_PP_IOCTL, 0x95, struct vki_timeval)
156973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_PPSETTIME	_VKI_IOW(VKI_PP_IOCTL, 0x96, struct vki_timeval)
157073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
157173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_PPGETMODES	_VKI_IOR(VKI_PP_IOCTL, 0x97, unsigned int)
157273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
157373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_PPGETMODE	_VKI_IOR(VKI_PP_IOCTL, 0x98, int)
157473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_PPGETPHASE	_VKI_IOR(VKI_PP_IOCTL, 0x99, int)
157573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
157673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_PPGETFLAGS	_VKI_IOR(VKI_PP_IOCTL, 0x9a, int)
157773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_PPSETFLAGS	_VKI_IOW(VKI_PP_IOCTL, 0x9b, int)
157873b526fb4af0f60634f0078583d92b931d5c0eebnethercote
157973b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
158073b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/fs.h
158173b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
158273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
1583edd26f1ef9d2a47c3708aaf6196f8a7239a26699tom#define VKI_BLKROSET   _VKI_IO(0x12,93)	/* set device read-only (0 = read-write) */
1584edd26f1ef9d2a47c3708aaf6196f8a7239a26699tom#define VKI_BLKROGET   _VKI_IO(0x12,94)	/* get read-only status (0 = read_write) */
158595a9786cd29c06af2c1cda9ac20e5b0ea488faa4nethercote#define VKI_BLKGETSIZE _VKI_IO(0x12,96) /* return device size /512 (long *arg) */
1586edd26f1ef9d2a47c3708aaf6196f8a7239a26699tom#define VKI_BLKRASET   _VKI_IO(0x12,98)	/* set read ahead for block device */
1587edd26f1ef9d2a47c3708aaf6196f8a7239a26699tom#define VKI_BLKRAGET   _VKI_IO(0x12,99)	/* get current read ahead setting */
1588edd26f1ef9d2a47c3708aaf6196f8a7239a26699tom#define VKI_BLKFRASET  _VKI_IO(0x12,100)/* set filesystem (mm/filemap.c) read-ahead */
1589edd26f1ef9d2a47c3708aaf6196f8a7239a26699tom#define VKI_BLKFRAGET  _VKI_IO(0x12,101)/* get filesystem (mm/filemap.c) read-ahead */
1590edd26f1ef9d2a47c3708aaf6196f8a7239a26699tom#define VKI_BLKSECTGET _VKI_IO(0x12,103)/* get max sectors per request (ll_rw_blk.c) */
1591edd26f1ef9d2a47c3708aaf6196f8a7239a26699tom#define VKI_BLKSSZGET  _VKI_IO(0x12,104)/* get block device sector size */
1592edd26f1ef9d2a47c3708aaf6196f8a7239a26699tom#define VKI_BLKBSZGET  _VKI_IOR(0x12,112,vki_size_t)
1593edd26f1ef9d2a47c3708aaf6196f8a7239a26699tom#define VKI_BLKBSZSET  _VKI_IOW(0x12,113,vki_size_t)
1594edd26f1ef9d2a47c3708aaf6196f8a7239a26699tom#define VKI_BLKGETSIZE64 _VKI_IOR(0x12,114,vki_size_t) /* return device size in bytes (u64 *arg) */
159595a9786cd29c06af2c1cda9ac20e5b0ea488faa4nethercote
159673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_FIBMAP	_VKI_IO(0x00,1)	/* bmap access */
159773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_FIGETBSZ    _VKI_IO(0x00,2)	/* get the block size used for bmap */
159873b526fb4af0f60634f0078583d92b931d5c0eebnethercote
159973b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
160073b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/scsi/sg.h
160173b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
160273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
160373b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef struct vki_sg_io_hdr
160473b526fb4af0f60634f0078583d92b931d5c0eebnethercote{
160573b526fb4af0f60634f0078583d92b931d5c0eebnethercote    int interface_id;           /* [i] 'S' for SCSI generic (required) */
160673b526fb4af0f60634f0078583d92b931d5c0eebnethercote    int dxfer_direction;        /* [i] data transfer direction  */
160773b526fb4af0f60634f0078583d92b931d5c0eebnethercote    unsigned char cmd_len;      /* [i] SCSI command length ( <= 16 bytes) */
160873b526fb4af0f60634f0078583d92b931d5c0eebnethercote    unsigned char mx_sb_len;    /* [i] max length to write to sbp */
160973b526fb4af0f60634f0078583d92b931d5c0eebnethercote    unsigned short iovec_count; /* [i] 0 implies no scatter gather */
161073b526fb4af0f60634f0078583d92b931d5c0eebnethercote    unsigned int dxfer_len;     /* [i] byte count of data transfer */
161173b526fb4af0f60634f0078583d92b931d5c0eebnethercote    void __user *dxferp;	/* [i], [*io] points to data transfer memory
161273b526fb4af0f60634f0078583d92b931d5c0eebnethercote					      or scatter gather list */
161373b526fb4af0f60634f0078583d92b931d5c0eebnethercote    unsigned char __user *cmdp; /* [i], [*i] points to command to perform */
161473b526fb4af0f60634f0078583d92b931d5c0eebnethercote    void __user *sbp;		/* [i], [*o] points to sense_buffer memory */
161573b526fb4af0f60634f0078583d92b931d5c0eebnethercote    unsigned int timeout;       /* [i] MAX_UINT->no timeout (unit: millisec) */
161673b526fb4af0f60634f0078583d92b931d5c0eebnethercote    unsigned int flags;         /* [i] 0 -> default, see SG_FLAG... */
161773b526fb4af0f60634f0078583d92b931d5c0eebnethercote    int pack_id;                /* [i->o] unused internally (normally) */
161873b526fb4af0f60634f0078583d92b931d5c0eebnethercote    void __user * usr_ptr;      /* [i->o] unused internally */
161973b526fb4af0f60634f0078583d92b931d5c0eebnethercote    unsigned char status;       /* [o] scsi status */
162073b526fb4af0f60634f0078583d92b931d5c0eebnethercote    unsigned char masked_status;/* [o] shifted, masked scsi status */
162173b526fb4af0f60634f0078583d92b931d5c0eebnethercote    unsigned char msg_status;   /* [o] messaging level data (optional) */
162273b526fb4af0f60634f0078583d92b931d5c0eebnethercote    unsigned char sb_len_wr;    /* [o] byte count actually written to sbp */
162373b526fb4af0f60634f0078583d92b931d5c0eebnethercote    unsigned short host_status; /* [o] errors from host adapter */
162473b526fb4af0f60634f0078583d92b931d5c0eebnethercote    unsigned short driver_status;/* [o] errors from software driver */
162573b526fb4af0f60634f0078583d92b931d5c0eebnethercote    int resid;                  /* [o] dxfer_len - actual_transferred */
162673b526fb4af0f60634f0078583d92b931d5c0eebnethercote    unsigned int duration;      /* [o] time taken by cmd (unit: millisec) */
162773b526fb4af0f60634f0078583d92b931d5c0eebnethercote    unsigned int info;          /* [o] auxiliary information */
162873b526fb4af0f60634f0078583d92b931d5c0eebnethercote} vki_sg_io_hdr_t;  /* 64 bytes long (on i386) */
162973b526fb4af0f60634f0078583d92b931d5c0eebnethercote
163073b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef struct vki_sg_scsi_id { /* used by SG_GET_SCSI_ID ioctl() */
163173b526fb4af0f60634f0078583d92b931d5c0eebnethercote    int host_no;        /* as in "scsi<n>" where 'n' is one of 0, 1, 2 etc */
163273b526fb4af0f60634f0078583d92b931d5c0eebnethercote    int channel;
163373b526fb4af0f60634f0078583d92b931d5c0eebnethercote    int scsi_id;        /* scsi id of target device */
163473b526fb4af0f60634f0078583d92b931d5c0eebnethercote    int lun;
163573b526fb4af0f60634f0078583d92b931d5c0eebnethercote    int scsi_type;      /* TYPE_... defined in scsi/scsi.h */
163673b526fb4af0f60634f0078583d92b931d5c0eebnethercote    short h_cmd_per_lun;/* host (adapter) maximum commands per lun */
163773b526fb4af0f60634f0078583d92b931d5c0eebnethercote    short d_queue_depth;/* device (or adapter) maximum queue length */
163873b526fb4af0f60634f0078583d92b931d5c0eebnethercote    int unused[2];      /* probably find a good use, set 0 for now */
163973b526fb4af0f60634f0078583d92b931d5c0eebnethercote} vki_sg_scsi_id_t; /* 32 bytes long on i386 */
164073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
164173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SG_EMULATED_HOST 0x2203 /* true for emulated host adapter (ATAPI) */
164273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
164373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SG_SET_RESERVED_SIZE 0x2275  /* request a new reserved buffer size */
164473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SG_GET_RESERVED_SIZE 0x2272  /* actual size of reserved buffer */
164573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
164673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SG_GET_SCSI_ID 0x2276   /* Yields fd's bus, chan, dev, lun + type */
164773b526fb4af0f60634f0078583d92b931d5c0eebnethercote
164873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SG_GET_SG_TABLESIZE 0x227F  /* 0 implies can't do scatter gather */
164973b526fb4af0f60634f0078583d92b931d5c0eebnethercote
165073b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SG_GET_VERSION_NUM 0x2282 /* Example: version 2.1.34 yields 20134 */
165173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
165273b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SG_IO 0x2285   /* similar effect as write() followed by read() */
165373b526fb4af0f60634f0078583d92b931d5c0eebnethercote
165473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SG_SET_TIMEOUT 0x2201  /* unit: jiffies (10ms on i386) */
165573b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SG_GET_TIMEOUT 0x2202  /* yield timeout as _return_ value */
165673b526fb4af0f60634f0078583d92b931d5c0eebnethercote
165773b526fb4af0f60634f0078583d92b931d5c0eebnethercote//#define SG_GET_COMMAND_Q 0x2270   /* Yields 0 (queuing off) or 1 (on) */
165873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SG_SET_COMMAND_Q 0x2271   /* Change queuing state with 0 or 1 */
165973b526fb4af0f60634f0078583d92b931d5c0eebnethercote
166073b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
166173b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/cdrom.h
166273b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
166373b526fb4af0f60634f0078583d92b931d5c0eebnethercote
166473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_CDROMPLAYMSF	0x5303 /* Play Audio MSF (struct cdrom_msf) */
166573b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_CDROMREADTOCHDR	0x5305 /* Read TOC header
166673b526fb4af0f60634f0078583d92b931d5c0eebnethercote                                           (struct cdrom_tochdr) */
166773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_CDROMREADTOCENTRY	0x5306 /* Read TOC entry
166873b526fb4af0f60634f0078583d92b931d5c0eebnethercote                                           (struct cdrom_tocentry) */
166973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_CDROMSUBCHNL	0x530b /* Read subchannel data
167073b526fb4af0f60634f0078583d92b931d5c0eebnethercote                                           (struct cdrom_subchnl) */
167173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_CDROMREADMODE2	0x530c /* Read CDROM mode 2 data (2336 Bytes)
167273b526fb4af0f60634f0078583d92b931d5c0eebnethercote                                           (struct cdrom_read) */
167373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_CDROMREADAUDIO	0x530e /* (struct cdrom_read_audio) */
167473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_CDROMMULTISESSION	0x5310 /* Obtain the start-of-last-session
167573b526fb4af0f60634f0078583d92b931d5c0eebnethercote                                           address of multi session disks
167673b526fb4af0f60634f0078583d92b931d5c0eebnethercote                                           (struct cdrom_multisession) */
167773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_CDROM_GET_MCN	0x5311 /* Obtain the "Universal Product Code"
167873b526fb4af0f60634f0078583d92b931d5c0eebnethercote                                           if available (struct cdrom_mcn) */
167973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_CDROMVOLREAD	0x5313 /* Get the drive's volume setting
168073b526fb4af0f60634f0078583d92b931d5c0eebnethercote                                          (struct cdrom_volctrl) */
1681f9d83852c10bc84e8932ab8a1d18766df2f522betom#define VKI_CDROMREADRAW	0x5314	/* read data in raw mode (2352 Bytes)
1682f9d83852c10bc84e8932ab8a1d18766df2f522betom                                           (struct cdrom_read) */
168373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_CDROM_CLEAR_OPTIONS	0x5321  /* Clear behavior options */
168473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_CDROM_DRIVE_STATUS	0x5326  /* Get tray position, etc. */
168573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
168673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_CDROM_SEND_PACKET	0x5393	/* send a packet to the drive */
168773b526fb4af0f60634f0078583d92b931d5c0eebnethercote
168873b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_cdrom_msf0
168973b526fb4af0f60634f0078583d92b931d5c0eebnethercote{
169073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u8	minute;
169173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u8	second;
169273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u8	frame;
169373b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
169473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
169573b526fb4af0f60634f0078583d92b931d5c0eebnethercoteunion vki_cdrom_addr
169673b526fb4af0f60634f0078583d92b931d5c0eebnethercote{
169773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	struct vki_cdrom_msf0	msf;
169873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int			lba;
169973b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
170073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
170173b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_cdrom_msf
170273b526fb4af0f60634f0078583d92b931d5c0eebnethercote{
170373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u8	cdmsf_min0;	/* start minute */
170473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u8	cdmsf_sec0;	/* start second */
170573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u8	cdmsf_frame0;	/* start frame */
170673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u8	cdmsf_min1;	/* end minute */
170773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u8	cdmsf_sec1;	/* end second */
170873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u8	cdmsf_frame1;	/* end frame */
170973b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
171073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
171173b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_cdrom_tochdr
171273b526fb4af0f60634f0078583d92b931d5c0eebnethercote{
171373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u8	cdth_trk0;	/* start track */
171473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u8	cdth_trk1;	/* end track */
171573b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
171673b526fb4af0f60634f0078583d92b931d5c0eebnethercote
171773b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_cdrom_volctrl
171873b526fb4af0f60634f0078583d92b931d5c0eebnethercote{
171973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u8	channel0;
172073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u8	channel1;
172173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u8	channel2;
172273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u8	channel3;
172373b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
172473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
172573b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_cdrom_subchnl
172673b526fb4af0f60634f0078583d92b931d5c0eebnethercote{
172773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u8	cdsc_format;
172873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u8	cdsc_audiostatus;
172973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u8	cdsc_adr:	4;
173073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u8	cdsc_ctrl:	4;
173173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u8	cdsc_trk;
173273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u8	cdsc_ind;
173373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	union vki_cdrom_addr cdsc_absaddr;
173473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	union vki_cdrom_addr cdsc_reladdr;
173573b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
173673b526fb4af0f60634f0078583d92b931d5c0eebnethercote
173773b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_cdrom_tocentry
173873b526fb4af0f60634f0078583d92b931d5c0eebnethercote{
173973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u8	cdte_track;
174073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u8	cdte_adr	:4;
174173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u8	cdte_ctrl	:4;
174273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u8	cdte_format;
174373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	union vki_cdrom_addr cdte_addr;
174473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u8	cdte_datamode;
174573b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
174673b526fb4af0f60634f0078583d92b931d5c0eebnethercote
174773b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_cdrom_read
174873b526fb4af0f60634f0078583d92b931d5c0eebnethercote{
174973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int	cdread_lba;
175073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	char 	*cdread_bufaddr;
175173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int	cdread_buflen;
175273b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
175373b526fb4af0f60634f0078583d92b931d5c0eebnethercote
175473b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_cdrom_read_audio
175573b526fb4af0f60634f0078583d92b931d5c0eebnethercote{
175673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	union vki_cdrom_addr addr; /* frame address */
175773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u8 addr_format;      /* CDROM_LBA or CDROM_MSF */
175873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int nframes;           /* number of 2352-byte-frames to read at once */
175973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u8 __user *buf;      /* frame buffer (size: nframes*2352 bytes) */
176073b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
176173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
176273b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_cdrom_multisession
176373b526fb4af0f60634f0078583d92b931d5c0eebnethercote{
176473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	union vki_cdrom_addr addr; /* frame address: start-of-last-session
176573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	                           (not the new "frame 16"!).  Only valid
176673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	                           if the "xa_flag" is true. */
176773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u8 xa_flag;        /* 1: "is XA disk" */
176873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u8 addr_format;    /* CDROM_LBA or CDROM_MSF */
176973b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
177073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
177173b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_cdrom_mcn
177273b526fb4af0f60634f0078583d92b931d5c0eebnethercote{
177373b526fb4af0f60634f0078583d92b931d5c0eebnethercote  __vki_u8 medium_catalog_number[14]; /* 13 ASCII digits, null-terminated */
177473b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
177573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
177673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_CDROM_PACKET_SIZE	12
177773b526fb4af0f60634f0078583d92b931d5c0eebnethercote
177873b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_cdrom_generic_command
177973b526fb4af0f60634f0078583d92b931d5c0eebnethercote{
178073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned char 		cmd[VKI_CDROM_PACKET_SIZE];
178173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned char		__user *buffer;
178273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned int 		buflen;
178373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int			stat;
178473b526fb4af0f60634f0078583d92b931d5c0eebnethercote        // [[replace with void* to reduce inclusion amounts]]
178573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	void/*struct vki_request_sense	*/__user *sense;
178673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned char		data_direction;
178773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int			quiet;
178873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int			timeout;
178973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	void			__user *reserved[1];	/* unused, actually */
179073b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
179173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
179273b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_CD_SYNC_SIZE         12 /* 12 sync bytes per raw data frame */
179373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_CD_HEAD_SIZE          4 /* header (address) bytes per raw data frame */
179473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_CD_FRAMESIZE_RAW   2352 /* bytes per frame, "raw" mode */
179573b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_CD_FRAMESIZE_RAW0 (VKI_CD_FRAMESIZE_RAW-VKI_CD_SYNC_SIZE-VKI_CD_HEAD_SIZE) /*2336*/
179673b526fb4af0f60634f0078583d92b931d5c0eebnethercote
179773b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
179873b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/soundcard.h
179973b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
180073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
180173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#ifndef _VKI_SIOWR
180273b526fb4af0f60634f0078583d92b931d5c0eebnethercote#if defined(_VKI_IOWR) && (defined(_AIX) || (!defined(sun) && !defined(sparc) && !defined(__sparc__) && !defined(__INCioctlh) && !defined(__Lynx__)))
180373b526fb4af0f60634f0078583d92b931d5c0eebnethercote/* Use already defined ioctl defines if they exist (except with Sun or Sparc) */
180473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define	_VKI_SIO		_VKI_IO
180573b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define	_VKI_SIOR		_VKI_IOR
180673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define	_VKI_SIOW		_VKI_IOW
180773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define	_VKI_SIOWR		_VKI_IOWR
180873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#else
180973b526fb4af0f60634f0078583d92b931d5c0eebnethercote// [[Valgrind: Install this case if/when necessary]
181073b526fb4af0f60634f0078583d92b931d5c0eebnethercote#error Valgrind: Cannot handle sparc/sun case yet...
181173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#  endif /* _IOWR */
181273b526fb4af0f60634f0078583d92b931d5c0eebnethercote#endif  /* !_VKI_SIOWR */
181373b526fb4af0f60634f0078583d92b931d5c0eebnethercote
181473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SNDCTL_SEQ_CTRLRATE		_VKI_SIOWR('Q', 3, int)	/* Set/get timer resolution (HZ) */
181573b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SNDCTL_SEQ_GETOUTCOUNT	_VKI_SIOR ('Q', 4, int)
181673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SNDCTL_SEQ_GETINCOUNT	_VKI_SIOR ('Q', 5, int)
181773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SNDCTL_SEQ_PERCMODE		_VKI_SIOW ('Q', 6, int)
181873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SNDCTL_SEQ_TESTMIDI		_VKI_SIOW ('Q', 8, int)
181973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SNDCTL_SEQ_RESETSAMPLES	_VKI_SIOW ('Q', 9, int)
182073b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SNDCTL_SEQ_NRSYNTHS		_VKI_SIOR ('Q',10, int)
182173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SNDCTL_SEQ_NRMIDIS		_VKI_SIOR ('Q',11, int)
182273b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SNDCTL_SEQ_GETTIME		_VKI_SIOR ('Q',19, int)
182373b526fb4af0f60634f0078583d92b931d5c0eebnethercote
182473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SNDCTL_TMR_TIMEBASE		_VKI_SIOWR('T', 1, int)
182573b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SNDCTL_TMR_TEMPO		_VKI_SIOWR('T', 5, int)
182673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SNDCTL_TMR_SOURCE		_VKI_SIOWR('T', 6, int)
182773b526fb4af0f60634f0078583d92b931d5c0eebnethercote
182873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SNDCTL_MIDI_PRETIME		_VKI_SIOWR('m', 0, int)
182973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SNDCTL_MIDI_MPUMODE		_VKI_SIOWR('m', 1, int)
183073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
183173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SNDCTL_DSP_RESET		_VKI_SIO  ('P', 0)
183273b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SNDCTL_DSP_SYNC		_VKI_SIO  ('P', 1)
183373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SNDCTL_DSP_SPEED		_VKI_SIOWR('P', 2, int)
183473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SNDCTL_DSP_STEREO		_VKI_SIOWR('P', 3, int)
183573b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SNDCTL_DSP_GETBLKSIZE	_VKI_SIOWR('P', 4, int)
183673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SNDCTL_DSP_CHANNELS		_VKI_SIOWR('P', 6, int)
183773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SOUND_PCM_WRITE_FILTER	_VKI_SIOWR('P', 7, int)
183873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SNDCTL_DSP_POST		_VKI_SIO  ('P', 8)
183973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SNDCTL_DSP_SUBDIVIDE	_VKI_SIOWR('P', 9, int)
184073b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SNDCTL_DSP_SETFRAGMENT	_VKI_SIOWR('P',10, int)
184173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
184273b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SNDCTL_DSP_GETFMTS		_VKI_SIOR ('P',11, int) /* Returns a mask */
184373b526fb4af0f60634f0078583d92b931d5c0eebnethercote
184473b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef struct vki_audio_buf_info {
184573b526fb4af0f60634f0078583d92b931d5c0eebnethercote			int fragments;	/* # of available fragments (partially usend ones not counted) */
184673b526fb4af0f60634f0078583d92b931d5c0eebnethercote			int fragstotal;	/* Total # of fragments allocated */
184773b526fb4af0f60634f0078583d92b931d5c0eebnethercote			int fragsize;	/* Size of a fragment in bytes */
184873b526fb4af0f60634f0078583d92b931d5c0eebnethercote
184973b526fb4af0f60634f0078583d92b931d5c0eebnethercote			int bytes;	/* Available space in bytes (includes partially used fragments) */
185073b526fb4af0f60634f0078583d92b931d5c0eebnethercote			/* Note! 'bytes' could be more than fragments*fragsize */
185173b526fb4af0f60634f0078583d92b931d5c0eebnethercote		} vki_audio_buf_info;
185273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
185373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SNDCTL_DSP_GETOSPACE	_VKI_SIOR ('P',12, vki_audio_buf_info)
185473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SNDCTL_DSP_GETISPACE	_VKI_SIOR ('P',13, vki_audio_buf_info)
185573b526fb4af0f60634f0078583d92b931d5c0eebnethercote//#define VKI_SNDCTL_DSP_NONBLOCK	_VKI_SIO  ('P',14)
185673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SNDCTL_DSP_GETCAPS		_VKI_SIOR ('P',15, int)
185773b526fb4af0f60634f0078583d92b931d5c0eebnethercote
185873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SNDCTL_DSP_GETTRIGGER	_VKI_SIOR ('P',16, int)
185973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SNDCTL_DSP_SETTRIGGER	_VKI_SIOW ('P',16, int)
186073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
186173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SNDCTL_DSP_SETSYNCRO	_VKI_SIO  ('P', 21)
186273b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SNDCTL_DSP_SETDUPLEX	_VKI_SIO  ('P', 22)
186373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SNDCTL_DSP_GETODELAY	_VKI_SIOR ('P', 23, int)
186473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
186595a9786cd29c06af2c1cda9ac20e5b0ea488faa4nethercote#define VKI_SNDCTL_DSP_GETCHANNELMASK	_VKI_SIOWR('P', 64, int)
186695a9786cd29c06af2c1cda9ac20e5b0ea488faa4nethercote#define VKI_SNDCTL_DSP_BIND_CHANNEL	_VKI_SIOWR('P', 65, int)
186795a9786cd29c06af2c1cda9ac20e5b0ea488faa4nethercote
186873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SNDCTL_DSP_SETSPDIF		_VKI_SIOW ('P', 66, int)
186973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SNDCTL_DSP_GETSPDIF		_VKI_SIOR ('P', 67, int)
187073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
187173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SOUND_PCM_READ_RATE		_VKI_SIOR ('P', 2, int)
187273b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SOUND_PCM_READ_CHANNELS	_VKI_SIOR ('P', 6, int)
187373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SOUND_PCM_READ_BITS		_VKI_SIOR ('P', 5, int)
187473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SOUND_PCM_READ_FILTER	_VKI_SIOR ('P', 7, int)
187573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
187673b526fb4af0f60634f0078583d92b931d5c0eebnethercote
187773b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
187873b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/hdreg.h
187973b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
188073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
18812c2bc2529113fa4df16d9341c79a3b1f2d4fda56tomstruct vki_hd_geometry {
18822c2bc2529113fa4df16d9341c79a3b1f2d4fda56tom      unsigned char heads;
18832c2bc2529113fa4df16d9341c79a3b1f2d4fda56tom      unsigned char sectors;
18842c2bc2529113fa4df16d9341c79a3b1f2d4fda56tom      unsigned short cylinders;
18852c2bc2529113fa4df16d9341c79a3b1f2d4fda56tom      unsigned long start;
18862c2bc2529113fa4df16d9341c79a3b1f2d4fda56tom};
18872c2bc2529113fa4df16d9341c79a3b1f2d4fda56tom
18882c2bc2529113fa4df16d9341c79a3b1f2d4fda56tom#define VKI_HDIO_GETGEO		0x0301	/* get device geometry */
18895d2af674214d1f7b9abda9b178775c69dc4f7c7dtom#define VKI_HDIO_GET_DMA	0x030b	/* get use-dma flag */
189073b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_HDIO_GET_IDENTITY	0x030d	/* get IDE identification info */
189173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
189273b526fb4af0f60634f0078583d92b931d5c0eebnethercote// [[Nb: done like this because the original type is a huge struct that will
189373b526fb4af0f60634f0078583d92b931d5c0eebnethercote//   always be the same size.]]
189473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIZEOF_STRUCT_HD_DRIVEID   512
189573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
189673b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
189773b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/fb.h
189873b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
189973b526fb4af0f60634f0078583d92b931d5c0eebnethercote
190073b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_FBIOGET_VSCREENINFO	0x4600
190173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_FBIOGET_FSCREENINFO	0x4602
190273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
190373b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_fb_fix_screeninfo {
190473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	char id[16];			/* identification string eg "TT Builtin" */
190573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long smem_start;	/* Start of frame buffer mem */
190673b526fb4af0f60634f0078583d92b931d5c0eebnethercote					/* (physical address) */
190773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 smem_len;			/* Length of frame buffer mem */
190873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 type;			/* see FB_TYPE_*		*/
190973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 type_aux;		/* Interleave for interleaved Planes */
191073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 visual;		/* see FB_VISUAL_*		*/
191173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u16 xpanstep;		/* zero if no hardware panning  */
191273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u16 ypanstep;		/* zero if no hardware panning  */
191373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u16 ywrapstep;		/* zero if no hardware ywrap    */
191473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 line_length;		/* length of a line in bytes    */
191573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long mmio_start;	/* Start of Memory Mapped I/O   */
191673b526fb4af0f60634f0078583d92b931d5c0eebnethercote					/* (physical address) */
191773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 mmio_len;		/* Length of Memory Mapped I/O  */
191873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 accel;		/* Indicate to driver which	*/
191973b526fb4af0f60634f0078583d92b931d5c0eebnethercote					/*  specific chip/card we have	*/
192073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u16 reserved[3];		/* Reserved for future compatibility */
192173b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
192273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
192373b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_fb_bitfield {
192473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 offset;		/* beginning of bitfield	*/
192573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 length;		/* length of bitfield		*/
192673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 msb_right;		/* != 0 : Most significant bit is */
192773b526fb4af0f60634f0078583d92b931d5c0eebnethercote					/* right */
192873b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
192973b526fb4af0f60634f0078583d92b931d5c0eebnethercote
193073b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_fb_var_screeninfo {
193173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 xres;			/* visible resolution		*/
193273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 yres;
193373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 xres_virtual;		/* virtual resolution		*/
193473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 yres_virtual;
193573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 xoffset;		/* offset from virtual to visible */
193673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 yoffset;		/* resolution			*/
193773b526fb4af0f60634f0078583d92b931d5c0eebnethercote
193873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 bits_per_pixel;	/* guess what			*/
193973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 grayscale;		/* != 0 Graylevels instead of colors */
194073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
194173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	struct vki_fb_bitfield red;	/* bitfield in fb mem if true color, */
194273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	struct vki_fb_bitfield green;	/* else only length is significant */
194373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	struct vki_fb_bitfield blue;
194473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	struct vki_fb_bitfield transp;	/* transparency			*/
194573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
194673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 nonstd;		/* != 0 Non standard pixel format */
194773b526fb4af0f60634f0078583d92b931d5c0eebnethercote
194873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 activate;		/* see FB_ACTIVATE_*		*/
194973b526fb4af0f60634f0078583d92b931d5c0eebnethercote
195073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 height;		/* height of picture in mm    */
195173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 width;		/* width of picture in mm     */
195273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
195373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 accel_flags;		/* (OBSOLETE) see fb_info.flags */
195473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
195573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	/* Timing: All values in pixclocks, except pixclock (of course) */
195673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 pixclock;		/* pixel clock in ps (pico seconds) */
195773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 left_margin;		/* time from sync to picture	*/
195873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 right_margin;		/* time from picture to sync	*/
195973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 upper_margin;		/* time from sync to picture	*/
196073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 lower_margin;
196173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 hsync_len;		/* length of horizontal sync	*/
196273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 vsync_len;		/* length of vertical sync	*/
196373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 sync;			/* see FB_SYNC_*		*/
196473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 vmode;		/* see FB_VMODE_*		*/
196573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 rotate;		/* angle we rotate counter clockwise */
196673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 reserved[5];		/* Reserved for future compatibility */
196773b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
196873b526fb4af0f60634f0078583d92b931d5c0eebnethercote
1969b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes//----------------------------------------------------------------------
1970053eb0470396ddd47a7cc1ea4882a3c241631e10tom// From linux-2.6.9/include/linux/kd.h
1971b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes//----------------------------------------------------------------------
1972b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes
1973b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_GIO_FONT       0x4B60  /* gets font in expanded form */
1974b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_PIO_FONT       0x4B61  /* use font in expanded form */
1975b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes
1976b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_GIO_FONTX      0x4B6B  /* get font using struct consolefontdesc */
1977b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_PIO_FONTX      0x4B6C  /* set font using struct consolefontdesc */
1978b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughesstruct vki_consolefontdesc {
1979b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes	unsigned short charcount;	/* characters in font (256 or 512) */
1980b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes	unsigned short charheight;	/* scan lines per character (1-32) */
1981b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes	char __user *chardata;		/* font data in expanded form */
1982b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes};
1983b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes
1984b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_PIO_FONTRESET  0x4B6D  /* reset to default font */
1985b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes
1986b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_GIO_CMAP       0x4B70  /* gets colour palette on VGA+ */
1987b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_PIO_CMAP       0x4B71  /* sets colour palette on VGA+ */
1988b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes
1989b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_KIOCSOUND      0x4B2F  /* start sound generation (0 for off) */
1990b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_KDMKTONE       0x4B30  /* generate tone */
1991b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes
1992b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_KDGETLED       0x4B31  /* return current led state */
1993b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_KDSETLED       0x4B32  /* set led state [lights, not flags] */
1994b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes
1995b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_KDGKBTYPE      0x4B33  /* get keyboard type */
1996b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes
1997b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_KDADDIO        0x4B34  /* add i/o port as valid */
1998b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_KDDELIO        0x4B35  /* del i/o port as valid */
1999b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_KDENABIO       0x4B36  /* enable i/o to video board */
2000b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_KDDISABIO      0x4B37  /* disable i/o to video board */
2001b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes
2002b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_KDSETMODE      0x4B3A  /* set text/graphics mode */
2003b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_KDGETMODE      0x4B3B  /* get current mode */
2004b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes
2005b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_KDMAPDISP      0x4B3C  /* map display into address space */
2006b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_KDUNMAPDISP    0x4B3D  /* unmap display from address space */
2007b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes
2008b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define		VKI_E_TABSZ		256
2009b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_GIO_SCRNMAP    0x4B40  /* get screen mapping from kernel */
2010b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_PIO_SCRNMAP	   0x4B41  /* put screen mapping table in kernel */
2011b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_GIO_UNISCRNMAP 0x4B69  /* get full Unicode screen mapping */
2012b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_PIO_UNISCRNMAP 0x4B6A  /* set full Unicode screen mapping */
2013b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes
2014b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_GIO_UNIMAP     0x4B66  /* get unicode-to-font mapping from kernel */
2015053eb0470396ddd47a7cc1ea4882a3c241631e10tomstruct vki_unipair {
2016053eb0470396ddd47a7cc1ea4882a3c241631e10tom	unsigned short unicode;
2017053eb0470396ddd47a7cc1ea4882a3c241631e10tom	unsigned short fontpos;
2018053eb0470396ddd47a7cc1ea4882a3c241631e10tom};
2019053eb0470396ddd47a7cc1ea4882a3c241631e10tomstruct vki_unimapdesc {
2020053eb0470396ddd47a7cc1ea4882a3c241631e10tom	unsigned short entry_ct;
2021053eb0470396ddd47a7cc1ea4882a3c241631e10tom	struct vki_unipair __user *entries;
2022053eb0470396ddd47a7cc1ea4882a3c241631e10tom};
2023b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_PIO_UNIMAP     0x4B67  /* put unicode-to-font mapping in kernel */
2024b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_PIO_UNIMAPCLR  0x4B68  /* clear table, possibly advise hash algorithm */
2025053eb0470396ddd47a7cc1ea4882a3c241631e10tomstruct vki_unimapinit {
2026053eb0470396ddd47a7cc1ea4882a3c241631e10tom	unsigned short advised_hashsize;  /* 0 if no opinion */
2027053eb0470396ddd47a7cc1ea4882a3c241631e10tom	unsigned short advised_hashstep;  /* 0 if no opinion */
2028053eb0470396ddd47a7cc1ea4882a3c241631e10tom	unsigned short advised_hashlevel; /* 0 if no opinion */
2029053eb0470396ddd47a7cc1ea4882a3c241631e10tom};
2030b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes
2031b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_KDGKBMODE      0x4B44  /* gets current keyboard mode */
2032b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_KDSKBMODE      0x4B45  /* sets current keyboard mode */
2033b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes
2034b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_KDGKBMETA      0x4B62  /* gets meta key handling mode */
2035b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_KDSKBMETA      0x4B63  /* sets meta key handling mode */
2036b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes
2037b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_KDGKBLED       0x4B64  /* get led flags (not lights) */
2038b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_KDSKBLED       0x4B65  /* set led flags (not lights) */
2039b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes
2040b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughesstruct vki_kbentry {
2041b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes	unsigned char kb_table;
2042b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes	unsigned char kb_index;
2043b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes	unsigned short kb_value;
2044b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes};
2045b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_KDGKBENT       0x4B46  /* gets one entry in translation table */
2046b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_KDSKBENT       0x4B47  /* sets one entry in translation table */
2047b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes
2048b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughesstruct vki_kbsentry {
2049b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes	unsigned char kb_func;
2050b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes	unsigned char kb_string[512];
2051b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes};
2052b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_KDGKBSENT      0x4B48  /* gets one function key string entry */
2053b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_KDSKBSENT      0x4B49  /* sets one function key string entry */
2054b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes
2055b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughesstruct vki_kbdiacr {
2056b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes        unsigned char diacr, base, result;
2057b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes};
2058b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughesstruct vki_kbdiacrs {
2059b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes        unsigned int kb_cnt;    /* number of entries in following array */
2060b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes	struct vki_kbdiacr kbdiacr[256];    /* MAX_DIACR from keyboard.h */
2061b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes};
2062b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_KDGKBDIACR     0x4B4A  /* read kernel accent table */
2063b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_KDSKBDIACR     0x4B4B  /* write kernel accent table */
2064b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes
2065b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughesstruct vki_kbkeycode {
2066b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes	unsigned int scancode, keycode;
2067b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes};
2068b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_KDGETKEYCODE   0x4B4C  /* read kernel keycode table entry */
2069b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_KDSETKEYCODE   0x4B4D  /* write kernel keycode table entry */
2070b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes
2071b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_KDSIGACCEPT    0x4B4E  /* accept kbd generated signals */
2072b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes
2073b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughesstruct vki_kbd_repeat {
2074b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes	int delay;	/* in msec; <= 0: don't change */
2075b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes	int period;	/* in msec; <= 0: don't change */
2076b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes			/* earlier this field was misnamed "rate" */
2077b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes};
2078b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_KDKBDREP       0x4B52  /* set keyboard delay/repeat rate;
2079b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes                                    * actually used values are returned */
2080b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes
2081b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes#define VKI_KDFONTOP       0x4B72  /* font operations */
2082b3d3bcf257e94efdd67133f8529c7018c9fd6cacthughes
2083053eb0470396ddd47a7cc1ea4882a3c241631e10tomstruct vki_console_font_op {
2084053eb0470396ddd47a7cc1ea4882a3c241631e10tom	unsigned int op;	/* operation code KD_FONT_OP_* */
2085053eb0470396ddd47a7cc1ea4882a3c241631e10tom	unsigned int flags;	/* KD_FONT_FLAG_* */
2086053eb0470396ddd47a7cc1ea4882a3c241631e10tom	unsigned int width, height;	/* font size */
2087053eb0470396ddd47a7cc1ea4882a3c241631e10tom	unsigned int charcount;
2088053eb0470396ddd47a7cc1ea4882a3c241631e10tom	unsigned char __user *data;	/* font data with height fixed to 32 */
2089053eb0470396ddd47a7cc1ea4882a3c241631e10tom};
2090053eb0470396ddd47a7cc1ea4882a3c241631e10tom
2091053eb0470396ddd47a7cc1ea4882a3c241631e10tom#define VKI_KD_FONT_OP_SET		0	/* Set font */
2092053eb0470396ddd47a7cc1ea4882a3c241631e10tom#define VKI_KD_FONT_OP_GET		1	/* Get font */
2093053eb0470396ddd47a7cc1ea4882a3c241631e10tom#define VKI_KD_FONT_OP_SET_DEFAULT	2	/* Set font to default, data points to name / NULL */
2094053eb0470396ddd47a7cc1ea4882a3c241631e10tom#define VKI_KD_FONT_OP_COPY		3	/* Copy from another console */
2095053eb0470396ddd47a7cc1ea4882a3c241631e10tom
20965b653bc2c60f6913e5bb6c2ebabfcf705a90c012nethercote//----------------------------------------------------------------------
20975b653bc2c60f6913e5bb6c2ebabfcf705a90c012nethercote// From linux-2.6.9/include/linux/kb.h
20985b653bc2c60f6913e5bb6c2ebabfcf705a90c012nethercote//----------------------------------------------------------------------
20995b653bc2c60f6913e5bb6c2ebabfcf705a90c012nethercote
21005b653bc2c60f6913e5bb6c2ebabfcf705a90c012nethercotetypedef __vki_kernel_uid32_t vki_qid_t; /* Type in which we store ids in memory */
21015b653bc2c60f6913e5bb6c2ebabfcf705a90c012nethercote
2102ca0518df66f8c3375a860f1a55a51f18e2a16c44njn//----------------------------------------------------------------------
2103b807a78ac64d06eb04977044035d665d8a3c4f68tom// From linux-2.6.20.1/include/linux/ptrace.h
2104ca0518df66f8c3375a860f1a55a51f18e2a16c44njn//----------------------------------------------------------------------
2105ca0518df66f8c3375a860f1a55a51f18e2a16c44njn
210645f4e7c91119c7d01a59f5e827c67841632c9314sewardj#define VKI_PTRACE_TRACEME         0
2107ca0518df66f8c3375a860f1a55a51f18e2a16c44njn#define VKI_PTRACE_PEEKTEXT	   1
2108ca0518df66f8c3375a860f1a55a51f18e2a16c44njn#define VKI_PTRACE_PEEKDATA	   2
2109ca0518df66f8c3375a860f1a55a51f18e2a16c44njn#define VKI_PTRACE_PEEKUSR	   3
21100109322c627d5f54ef6df387f4def68f0c1089e5tom#define VKI_PTRACE_POKEUSR	   6
21115b653bc2c60f6913e5bb6c2ebabfcf705a90c012nethercote
2112b807a78ac64d06eb04977044035d665d8a3c4f68tom#define VKI_PTRACE_DETACH         17
2113b807a78ac64d06eb04977044035d665d8a3c4f68tom
2114b807a78ac64d06eb04977044035d665d8a3c4f68tom#define VKI_PTRACE_GETEVENTMSG	0x4201
2115b807a78ac64d06eb04977044035d665d8a3c4f68tom#define VKI_PTRACE_GETSIGINFO	0x4202
2116b807a78ac64d06eb04977044035d665d8a3c4f68tom#define VKI_PTRACE_SETSIGINFO	0x4203
211745f4e7c91119c7d01a59f5e827c67841632c9314sewardj
21182f9328846035a021857b3f398af729bd7b08fb63tom//----------------------------------------------------------------------
21192f9328846035a021857b3f398af729bd7b08fb63tom// From linux-2.6.14/include/sound/asound.h
21202f9328846035a021857b3f398af729bd7b08fb63tom//----------------------------------------------------------------------
21212f9328846035a021857b3f398af729bd7b08fb63tom
21222f9328846035a021857b3f398af729bd7b08fb63tomenum {
21232f9328846035a021857b3f398af729bd7b08fb63tom	VKI_SNDRV_PCM_IOCTL_HW_FREE = _VKI_IO('A', 0x12),
21242f9328846035a021857b3f398af729bd7b08fb63tom	VKI_SNDRV_PCM_IOCTL_HWSYNC = _VKI_IO('A', 0x22),
21252f9328846035a021857b3f398af729bd7b08fb63tom	VKI_SNDRV_PCM_IOCTL_PREPARE = _VKI_IO('A', 0x40),
21262f9328846035a021857b3f398af729bd7b08fb63tom	VKI_SNDRV_PCM_IOCTL_RESET = _VKI_IO('A', 0x41),
21272f9328846035a021857b3f398af729bd7b08fb63tom	VKI_SNDRV_PCM_IOCTL_START = _VKI_IO('A', 0x42),
21282f9328846035a021857b3f398af729bd7b08fb63tom	VKI_SNDRV_PCM_IOCTL_DROP = _VKI_IO('A', 0x43),
21292f9328846035a021857b3f398af729bd7b08fb63tom	VKI_SNDRV_PCM_IOCTL_DRAIN = _VKI_IO('A', 0x44),
21302f9328846035a021857b3f398af729bd7b08fb63tom	VKI_SNDRV_PCM_IOCTL_RESUME = _VKI_IO('A', 0x47),
21312f9328846035a021857b3f398af729bd7b08fb63tom	VKI_SNDRV_PCM_IOCTL_XRUN = _VKI_IO('A', 0x48),
21322f9328846035a021857b3f398af729bd7b08fb63tom	VKI_SNDRV_PCM_IOCTL_UNLINK = _VKI_IO('A', 0x61),
21332f9328846035a021857b3f398af729bd7b08fb63tom};
21342f9328846035a021857b3f398af729bd7b08fb63tom
21352f9328846035a021857b3f398af729bd7b08fb63tomenum {
21362f9328846035a021857b3f398af729bd7b08fb63tom	VKI_SNDRV_TIMER_IOCTL_START = _VKI_IO('T', 0xa0),
21372f9328846035a021857b3f398af729bd7b08fb63tom	VKI_SNDRV_TIMER_IOCTL_STOP = _VKI_IO('T', 0xa1),
21382f9328846035a021857b3f398af729bd7b08fb63tom	VKI_SNDRV_TIMER_IOCTL_CONTINUE = _VKI_IO('T', 0xa2),
21392f9328846035a021857b3f398af729bd7b08fb63tom	VKI_SNDRV_TIMER_IOCTL_PAUSE = _VKI_IO('T', 0xa3),
21402f9328846035a021857b3f398af729bd7b08fb63tom};
21412f9328846035a021857b3f398af729bd7b08fb63tom
21425d2af674214d1f7b9abda9b178775c69dc4f7c7dtom//----------------------------------------------------------------------
21435d2af674214d1f7b9abda9b178775c69dc4f7c7dtom// From linux-2.6.15.4/include/linux/serial.h
21445d2af674214d1f7b9abda9b178775c69dc4f7c7dtom//----------------------------------------------------------------------
21455d2af674214d1f7b9abda9b178775c69dc4f7c7dtom
21465d2af674214d1f7b9abda9b178775c69dc4f7c7dtomstruct vki_serial_icounter_struct {
21475d2af674214d1f7b9abda9b178775c69dc4f7c7dtom	int cts, dsr, rng, dcd;
21485d2af674214d1f7b9abda9b178775c69dc4f7c7dtom	int rx, tx;
21495d2af674214d1f7b9abda9b178775c69dc4f7c7dtom	int frame, overrun, parity, brk;
21505d2af674214d1f7b9abda9b178775c69dc4f7c7dtom	int buf_overrun;
21515d2af674214d1f7b9abda9b178775c69dc4f7c7dtom	int reserved[9];
21525d2af674214d1f7b9abda9b178775c69dc4f7c7dtom};
21535d2af674214d1f7b9abda9b178775c69dc4f7c7dtom
2154053eb0470396ddd47a7cc1ea4882a3c241631e10tom//----------------------------------------------------------------------
2155053eb0470396ddd47a7cc1ea4882a3c241631e10tom// From linux-2.6.16/include/linux/vt.h
2156053eb0470396ddd47a7cc1ea4882a3c241631e10tom//----------------------------------------------------------------------
2157053eb0470396ddd47a7cc1ea4882a3c241631e10tom
2158053eb0470396ddd47a7cc1ea4882a3c241631e10tom#define VKI_VT_OPENQRY	0x5600	/* find available vt */
2159053eb0470396ddd47a7cc1ea4882a3c241631e10tom
2160053eb0470396ddd47a7cc1ea4882a3c241631e10tomstruct vki_vt_mode {
2161053eb0470396ddd47a7cc1ea4882a3c241631e10tom	char mode;		/* vt mode */
2162053eb0470396ddd47a7cc1ea4882a3c241631e10tom	char waitv;		/* if set, hang on writes if not active */
2163053eb0470396ddd47a7cc1ea4882a3c241631e10tom	short relsig;		/* signal to raise on release req */
2164053eb0470396ddd47a7cc1ea4882a3c241631e10tom	short acqsig;		/* signal to raise on acquisition */
2165053eb0470396ddd47a7cc1ea4882a3c241631e10tom	short frsig;		/* unused (set to 0) */
2166053eb0470396ddd47a7cc1ea4882a3c241631e10tom};
2167053eb0470396ddd47a7cc1ea4882a3c241631e10tom#define VKI_VT_GETMODE	0x5601	/* get mode of active vt */
2168053eb0470396ddd47a7cc1ea4882a3c241631e10tom#define VKI_VT_SETMODE	0x5602	/* set mode of active vt */
2169053eb0470396ddd47a7cc1ea4882a3c241631e10tom
2170053eb0470396ddd47a7cc1ea4882a3c241631e10tomstruct vki_vt_stat {
2171053eb0470396ddd47a7cc1ea4882a3c241631e10tom	unsigned short v_active;	/* active vt */
2172053eb0470396ddd47a7cc1ea4882a3c241631e10tom	unsigned short v_signal;	/* signal to send */
2173053eb0470396ddd47a7cc1ea4882a3c241631e10tom	unsigned short v_state;		/* vt bitmask */
2174053eb0470396ddd47a7cc1ea4882a3c241631e10tom};
2175053eb0470396ddd47a7cc1ea4882a3c241631e10tom#define VKI_VT_GETSTATE	0x5603	/* get global vt state info */
2176053eb0470396ddd47a7cc1ea4882a3c241631e10tom#define VKI_VT_SENDSIG	0x5604	/* signal to send to bitmask of vts */
2177053eb0470396ddd47a7cc1ea4882a3c241631e10tom
2178053eb0470396ddd47a7cc1ea4882a3c241631e10tom#define VKI_VT_RELDISP	0x5605	/* release display */
2179053eb0470396ddd47a7cc1ea4882a3c241631e10tom
2180053eb0470396ddd47a7cc1ea4882a3c241631e10tom#define VKI_VT_ACTIVATE	0x5606	/* make vt active */
2181053eb0470396ddd47a7cc1ea4882a3c241631e10tom#define VKI_VT_WAITACTIVE	0x5607	/* wait for vt active */
2182053eb0470396ddd47a7cc1ea4882a3c241631e10tom#define VKI_VT_DISALLOCATE	0x5608  /* free memory associated to vt */
2183053eb0470396ddd47a7cc1ea4882a3c241631e10tom
2184053eb0470396ddd47a7cc1ea4882a3c241631e10tomstruct vki_vt_sizes {
2185053eb0470396ddd47a7cc1ea4882a3c241631e10tom	unsigned short v_rows;		/* number of rows */
2186053eb0470396ddd47a7cc1ea4882a3c241631e10tom	unsigned short v_cols;		/* number of columns */
2187053eb0470396ddd47a7cc1ea4882a3c241631e10tom	unsigned short v_scrollsize;	/* number of lines of scrollback */
2188053eb0470396ddd47a7cc1ea4882a3c241631e10tom};
2189053eb0470396ddd47a7cc1ea4882a3c241631e10tom#define VKI_VT_RESIZE	0x5609	/* set kernel's idea of screensize */
2190053eb0470396ddd47a7cc1ea4882a3c241631e10tom
2191053eb0470396ddd47a7cc1ea4882a3c241631e10tomstruct vki_vt_consize {
2192053eb0470396ddd47a7cc1ea4882a3c241631e10tom	unsigned short v_rows;	/* number of rows */
2193053eb0470396ddd47a7cc1ea4882a3c241631e10tom	unsigned short v_cols;	/* number of columns */
2194053eb0470396ddd47a7cc1ea4882a3c241631e10tom	unsigned short v_vlin;	/* number of pixel rows on screen */
2195053eb0470396ddd47a7cc1ea4882a3c241631e10tom	unsigned short v_clin;	/* number of pixel rows per character */
2196053eb0470396ddd47a7cc1ea4882a3c241631e10tom	unsigned short v_vcol;	/* number of pixel columns on screen */
2197053eb0470396ddd47a7cc1ea4882a3c241631e10tom	unsigned short v_ccol;	/* number of pixel columns per character */
2198053eb0470396ddd47a7cc1ea4882a3c241631e10tom};
2199053eb0470396ddd47a7cc1ea4882a3c241631e10tom#define VKI_VT_RESIZEX      0x560A  /* set kernel's idea of screensize + more */
2200053eb0470396ddd47a7cc1ea4882a3c241631e10tom#define VKI_VT_LOCKSWITCH   0x560B  /* disallow vt switching */
2201053eb0470396ddd47a7cc1ea4882a3c241631e10tom#define VKI_VT_UNLOCKSWITCH 0x560C  /* allow vt switching */
2202053eb0470396ddd47a7cc1ea4882a3c241631e10tom
2203a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom//----------------------------------------------------------------------
2204a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom// From linux-2.6.19/include/linux/prctl.h
2205a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom//----------------------------------------------------------------------
2206a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom
2207a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom#define VKI_PR_SET_PDEATHSIG  1  /* Second arg is a signal */
2208a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom#define VKI_PR_GET_PDEATHSIG  2  /* Second arg is a ptr to return the signal */
2209a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom
2210a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom#define VKI_PR_GET_DUMPABLE   3
2211a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom#define VKI_PR_SET_DUMPABLE   4
2212a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom
2213a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom#define VKI_PR_GET_UNALIGN	  5
2214a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom#define VKI_PR_SET_UNALIGN	  6
2215a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom# define VKI_PR_UNALIGN_NOPRINT	1	/* silently fix up unaligned user accesses */
2216a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom# define VKI_PR_UNALIGN_SIGBUS	2	/* generate SIGBUS on unaligned user access */
2217a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom
2218a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom#define VKI_PR_GET_KEEPCAPS   7
2219a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom#define VKI_PR_SET_KEEPCAPS   8
2220a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom
2221a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom#define VKI_PR_GET_FPEMU  9
2222a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom#define VKI_PR_SET_FPEMU 10
2223a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom# define VKI_PR_FPEMU_NOPRINT	1	/* silently emulate fp operations accesses */
2224a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom# define VKI_PR_FPEMU_SIGFPE	2	/* don't emulate fp operations, send SIGFPE instead */
2225a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom
2226a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom#define VKI_PR_GET_FPEXC	11
2227a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom#define VKI_PR_SET_FPEXC	12
2228a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom# define VKI_PR_FP_EXC_SW_ENABLE	0x80	/* Use FPEXC for FP exception enables */
2229a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom# define VKI_PR_FP_EXC_DIV		0x010000	/* floating point divide by zero */
2230a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom# define VKI_PR_FP_EXC_OVF		0x020000	/* floating point overflow */
2231a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom# define VKI_PR_FP_EXC_UND		0x040000	/* floating point underflow */
2232a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom# define VKI_PR_FP_EXC_RES		0x080000	/* floating point inexact result */
2233a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom# define VKI_PR_FP_EXC_INV		0x100000	/* floating point invalid operation */
2234a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom# define VKI_PR_FP_EXC_DISABLED	0	/* FP exceptions disabled */
2235a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom# define VKI_PR_FP_EXC_NONRECOV	1	/* async non-recoverable exc. mode */
2236a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom# define VKI_PR_FP_EXC_ASYNC	2	/* async recoverable exception mode */
2237a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom# define VKI_PR_FP_EXC_PRECISE	3	/* precise exception mode */
2238a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom
2239a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom#define VKI_PR_GET_TIMING   13
2240a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom#define VKI_PR_SET_TIMING   14
2241a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom# define VKI_PR_TIMING_STATISTICAL  0       /* Normal, traditional,
2242a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom                                                   statistical process timing */
2243a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom# define VKI_PR_TIMING_TIMESTAMP    1       /* Accurate timestamp based
2244a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom                                                   process timing */
2245a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom
2246a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom#define VKI_PR_SET_NAME    15		/* Set process name */
2247a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom#define VKI_PR_GET_NAME    16		/* Get process name */
2248a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom
2249a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom#define VKI_PR_GET_ENDIAN	19
2250a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom#define VKI_PR_SET_ENDIAN	20
2251a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom# define VKI_PR_ENDIAN_BIG		0
2252a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom# define VKI_PR_ENDIAN_LITTLE	1	/* True little endian mode */
2253a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom# define VKI_PR_ENDIAN_PPC_LITTLE	2	/* "PowerPC" pseudo little endian */
2254a39ebc8e9f7e1b2cdee6c263a3898677a3296e56tom
2255d7cf487123e934a38c6f3e22a40aebf5f00d55fftom//----------------------------------------------------------------------
2256d7cf487123e934a38c6f3e22a40aebf5f00d55fftom// From linux-2.6.19/include/linux/usbdevice_fs.h
2257d7cf487123e934a38c6f3e22a40aebf5f00d55fftom//----------------------------------------------------------------------
2258d7cf487123e934a38c6f3e22a40aebf5f00d55fftom
2259d7cf487123e934a38c6f3e22a40aebf5f00d55fftomstruct vki_usbdevfs_ctrltransfer {
2260d7cf487123e934a38c6f3e22a40aebf5f00d55fftom	__vki_u8 bRequestType;
2261d7cf487123e934a38c6f3e22a40aebf5f00d55fftom	__vki_u8 bRequest;
2262d7cf487123e934a38c6f3e22a40aebf5f00d55fftom	__vki_u16 wValue;
2263d7cf487123e934a38c6f3e22a40aebf5f00d55fftom	__vki_u16 wIndex;
2264d7cf487123e934a38c6f3e22a40aebf5f00d55fftom	__vki_u16 wLength;
2265d7cf487123e934a38c6f3e22a40aebf5f00d55fftom	__vki_u32 timeout;  /* in milliseconds */
2266d7cf487123e934a38c6f3e22a40aebf5f00d55fftom 	void __user *data;
2267d7cf487123e934a38c6f3e22a40aebf5f00d55fftom};
2268d7cf487123e934a38c6f3e22a40aebf5f00d55fftom
2269d7cf487123e934a38c6f3e22a40aebf5f00d55fftomstruct vki_usbdevfs_bulktransfer {
2270d7cf487123e934a38c6f3e22a40aebf5f00d55fftom	unsigned int ep;
2271d7cf487123e934a38c6f3e22a40aebf5f00d55fftom	unsigned int len;
2272d7cf487123e934a38c6f3e22a40aebf5f00d55fftom	unsigned int timeout; /* in milliseconds */
2273d7cf487123e934a38c6f3e22a40aebf5f00d55fftom	void __user *data;
2274d7cf487123e934a38c6f3e22a40aebf5f00d55fftom};
2275d7cf487123e934a38c6f3e22a40aebf5f00d55fftom
2276d7cf487123e934a38c6f3e22a40aebf5f00d55fftom#define VKI_USBDEVFS_MAXDRIVERNAME 255
2277d7cf487123e934a38c6f3e22a40aebf5f00d55fftom
2278d7cf487123e934a38c6f3e22a40aebf5f00d55fftomstruct vki_usbdevfs_getdriver {
2279d7cf487123e934a38c6f3e22a40aebf5f00d55fftom	unsigned int interface;
2280d7cf487123e934a38c6f3e22a40aebf5f00d55fftom	char driver[VKI_USBDEVFS_MAXDRIVERNAME + 1];
2281d7cf487123e934a38c6f3e22a40aebf5f00d55fftom};
2282d7cf487123e934a38c6f3e22a40aebf5f00d55fftom
2283d7cf487123e934a38c6f3e22a40aebf5f00d55fftomstruct vki_usbdevfs_connectinfo {
2284d7cf487123e934a38c6f3e22a40aebf5f00d55fftom	unsigned int devnum;
2285d7cf487123e934a38c6f3e22a40aebf5f00d55fftom	unsigned char slow;
2286d7cf487123e934a38c6f3e22a40aebf5f00d55fftom};
2287d7cf487123e934a38c6f3e22a40aebf5f00d55fftom
2288d7cf487123e934a38c6f3e22a40aebf5f00d55fftomstruct vki_usbdevfs_iso_packet_desc {
2289d7cf487123e934a38c6f3e22a40aebf5f00d55fftom	unsigned int length;
2290d7cf487123e934a38c6f3e22a40aebf5f00d55fftom	unsigned int actual_length;
2291d7cf487123e934a38c6f3e22a40aebf5f00d55fftom	unsigned int status;
2292d7cf487123e934a38c6f3e22a40aebf5f00d55fftom};
2293d7cf487123e934a38c6f3e22a40aebf5f00d55fftom
2294d7cf487123e934a38c6f3e22a40aebf5f00d55fftomstruct vki_usbdevfs_urb {
2295d7cf487123e934a38c6f3e22a40aebf5f00d55fftom	unsigned char type;
2296d7cf487123e934a38c6f3e22a40aebf5f00d55fftom	unsigned char endpoint;
2297d7cf487123e934a38c6f3e22a40aebf5f00d55fftom	int status;
2298d7cf487123e934a38c6f3e22a40aebf5f00d55fftom	unsigned int flags;
2299d7cf487123e934a38c6f3e22a40aebf5f00d55fftom	void __user *buffer;
2300d7cf487123e934a38c6f3e22a40aebf5f00d55fftom	int buffer_length;
2301d7cf487123e934a38c6f3e22a40aebf5f00d55fftom	int actual_length;
2302d7cf487123e934a38c6f3e22a40aebf5f00d55fftom	int start_frame;
2303d7cf487123e934a38c6f3e22a40aebf5f00d55fftom	int number_of_packets;
2304d7cf487123e934a38c6f3e22a40aebf5f00d55fftom	int error_count;
2305d7cf487123e934a38c6f3e22a40aebf5f00d55fftom	unsigned int signr;  /* signal to be sent on error, -1 if none should be sent */
2306d7cf487123e934a38c6f3e22a40aebf5f00d55fftom	void *usercontext;
2307d7cf487123e934a38c6f3e22a40aebf5f00d55fftom	struct vki_usbdevfs_iso_packet_desc iso_frame_desc[0];
2308d7cf487123e934a38c6f3e22a40aebf5f00d55fftom};
2309d7cf487123e934a38c6f3e22a40aebf5f00d55fftom
2310d7cf487123e934a38c6f3e22a40aebf5f00d55fftomstruct vki_usbdevfs_ioctl {
2311d7cf487123e934a38c6f3e22a40aebf5f00d55fftom	int	ifno;		/* interface 0..N ; negative numbers reserved */
2312d7cf487123e934a38c6f3e22a40aebf5f00d55fftom	int	ioctl_code;	/* MUST encode size + direction of data so the
2313d7cf487123e934a38c6f3e22a40aebf5f00d55fftom				 * macros in <asm/ioctl.h> give correct values */
2314d7cf487123e934a38c6f3e22a40aebf5f00d55fftom	void __user *data;	/* param buffer (in, or out) */
2315d7cf487123e934a38c6f3e22a40aebf5f00d55fftom};
2316d7cf487123e934a38c6f3e22a40aebf5f00d55fftom
2317d7cf487123e934a38c6f3e22a40aebf5f00d55fftom#define VKI_USBDEVFS_CONTROL           _VKI_IOWR('U', 0, struct vki_usbdevfs_ctrltransfer)
2318d7cf487123e934a38c6f3e22a40aebf5f00d55fftom#define VKI_USBDEVFS_BULK              _VKI_IOWR('U', 2, struct vki_usbdevfs_bulktransfer)
2319d7cf487123e934a38c6f3e22a40aebf5f00d55fftom#define VKI_USBDEVFS_GETDRIVER         _VKI_IOW('U', 8, struct vki_usbdevfs_getdriver)
2320d7cf487123e934a38c6f3e22a40aebf5f00d55fftom#define VKI_USBDEVFS_SUBMITURB         _VKI_IOR('U', 10, struct vki_usbdevfs_urb)
2321d7cf487123e934a38c6f3e22a40aebf5f00d55fftom#define VKI_USBDEVFS_REAPURB           _VKI_IOW('U', 12, void *)
2322d7cf487123e934a38c6f3e22a40aebf5f00d55fftom#define VKI_USBDEVFS_REAPURBNDELAY     _VKI_IOW('U', 13, void *)
2323d7cf487123e934a38c6f3e22a40aebf5f00d55fftom#define VKI_USBDEVFS_CONNECTINFO       _VKI_IOW('U', 17, struct vki_usbdevfs_connectinfo)
2324d7cf487123e934a38c6f3e22a40aebf5f00d55fftom#define VKI_USBDEVFS_IOCTL             _VKI_IOWR('U', 18, struct vki_usbdevfs_ioctl)
2325d7cf487123e934a38c6f3e22a40aebf5f00d55fftom
2326d5df125b895c5d5f31857c52dafa3cdea79ea05dtom//----------------------------------------------------------------------
2327d5df125b895c5d5f31857c52dafa3cdea79ea05dtom// From linux-2.6.20.1/include/linux/i2c.h
2328d5df125b895c5d5f31857c52dafa3cdea79ea05dtom//----------------------------------------------------------------------
2329d5df125b895c5d5f31857c52dafa3cdea79ea05dtom
2330d5df125b895c5d5f31857c52dafa3cdea79ea05dtom#define VKI_I2C_SLAVE		0x0703	/* Change slave address			*/
2331d5df125b895c5d5f31857c52dafa3cdea79ea05dtom					/* Attn.: Slave address is 7 or 10 bits */
2332d5df125b895c5d5f31857c52dafa3cdea79ea05dtom#define VKI_I2C_SLAVE_FORCE	0x0706	/* Change slave address			*/
2333d5df125b895c5d5f31857c52dafa3cdea79ea05dtom					/* Attn.: Slave address is 7 or 10 bits */
2334d5df125b895c5d5f31857c52dafa3cdea79ea05dtom					/* This changes the address, even if it */
2335d5df125b895c5d5f31857c52dafa3cdea79ea05dtom					/* is already taken!			*/
2336d5df125b895c5d5f31857c52dafa3cdea79ea05dtom#define VKI_I2C_TENBIT		0x0704	/* 0 for 7 bit addrs, != 0 for 10 bit	*/
2337d5df125b895c5d5f31857c52dafa3cdea79ea05dtom#define VKI_I2C_FUNCS		0x0705	/* Get the adapter functionality */
2338d5df125b895c5d5f31857c52dafa3cdea79ea05dtom#define VKI_I2C_PEC		0x0708	/* != 0 for SMBus PEC                   */
2339d5df125b895c5d5f31857c52dafa3cdea79ea05dtom
23407f4d7e42a880cd0872f93f5178a723beb56941a4tom//----------------------------------------------------------------------
23417f4d7e42a880cd0872f93f5178a723beb56941a4tom// From linux-2.6.20.1/include/linux/keyctl.h
23427f4d7e42a880cd0872f93f5178a723beb56941a4tom//----------------------------------------------------------------------
23437f4d7e42a880cd0872f93f5178a723beb56941a4tom
23447f4d7e42a880cd0872f93f5178a723beb56941a4tom/* keyctl commands */
23457f4d7e42a880cd0872f93f5178a723beb56941a4tom#define VKI_KEYCTL_GET_KEYRING_ID	0	/* ask for a keyring's ID */
23467f4d7e42a880cd0872f93f5178a723beb56941a4tom#define VKI_KEYCTL_JOIN_SESSION_KEYRING	1	/* join or start named session keyring */
23477f4d7e42a880cd0872f93f5178a723beb56941a4tom#define VKI_KEYCTL_UPDATE		2	/* update a key */
23487f4d7e42a880cd0872f93f5178a723beb56941a4tom#define VKI_KEYCTL_REVOKE		3	/* revoke a key */
23497f4d7e42a880cd0872f93f5178a723beb56941a4tom#define VKI_KEYCTL_CHOWN		4	/* set ownership of a key */
23507f4d7e42a880cd0872f93f5178a723beb56941a4tom#define VKI_KEYCTL_SETPERM		5	/* set perms on a key */
23517f4d7e42a880cd0872f93f5178a723beb56941a4tom#define VKI_KEYCTL_DESCRIBE		6	/* describe a key */
23527f4d7e42a880cd0872f93f5178a723beb56941a4tom#define VKI_KEYCTL_CLEAR		7	/* clear contents of a keyring */
23537f4d7e42a880cd0872f93f5178a723beb56941a4tom#define VKI_KEYCTL_LINK			8	/* link a key into a keyring */
23547f4d7e42a880cd0872f93f5178a723beb56941a4tom#define VKI_KEYCTL_UNLINK		9	/* unlink a key from a keyring */
23557f4d7e42a880cd0872f93f5178a723beb56941a4tom#define VKI_KEYCTL_SEARCH		10	/* search for a key in a keyring */
23567f4d7e42a880cd0872f93f5178a723beb56941a4tom#define VKI_KEYCTL_READ			11	/* read a key or keyring's contents */
23577f4d7e42a880cd0872f93f5178a723beb56941a4tom#define VKI_KEYCTL_INSTANTIATE		12	/* instantiate a partially constructed key */
23587f4d7e42a880cd0872f93f5178a723beb56941a4tom#define VKI_KEYCTL_NEGATE		13	/* negate a partially constructed key */
23597f4d7e42a880cd0872f93f5178a723beb56941a4tom#define VKI_KEYCTL_SET_REQKEY_KEYRING	14	/* set default request-key keyring */
23607f4d7e42a880cd0872f93f5178a723beb56941a4tom#define VKI_KEYCTL_SET_TIMEOUT		15	/* set key timeout */
23617f4d7e42a880cd0872f93f5178a723beb56941a4tom#define VKI_KEYCTL_ASSUME_AUTHORITY	16	/* assume request_key() authorisation */
23627f4d7e42a880cd0872f93f5178a723beb56941a4tom
23637f4d7e42a880cd0872f93f5178a723beb56941a4tom/*--------------------------------------------------------------------*/
23647f4d7e42a880cd0872f93f5178a723beb56941a4tom// From linux-2.6.20.1/include/linux/key.h
23657f4d7e42a880cd0872f93f5178a723beb56941a4tom/*--------------------------------------------------------------------*/
23667f4d7e42a880cd0872f93f5178a723beb56941a4tom
23677f4d7e42a880cd0872f93f5178a723beb56941a4tom/* key handle serial number */
23687f4d7e42a880cd0872f93f5178a723beb56941a4tomtypedef vki_int32_t vki_key_serial_t;
23697f4d7e42a880cd0872f93f5178a723beb56941a4tom
23707f4d7e42a880cd0872f93f5178a723beb56941a4tom/* key handle permissions mask */
23717f4d7e42a880cd0872f93f5178a723beb56941a4tomtypedef vki_uint32_t vki_key_perm_t;
23727f4d7e42a880cd0872f93f5178a723beb56941a4tom
23734cfea4f9480393ed6799db463b2e0fb8865a1a2fsewardj#endif // __VKI_LINUX_H
23744cfea4f9480393ed6799db463b2e0fb8865a1a2fsewardj
237573b526fb4af0f60634f0078583d92b931d5c0eebnethercote/*--------------------------------------------------------------------*/
237673b526fb4af0f60634f0078583d92b931d5c0eebnethercote/*--- end                                                          ---*/
237773b526fb4af0f60634f0078583d92b931d5c0eebnethercote/*--------------------------------------------------------------------*/
2378