1100384Speter/*-
2100384Speter * Copyright (c) 1998-1999 Andrew Gallatin
3100384Speter * All rights reserved.
4100384Speter *
5100384Speter * Redistribution and use in source and binary forms, with or without
6100384Speter * modification, are permitted provided that the following conditions
7100384Speter * are met:
8100384Speter * 1. Redistributions of source code must retain the above copyright
9100384Speter *    notice, this list of conditions and the following disclaimer
10100384Speter *    in this position and unchanged.
11100384Speter * 2. Redistributions in binary form must reproduce the above copyright
12100384Speter *    notice, this list of conditions and the following disclaimer in the
13100384Speter *    documentation and/or other materials provided with the distribution.
14100384Speter * 3. The name of the author may not be used to endorse or promote products
15100384Speter *    derived from this software withough specific prior written permission
16100384Speter *
17100384Speter * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18100384Speter * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19100384Speter * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20100384Speter * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21100384Speter * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22100384Speter * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23100384Speter * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24100384Speter * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25100384Speter * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26100384Speter * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27100384Speter *
28100384Speter * $FreeBSD: stable/11/sys/compat/ia32/ia32_util.h 321343 2017-07-21 18:06:57Z kib $
29100384Speter */
30100384Speter
31215741Skib#ifndef	_COMPAT_IA32_IA32_UTIL_H
32215741Skib#define	_COMPAT_IA32_IA32_UTIL_H
33215741Skib
34100384Speter#include <vm/vm.h>
35100384Speter#include <vm/vm_param.h>
36100384Speter#include <vm/pmap.h>
37100384Speter
38100384Speter#include <sys/exec.h>
39100384Speter#include <sys/sysent.h>
40100384Speter#include <sys/cdefs.h>
41100384Speter
42217151Skib#define	FREEBSD32_MAXUSER	((1ul << 32) - IA32_PAGE_SIZE)
43238687Skib#define	FREEBSD32_MINUSER	0
44217151Skib#define	FREEBSD32_SHAREDPAGE	(FREEBSD32_MAXUSER - IA32_PAGE_SIZE)
45238687Skib#define	FREEBSD32_USRSTACK	FREEBSD32_SHAREDPAGE
46120422Speter
47123423Speter#define	IA32_PAGE_SIZE	4096
48120422Speter#define	IA32_MAXDSIZ	(512*1024*1024)		/* 512MB */
49120422Speter#define	IA32_MAXSSIZ	(64*1024*1024)		/* 64MB */
50238687Skib#define	IA32_MAXVMEM	0			/* Unlimited */
51208453Skib
52208453Skibstruct syscall_args;
53321343Skibint ia32_fetch_syscall_args(struct thread *td);
54208453Skibvoid ia32_set_syscall_retval(struct thread *, int);
55220238Skibvoid ia32_fixlimit(struct rlimit *rl, int which);
56215741Skib
57238687Skib#endif	/* _COMPAT_IA32_IA32_UTIL_H */
58