vki-x86-linux.h revision 017e5833f60c5e41d1c0a61a8953fc7a23977efe
173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
273b526fb4af0f60634f0078583d92b931d5c0eebnethercote/*--------------------------------------------------------------------*/
373b526fb4af0f60634f0078583d92b931d5c0eebnethercote/*--- x86/Linux-specific kernel interface.    x86-linux/vki_arch.h ---*/
473b526fb4af0f60634f0078583d92b931d5c0eebnethercote/*--------------------------------------------------------------------*/
573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
673b526fb4af0f60634f0078583d92b931d5c0eebnethercote/*
773b526fb4af0f60634f0078583d92b931d5c0eebnethercote   This file is part of Valgrind, an extensible x86 protected-mode
873b526fb4af0f60634f0078583d92b931d5c0eebnethercote   emulator for monitoring program execution on x86-Unixes.
973b526fb4af0f60634f0078583d92b931d5c0eebnethercote
1073b526fb4af0f60634f0078583d92b931d5c0eebnethercote   Copyright (C) 2000-2004 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#ifndef __X86_LINUX_VKI_ARCH_H
3273b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define __X86_LINUX_VKI_ARCH_H
3373b526fb4af0f60634f0078583d92b931d5c0eebnethercote
3473b526fb4af0f60634f0078583d92b931d5c0eebnethercote// x86 is little-endian.
3573b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_LITTLE_ENDIAN  1
3673b526fb4af0f60634f0078583d92b931d5c0eebnethercote
3773b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
3873b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/asm-i386/types.h
3973b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
4073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
4173b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef unsigned char __vki_u8;
4273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
4373b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef __signed__ short __vki_s16;
4473b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef unsigned short __vki_u16;
4573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
4673b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef unsigned int __vki_u32;
4773b526fb4af0f60634f0078583d92b931d5c0eebnethercote
4873b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef __signed__ long long __vki_s64;
4973b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef unsigned long long __vki_u64;
5073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
5173b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef unsigned short vki_u16;
5273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
5373b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
5473b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/asm-i386/page.h
5573b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
5673b526fb4af0f60634f0078583d92b931d5c0eebnethercote
5773b526fb4af0f60634f0078583d92b931d5c0eebnethercote/* PAGE_SHIFT determines the page size */
5873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_PAGE_SHIFT	12
5973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_PAGE_SIZE	(1UL << VKI_PAGE_SHIFT)
6073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
6173b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
6273b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/asm-i386/signal.h
6373b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
6473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
6573b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_MINSIGSTKSZ	2048
6673b526fb4af0f60634f0078583d92b931d5c0eebnethercote
6773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIG_BLOCK          0	/* for blocking signals */
6873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIG_UNBLOCK        1	/* for unblocking signals */
6973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIG_SETMASK        2	/* for setting the signal mask */
7073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
7173b526fb4af0f60634f0078583d92b931d5c0eebnethercote/* Type of a signal handler.  */
7273b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef void __vki_signalfn_t(int);
7373b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef __vki_signalfn_t __user *__vki_sighandler_t;
7473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
7573b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef void __vki_restorefn_t(void);
7673b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef __vki_restorefn_t __user *__vki_sigrestore_t;
7773b526fb4af0f60634f0078583d92b931d5c0eebnethercote
7873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIG_DFL	((__vki_sighandler_t)0)	/* default signal handling */
7973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIG_IGN	((__vki_sighandler_t)1)	/* ignore signal */
8073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
8173b526fb4af0f60634f0078583d92b931d5c0eebnethercote//#ifdef __KERNEL__
8273b526fb4af0f60634f0078583d92b931d5c0eebnethercote/* Most things should be clean enough to redefine this at will, if care
8373b526fb4af0f60634f0078583d92b931d5c0eebnethercote   is taken to make libc match.  */
8473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
8573b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define _VKI_NSIG	64
8673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define _VKI_NSIG_BPW	32
8773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define _VKI_NSIG_WORDS	(_VKI_NSIG / _VKI_NSIG_BPW)
8873b526fb4af0f60634f0078583d92b931d5c0eebnethercote
8973b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef struct {
9073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long sig[_VKI_NSIG_WORDS];
9173b526fb4af0f60634f0078583d92b931d5c0eebnethercote} vki_sigset_t;
9273b526fb4af0f60634f0078583d92b931d5c0eebnethercote//#endif
9373b526fb4af0f60634f0078583d92b931d5c0eebnethercote
9473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIGHUP		 1
9573b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIGINT		 2
9673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIGQUIT		 3
9773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIGILL		 4
9873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIGTRAP		 5
9973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIGABRT		 6
10073b526fb4af0f60634f0078583d92b931d5c0eebnethercote//#define VKI_SIGIOT		 6
10173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIGBUS		 7
10273b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIGFPE		 8
10373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIGKILL		 9
10473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIGUSR1		10
10573b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIGSEGV		11
10673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIGUSR2		12
10773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIGPIPE		13
10873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIGALRM		14
10973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIGTERM		15
11073b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIGSTKFLT		16
11173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIGCHLD		17
11273b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIGCONT		18
11373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIGSTOP		19
11473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIGTSTP		20
11573b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIGTTIN		21
11673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIGTTOU		22
11773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIGURG		23
11873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIGXCPU		24
11973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIGXFSZ		25
12073b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIGVTALRM		26
12173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIGPROF		27
12273b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIGWINCH		28
12373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIGIO		29
12473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIGPWR		30
12573b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIGSYS		31
12673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define	VKI_SIGUNUSED		31
12773b526fb4af0f60634f0078583d92b931d5c0eebnethercote
12873b526fb4af0f60634f0078583d92b931d5c0eebnethercote/* These should not be considered constants from userland.  */
12973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIGRTMIN	32
13073b526fb4af0f60634f0078583d92b931d5c0eebnethercote// [[This was (_NSIG-1) in 2.4.X... not sure if it matters.]]
13173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIGRTMAX	_VKI_NSIG
13273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
13373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIGVGINT        (VKI_SIGRTMIN+0) // [[internal: interrupt]]
13473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIGVGKILL       (VKI_SIGRTMIN+1) // [[internal: kill]]
13573b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIGVGRTUSERMIN  (VKI_SIGRTMIN+2) // [[internal: first
13673b526fb4af0f60634f0078583d92b931d5c0eebnethercote                                             //   user-usable RT signal]]
13773b526fb4af0f60634f0078583d92b931d5c0eebnethercote
13873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SA_NOCLDSTOP	0x00000001u
13973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SA_NOCLDWAIT	0x00000002u
14073b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SA_SIGINFO		0x00000004u
14173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SA_ONSTACK		0x08000000u
14273b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SA_RESTART		0x10000000u
14373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SA_NODEFER		0x40000000u
14473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SA_RESETHAND	0x80000000u
14573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
14673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SA_NOMASK		VKI_SA_NODEFER
14773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SA_ONESHOT		VKI_SA_RESETHAND
14873b526fb4af0f60634f0078583d92b931d5c0eebnethercote//#define VKI_SA_INTERRUPT	0x20000000 /* dummy -- ignored */
14973b526fb4af0f60634f0078583d92b931d5c0eebnethercote
15073b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SA_RESTORER		0x04000000
15173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
15273b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SS_ONSTACK	1
15373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SS_DISABLE	2
15473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
15573b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_sigaction {
15673b526fb4af0f60634f0078583d92b931d5c0eebnethercote        // [[Nb: a 'k' prefix is added to "sa_handler" because
15773b526fb4af0f60634f0078583d92b931d5c0eebnethercote        // bits/sigaction.h (which gets dragged in somehow via signal.h)
15873b526fb4af0f60634f0078583d92b931d5c0eebnethercote        // #defines it as something else.  Since that is done for glibc's
15973b526fb4af0f60634f0078583d92b931d5c0eebnethercote        // purposes, which we don't care about here, we use our own name.]]
16073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_sighandler_t ksa_handler;
16173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long sa_flags;
16273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_sigrestore_t sa_restorer;
16373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	vki_sigset_t sa_mask;		/* mask last for extensibility */
16473b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
16573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
16673b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef struct vki_sigaltstack {
16773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	void __user *ss_sp;
16873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int ss_flags;
16973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	vki_size_t ss_size;
17073b526fb4af0f60634f0078583d92b931d5c0eebnethercote} vki_stack_t;
17173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
17273b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
17373b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/asm-i386/sigcontext.h
17473b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
17573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
17673b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct _vki_fpreg {
17773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short significand[4];
17873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short exponent;
17973b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
18073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
18173b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct _vki_fpxreg {
18273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short significand[4];
18373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short exponent;
18473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short padding[3];
18573b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
18673b526fb4af0f60634f0078583d92b931d5c0eebnethercote
18773b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct _vki_xmmreg {
18873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long element[4];
18973b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
19073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
19173b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct _vki_fpstate {
19273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	/* Regular FPU environment */
19373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long 	cw;
19473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	sw;
19573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	tag;
19673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	ipoff;
19773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	cssel;
19873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	dataoff;
19973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	datasel;
20073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	struct _vki_fpreg	_st[8];
20173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short	status;
20273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short	magic;		/* 0xffff = regular FPU data only */
20373b526fb4af0f60634f0078583d92b931d5c0eebnethercote
20473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	/* FXSR FPU environment */
20573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	_fxsr_env[6];	/* FXSR FPU env is ignored */
20673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	mxcsr;
20773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	reserved;
20873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	struct _vki_fpxreg	_fxsr_st[8];	/* FXSR FPU reg data is ignored */
20973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	struct _vki_xmmreg	_xmm[8];
21073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	padding[56];
21173b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
21273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
21373b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_sigcontext {
21473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short gs, __gsh;
21573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short fs, __fsh;
21673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short es, __esh;
21773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short ds, __dsh;
21873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long edi;
21973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long esi;
22073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long ebp;
22173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long esp;
22273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long ebx;
22373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long edx;
22473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long ecx;
22573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long eax;
22673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long trapno;
22773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long err;
22873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long eip;
22973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short cs, __csh;
23073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long eflags;
23173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long esp_at_signal;
23273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short ss, __ssh;
23373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	struct _vki_fpstate __user * fpstate;
23473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long oldmask;
23573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long cr2;
23673b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
23773b526fb4af0f60634f0078583d92b931d5c0eebnethercote
23873b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
23973b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/asm-i386/mman.h
24073b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
24173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
24273b526fb4af0f60634f0078583d92b931d5c0eebnethercote//#define VKI_PROT_NONE	0x0		/* No page permissions */
24373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_PROT_READ	0x1		/* page can be read */
24473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_PROT_WRITE	0x2		/* page can be written */
24573b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_PROT_EXEC	0x4		/* page can be executed */
24673b526fb4af0f60634f0078583d92b931d5c0eebnethercote
24773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_MAP_SHARED	0x01		/* Share changes */
24873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_MAP_PRIVATE	0x02		/* Changes are private */
24973b526fb4af0f60634f0078583d92b931d5c0eebnethercote//#define VKI_MAP_TYPE	0x0f		/* Mask for type of mapping */
25073b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_MAP_FIXED	0x10		/* Interpret addr exactly */
25173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_MAP_ANONYMOUS	0x20	/* don't use a file */
25273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
25373b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
25473b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/asm-i386/fcntl.h
25573b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
25673b526fb4af0f60634f0078583d92b931d5c0eebnethercote
25773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_O_RDONLY	     00
25873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_O_WRONLY	     01
25973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_O_CREAT	   0100	/* not fcntl */
26073b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_O_EXCL	   0200	/* not fcntl */
26173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_O_TRUNC	  01000	/* not fcntl */
26273b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_O_NONBLOCK	  04000
26373b526fb4af0f60634f0078583d92b931d5c0eebnethercote
26473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_F_DUPFD		0	/* dup */
26573b526fb4af0f60634f0078583d92b931d5c0eebnethercote//#define VKI_F_GETFD		1	/* get close_on_exec */
26673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_F_SETFD		2	/* set/clear close_on_exec */
26773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_F_GETFL		3	/* get file->f_flags */
26873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_F_SETFL		4	/* set file->f_flags */
26973b526fb4af0f60634f0078583d92b931d5c0eebnethercote//#define VKI_F_GETLK		5
27073b526fb4af0f60634f0078583d92b931d5c0eebnethercote//#define VKI_F_SETLK		6
27173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_F_SETLKW		7
27273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
27373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_F_SETLKW64		14
27473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
27573b526fb4af0f60634f0078583d92b931d5c0eebnethercote/* for F_[GET|SET]FL */
27673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_FD_CLOEXEC	1	/* actually anything with low bit set goes */
27773b526fb4af0f60634f0078583d92b931d5c0eebnethercote
27873b526fb4af0f60634f0078583d92b931d5c0eebnethercote
27973b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
28073b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/asm-i386/resource.h
28173b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
28273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
28373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_RLIMIT_DATA		2	/* max data size */
28473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_RLIMIT_STACK	3	/* max stack size */
28573b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_RLIMIT_CORE		4	/* max core file size */
28673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_RLIMIT_NOFILE	7	/* max number of open files */
28773b526fb4af0f60634f0078583d92b931d5c0eebnethercote
28873b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
28973b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/asm-i386/socket.h
29073b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
29173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
29273b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SOL_SOCKET	1
29373b526fb4af0f60634f0078583d92b931d5c0eebnethercote
29473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SO_TYPE	3
29573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
29673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SOCK_STREAM	1		/* stream (connection) socket	*/
29773b526fb4af0f60634f0078583d92b931d5c0eebnethercote
29873b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
29973b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/asm-i386/sockios.h
30073b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
30173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
30273b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIOCSPGRP	0x8902
30373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIOCGPGRP	0x8904
30473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_SIOCGSTAMP	0x8906		/* Get stamp */
30573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
30673b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
30773b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/asm-i386/stat.h
30873b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
30973b526fb4af0f60634f0078583d92b931d5c0eebnethercote
31073b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_stat {
31173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long  st_dev;
31273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long  st_ino;
31373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short st_mode;
31473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short st_nlink;
31573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short st_uid;
31673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short st_gid;
31773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long  st_rdev;
31873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long  st_size;
31973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long  st_blksize;
32073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long  st_blocks;
32173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long  st_atime;
32273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long  st_atime_nsec;
32373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long  st_mtime;
32473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long  st_mtime_nsec;
32573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long  st_ctime;
32673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long  st_ctime_nsec;
32773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long  __unused4;
32873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long  __unused5;
32973b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
33073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
33173b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_stat64 {
33273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long long	st_dev;
33373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned char	__pad0[4];
33473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
33573b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define STAT64_HAS_BROKEN_ST_INO	1
33673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	__st_ino;
33773b526fb4af0f60634f0078583d92b931d5c0eebnethercote
33873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned int	st_mode;
33973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned int	st_nlink;
34073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
34173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	st_uid;
34273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	st_gid;
34373b526fb4af0f60634f0078583d92b931d5c0eebnethercote
34473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long long	st_rdev;
34573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned char	__pad3[4];
34673b526fb4af0f60634f0078583d92b931d5c0eebnethercote
34773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long long	st_size;
34873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	st_blksize;
34973b526fb4af0f60634f0078583d92b931d5c0eebnethercote
35073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	st_blocks;	/* Number 512-byte blocks allocated. */
35173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	__pad4;		/* future possible st_blocks high bits */
35273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
35373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	st_atime;
35473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	st_atime_nsec;
35573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
35673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	st_mtime;
35773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned int	st_mtime_nsec;
35873b526fb4af0f60634f0078583d92b931d5c0eebnethercote
35973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	st_ctime;
36073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	st_ctime_nsec;
36173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
36273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long long	st_ino;
36373b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
36473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
36573b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
36673b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/asm-i386/statfs.h
36773b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
36873b526fb4af0f60634f0078583d92b931d5c0eebnethercote
36973b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_statfs {
37073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 f_type;
37173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 f_bsize;
37273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 f_blocks;
37373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 f_bfree;
37473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 f_bavail;
37573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 f_files;
37673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 f_ffree;
37773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_fsid_t f_fsid;
37873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 f_namelen;
37973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 f_frsize;
38073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_u32 f_spare[5];
38173b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
38273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
38373b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
38473b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/asm-i386/termios.h
38573b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
38673b526fb4af0f60634f0078583d92b931d5c0eebnethercote
38773b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_winsize {
38873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short ws_row;
38973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short ws_col;
39073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short ws_xpixel;
39173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short ws_ypixel;
39273b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
39373b526fb4af0f60634f0078583d92b931d5c0eebnethercote
39473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_NCC 8
39573b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_termio {
39673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short c_iflag;		/* input mode flags */
39773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short c_oflag;		/* output mode flags */
39873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short c_cflag;		/* control mode flags */
39973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short c_lflag;		/* local mode flags */
40073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned char c_line;		/* line discipline */
40173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned char c_cc[VKI_NCC];	/* control characters */
40273b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
40373b526fb4af0f60634f0078583d92b931d5c0eebnethercote
40473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
40573b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
40673b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/asm-i386/termbits.h
40773b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
40873b526fb4af0f60634f0078583d92b931d5c0eebnethercote
409017e5833f60c5e41d1c0a61a8953fc7a23977efenethercotetypedef unsigned char   vki_cc_t;
410017e5833f60c5e41d1c0a61a8953fc7a23977efenethercotetypedef unsigned int    vki_tcflag_t;
411017e5833f60c5e41d1c0a61a8953fc7a23977efenethercote
412017e5833f60c5e41d1c0a61a8953fc7a23977efenethercote#define VKI_NCCS 19
413017e5833f60c5e41d1c0a61a8953fc7a23977efenethercotestruct vki_termios {
414017e5833f60c5e41d1c0a61a8953fc7a23977efenethercote	vki_tcflag_t c_iflag;		/* input mode flags */
415017e5833f60c5e41d1c0a61a8953fc7a23977efenethercote	vki_tcflag_t c_oflag;		/* output mode flags */
416017e5833f60c5e41d1c0a61a8953fc7a23977efenethercote	vki_tcflag_t c_cflag;		/* control mode flags */
417017e5833f60c5e41d1c0a61a8953fc7a23977efenethercote	vki_tcflag_t c_lflag;		/* local mode flags */
418017e5833f60c5e41d1c0a61a8953fc7a23977efenethercote	vki_cc_t c_line;		/* line discipline */
419017e5833f60c5e41d1c0a61a8953fc7a23977efenethercote	vki_cc_t c_cc[VKI_NCCS];	/* control characters */
420017e5833f60c5e41d1c0a61a8953fc7a23977efenethercote};
42173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
42273b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
42373b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/asm-i386/ioctl.h
42473b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
42573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
42673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define _VKI_IOC_NRBITS	8
42773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define _VKI_IOC_TYPEBITS	8
42873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define _VKI_IOC_SIZEBITS	14
42973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define _VKI_IOC_DIRBITS	2
43073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
43173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define _VKI_IOC_SIZEMASK	((1 << _VKI_IOC_SIZEBITS)-1)
43273b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define _VKI_IOC_DIRMASK	((1 << _VKI_IOC_DIRBITS)-1)
43373b526fb4af0f60634f0078583d92b931d5c0eebnethercote
43473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define _VKI_IOC_NRSHIFT	0
43573b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define _VKI_IOC_TYPESHIFT	(_VKI_IOC_NRSHIFT+_VKI_IOC_NRBITS)
43673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define _VKI_IOC_SIZESHIFT	(_VKI_IOC_TYPESHIFT+_VKI_IOC_TYPEBITS)
43773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define _VKI_IOC_DIRSHIFT	(_VKI_IOC_SIZESHIFT+_VKI_IOC_SIZEBITS)
43873b526fb4af0f60634f0078583d92b931d5c0eebnethercote
43973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define _VKI_IOC_NONE	0U
44073b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define _VKI_IOC_WRITE	1U
44173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define _VKI_IOC_READ	2U
44273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
44373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define _VKI_IOC(dir,type,nr,size) \
44473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	(((dir)  << _VKI_IOC_DIRSHIFT) | \
44573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	 ((type) << _VKI_IOC_TYPESHIFT) | \
44673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	 ((nr)   << _VKI_IOC_NRSHIFT) | \
44773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	 ((size) << _VKI_IOC_SIZESHIFT))
44873b526fb4af0f60634f0078583d92b931d5c0eebnethercote
44973b526fb4af0f60634f0078583d92b931d5c0eebnethercote/* provoke compile error for invalid uses of size argument */
45073b526fb4af0f60634f0078583d92b931d5c0eebnethercoteextern unsigned int __vki_invalid_size_argument_for_IOC;
45173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define _VKI_IOC_TYPECHECK(t) \
45273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	((sizeof(t) == sizeof(t[1]) && \
45373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	  sizeof(t) < (1 << _VKI_IOC_SIZEBITS)) ? \
45473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	  sizeof(t) : __vki_invalid_size_argument_for_IOC)
45573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
45673b526fb4af0f60634f0078583d92b931d5c0eebnethercote/* used to create numbers */
45773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define _VKI_IO(type,nr)	_VKI_IOC(_VKI_IOC_NONE,(type),(nr),0)
45873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define _VKI_IOR(type,nr,size)	_VKI_IOC(_VKI_IOC_READ,(type),(nr),(_VKI_IOC_TYPECHECK(size)))
45973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define _VKI_IOW(type,nr,size)	_VKI_IOC(_VKI_IOC_WRITE,(type),(nr),(_VKI_IOC_TYPECHECK(size)))
46073b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define _VKI_IOWR(type,nr,size)	_VKI_IOC(_VKI_IOC_READ|_VKI_IOC_WRITE,(type),(nr),(_VKI_IOC_TYPECHECK(size)))
46173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
46273b526fb4af0f60634f0078583d92b931d5c0eebnethercote/* used to decode ioctl numbers.. */
46373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define _VKI_IOC_DIR(nr)	(((nr) >> _VKI_IOC_DIRSHIFT) & _VKI_IOC_DIRMASK)
46473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define _VKI_IOC_SIZE(nr)	(((nr) >> _VKI_IOC_SIZESHIFT) & _VKI_IOC_SIZEMASK)
46573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
46673b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
46773b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/asm-i386/ioctls.h
46873b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
46973b526fb4af0f60634f0078583d92b931d5c0eebnethercote
47073b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_TCGETS	0x5401
47173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_TCSETS	0x5402 /* Clashes with SNDCTL_TMR_START sound ioctl */
47273b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_TCSETSW	0x5403
47373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_TCSETSF	0x5404
47473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_TCGETA	0x5405
47573b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_TCSETA	0x5406
47673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_TCSETAW	0x5407
47773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_TCSETAF	0x5408
47873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_TCSBRK	0x5409
47973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_TCXONC	0x540A
48073b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_TCFLSH	0x540B
48173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_TIOCSCTTY	0x540E
48273b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_TIOCGPGRP	0x540F
48373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_TIOCSPGRP	0x5410
48473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_TIOCOUTQ	0x5411
48573b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_TIOCGWINSZ	0x5413
48673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_TIOCSWINSZ	0x5414
48773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_TIOCMBIS	0x5416
48873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_TIOCMBIC	0x5417
48973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_TIOCMSET	0x5418
49073b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_FIONREAD	0x541B
49173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_TIOCLINUX	0x541C
49273b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_FIONBIO	0x5421
49373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_TCSBRKP	0x5425	/* Needed for POSIX tcsendbreak() */
49473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_TIOCGPTN	_VKI_IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
49573b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_TIOCSPTLCK	_VKI_IOW('T',0x31, int)  /* Lock/unlock Pty */
49673b526fb4af0f60634f0078583d92b931d5c0eebnethercote
49773b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_FIOASYNC	0x5452
49873b526fb4af0f60634f0078583d92b931d5c0eebnethercote
49973b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
50073b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/asm-i386/poll.h
50173b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
50273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
50373b526fb4af0f60634f0078583d92b931d5c0eebnethercote/* These are specified by iBCS2 */
50473b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_POLLIN		0x0001
50573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
50673b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_pollfd {
50773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	int fd;
50873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	short events;
50973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	short revents;
51073b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
51173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
51273b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
51373b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/asm-i386/user.h
51473b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
51573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
51673b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_user_i387_struct {
51773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long	cwd;
51873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long	swd;
51973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long	twd;
52073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long	fip;
52173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long	fcs;
52273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long	foo;
52373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long	fos;
52473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long	st_space[20];	/* 8*10 bytes for each FP-reg = 80 bytes */
52573b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
52673b526fb4af0f60634f0078583d92b931d5c0eebnethercote
52773b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_user_fxsr_struct {
52873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short	cwd;
52973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short	swd;
53073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short	twd;
53173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short	fop;
53273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long	fip;
53373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long	fcs;
53473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long	foo;
53573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long	fos;
53673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long	mxcsr;
53773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long	reserved;
53873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long	st_space[32];	/* 8*16 bytes for each FP-reg = 128 bytes */
53973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long	xmm_space[32];	/* 8*16 bytes for each XMM-reg = 128 bytes */
54073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long	padding[56];
54173b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
54273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
54373b526fb4af0f60634f0078583d92b931d5c0eebnethercote/*
54473b526fb4af0f60634f0078583d92b931d5c0eebnethercote * This is the old layout of "struct pt_regs", and
54573b526fb4af0f60634f0078583d92b931d5c0eebnethercote * is still the layout used by user mode (the new
54673b526fb4af0f60634f0078583d92b931d5c0eebnethercote * pt_regs doesn't have all registers as the kernel
54773b526fb4af0f60634f0078583d92b931d5c0eebnethercote * doesn't use the extra segment registers)
54873b526fb4af0f60634f0078583d92b931d5c0eebnethercote */
54973b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_user_regs_struct {
55073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long ebx, ecx, edx, esi, edi, ebp, eax;
55173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short ds, __ds, es, __es;
55273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short fs, __fs, gs, __gs;
55373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long orig_eax, eip;
55473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short cs, __cs;
55573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long eflags, esp;
55673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short ss, __ss;
55773b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
55873b526fb4af0f60634f0078583d92b931d5c0eebnethercote
55973b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
56073b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/asm-i386/elf.h
56173b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
56273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
56373b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef unsigned long vki_elf_greg_t;
56473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
56573b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_ELF_NGREG (sizeof (struct vki_user_regs_struct) / sizeof(vki_elf_greg_t))
56673b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef vki_elf_greg_t vki_elf_gregset_t[VKI_ELF_NGREG];
56773b526fb4af0f60634f0078583d92b931d5c0eebnethercote
56873b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef struct vki_user_i387_struct vki_elf_fpregset_t;
56973b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef struct vki_user_fxsr_struct vki_elf_fpxregset_t;
57073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
57173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_AT_SYSINFO		32
57273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
57373b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
57473b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/asm-i386/ucontext.h
57573b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
57673b526fb4af0f60634f0078583d92b931d5c0eebnethercote
57773b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_ucontext {
57873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long		uc_flags;
57973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	struct vki_ucontext    *uc_link;
58073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	vki_stack_t		uc_stack;
58173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	struct vki_sigcontext	uc_mcontext;
58273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	vki_sigset_t		uc_sigmask;	/* mask last for extensibility */
58373b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
58473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
58573b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
58673b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/asm-i386/segment.h
58773b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
58873b526fb4af0f60634f0078583d92b931d5c0eebnethercote
58973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_GDT_ENTRY_TLS_ENTRIES	3
59073b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_GDT_ENTRY_TLS_MIN	6
59173b526fb4af0f60634f0078583d92b931d5c0eebnethercote#define VKI_GDT_ENTRY_TLS_MAX 	(VKI_GDT_ENTRY_TLS_MIN + VKI_GDT_ENTRY_TLS_ENTRIES - 1)
59273b526fb4af0f60634f0078583d92b931d5c0eebnethercote
59373b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
59473b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/asm-i386/ldt.h
59573b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
59673b526fb4af0f60634f0078583d92b931d5c0eebnethercote
59773b526fb4af0f60634f0078583d92b931d5c0eebnethercote/* [[Nb: This is the structure passed to the modify_ldt syscall.  Just so as
59873b526fb4af0f60634f0078583d92b931d5c0eebnethercote   to confuse and annoy everyone, this is _not_ the same as an
59973b526fb4af0f60634f0078583d92b931d5c0eebnethercote   VgLdtEntry and has to be translated into such.  The logic for doing
60073b526fb4af0f60634f0078583d92b931d5c0eebnethercote   so, in vg_ldt.c, is copied from the kernel sources.]] */
60173b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_user_desc {
60273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned int  entry_number;
60373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long base_addr;
60473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned int  limit;
60573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned int  seg_32bit:1;
60673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned int  contents:2;
60773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned int  read_exec_only:1;
60873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned int  limit_in_pages:1;
60973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned int  seg_not_present:1;
61073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned int  useable:1;
61173b526fb4af0f60634f0078583d92b931d5c0eebnethercote        // [[Nb: this field is not in the kernel sources, but it has always
61273b526fb4af0f60634f0078583d92b931d5c0eebnethercote        // been in the Valgrind sources so I will keep it there in case it's
61373b526fb4af0f60634f0078583d92b931d5c0eebnethercote        // important... this is an x86-defined data structure so who
61473b526fb4af0f60634f0078583d92b931d5c0eebnethercote        // knows;  maybe it's important to set this field to zero at some
61573b526fb4af0f60634f0078583d92b931d5c0eebnethercote        // point.  --njn]]
61673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned int  reserved:25;
61773b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
61873b526fb4af0f60634f0078583d92b931d5c0eebnethercote
61973b526fb4af0f60634f0078583d92b931d5c0eebnethercote// [[Nb: for our convenience within Valgrind, use a more specific name]]
62073b526fb4af0f60634f0078583d92b931d5c0eebnethercotetypedef struct vki_user_desc vki_modify_ldt_t;
62173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
62273b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
62373b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/asm-i386/ipcbuf.h
62473b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
62573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
62673b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_ipc64_perm
62773b526fb4af0f60634f0078583d92b931d5c0eebnethercote{
62873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_key_t	key;
62973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_uid32_t	uid;
63073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_gid32_t	gid;
63173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_uid32_t	cuid;
63273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_gid32_t	cgid;
63373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_mode_t	mode;
63473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short		__pad1;
63573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short		seq;
63673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned short		__pad2;
63773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long		__unused1;
63873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long		__unused2;
63973b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
64073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
64173b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
64273b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/asm-i386/sembuf.h
64373b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
64473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
64573b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_semid64_ds {
64673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	struct vki_ipc64_perm sem_perm;		/* permissions .. see ipc.h */
64773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_time_t	sem_otime;		/* last semop time */
64873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	__unused1;
64973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_time_t	sem_ctime;		/* last change time */
65073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	__unused2;
65173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	sem_nsems;		/* no. of semaphores in array */
65273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	__unused3;
65373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	__unused4;
65473b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
65573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
65673b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
65773b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/asm-i386/msgbuf.h
65873b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
65973b526fb4af0f60634f0078583d92b931d5c0eebnethercote
66073b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_msqid64_ds {
66173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	struct vki_ipc64_perm msg_perm;
66273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_time_t msg_stime;	/* last msgsnd time */
66373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	__unused1;
66473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_time_t msg_rtime;	/* last msgrcv time */
66573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	__unused2;
66673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_time_t msg_ctime;	/* last change time */
66773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	__unused3;
66873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long  msg_cbytes;	/* current number of bytes on queue */
66973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long  msg_qnum;	/* number of messages in queue */
67073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long  msg_qbytes;	/* max number of bytes on queue */
67173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_pid_t msg_lspid;	/* pid of last msgsnd */
67273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_pid_t msg_lrpid;	/* last receive pid */
67373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long  __unused4;
67473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long  __unused5;
67573b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
67673b526fb4af0f60634f0078583d92b931d5c0eebnethercote
67773b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
67873b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/asm-i386/ipc.h
67973b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
68073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
68173b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_ipc_kludge {
68273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	struct vki_msgbuf __user *msgp;
68373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	long msgtyp;
68473b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
68573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
68673b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
68773b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/asm-i386/shmbuf.h
68873b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
68973b526fb4af0f60634f0078583d92b931d5c0eebnethercote
69073b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_shmid64_ds {
69173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	struct vki_ipc64_perm	shm_perm;	/* operation perms */
69273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	vki_size_t		shm_segsz;	/* size of segment (bytes) */
69373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_time_t	shm_atime;	/* last attach time */
69473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long		__unused1;
69573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_time_t	shm_dtime;	/* last detach time */
69673b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long		__unused2;
69773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_time_t	shm_ctime;	/* last change time */
69873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long		__unused3;
69973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_pid_t	shm_cpid;	/* pid of creator */
70073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	__vki_kernel_pid_t	shm_lpid;	/* pid of last operator */
70173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long		shm_nattch;	/* no. of current attaches */
70273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long		__unused4;
70373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long		__unused5;
70473b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
70573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
70673b526fb4af0f60634f0078583d92b931d5c0eebnethercotestruct vki_shminfo64 {
70773b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	shmmax;
70873b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	shmmin;
70973b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	shmmni;
71073b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	shmseg;
71173b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	shmall;
71273b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	__unused1;
71373b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	__unused2;
71473b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	__unused3;
71573b526fb4af0f60634f0078583d92b931d5c0eebnethercote	unsigned long	__unused4;
71673b526fb4af0f60634f0078583d92b931d5c0eebnethercote};
71773b526fb4af0f60634f0078583d92b931d5c0eebnethercote
71873b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
71973b526fb4af0f60634f0078583d92b931d5c0eebnethercote// From linux-2.6.8.1/include/linux/module.h
72073b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
72173b526fb4af0f60634f0078583d92b931d5c0eebnethercote
72273b526fb4af0f60634f0078583d92b931d5c0eebnethercote// [[This VKI_SIZEOF_* value is arch-specific, because it depends on the
72373b526fb4af0f60634f0078583d92b931d5c0eebnethercote// word size.  The values are really guesses, but they are only needed for
72473b526fb4af0f60634f0078583d92b931d5c0eebnethercote// init_module() which is very rare]]
72573b526fb4af0f60634f0078583d92b931d5c0eebnethercote
72673b526fb4af0f60634f0078583d92b931d5c0eebnethercote#if defined(KERNEL_2_2) || defined(KERNEL_2_4)
72773b526fb4af0f60634f0078583d92b931d5c0eebnethercote// [[This is actually an over-estimate;  only 60 bytes are mandated.]]
72873b526fb4af0f60634f0078583d92b931d5c0eebnethercote#  define VKI_SIZEOF_STRUCT_MODULE  96
72973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#else
73073b526fb4af0f60634f0078583d92b931d5c0eebnethercote// [[This is a conservative guesstimate;  it can be longer, depending on
73173b526fb4af0f60634f0078583d92b931d5c0eebnethercote//   certain #ifdefs.  Close enough.]]
73273b526fb4af0f60634f0078583d92b931d5c0eebnethercote#  define VKI_SIZEOF_STRUCT_MODULE  160
73373b526fb4af0f60634f0078583d92b931d5c0eebnethercote#endif
73473b526fb4af0f60634f0078583d92b931d5c0eebnethercote
73573b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
73673b526fb4af0f60634f0078583d92b931d5c0eebnethercote// And that's it!
73773b526fb4af0f60634f0078583d92b931d5c0eebnethercote//----------------------------------------------------------------------
73873b526fb4af0f60634f0078583d92b931d5c0eebnethercote
73973b526fb4af0f60634f0078583d92b931d5c0eebnethercote#endif // __X86_LINUX_VKI_ARCH_H
74073b526fb4af0f60634f0078583d92b931d5c0eebnethercote
74173b526fb4af0f60634f0078583d92b931d5c0eebnethercote/*--------------------------------------------------------------------*/
74273b526fb4af0f60634f0078583d92b931d5c0eebnethercote/*--- end                                                          ---*/
74373b526fb4af0f60634f0078583d92b931d5c0eebnethercote/*--------------------------------------------------------------------*/
744