13ebc1248SPeter Wemm /*- 2*7f2d13d6SPedro F. Giffuni * SPDX-License-Identifier: BSD-3-Clause 3*7f2d13d6SPedro F. Giffuni * 43ebc1248SPeter Wemm * Copyright (c) 1998-1999 Andrew Gallatin 53ebc1248SPeter Wemm * All rights reserved. 63ebc1248SPeter Wemm * 73ebc1248SPeter Wemm * Redistribution and use in source and binary forms, with or without 83ebc1248SPeter Wemm * modification, are permitted provided that the following conditions 93ebc1248SPeter Wemm * are met: 103ebc1248SPeter Wemm * 1. Redistributions of source code must retain the above copyright 113ebc1248SPeter Wemm * notice, this list of conditions and the following disclaimer 123ebc1248SPeter Wemm * in this position and unchanged. 133ebc1248SPeter Wemm * 2. Redistributions in binary form must reproduce the above copyright 143ebc1248SPeter Wemm * notice, this list of conditions and the following disclaimer in the 153ebc1248SPeter Wemm * documentation and/or other materials provided with the distribution. 163ebc1248SPeter Wemm * 3. The name of the author may not be used to endorse or promote products 173ebc1248SPeter Wemm * derived from this software withough specific prior written permission 183ebc1248SPeter Wemm * 193ebc1248SPeter Wemm * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 203ebc1248SPeter Wemm * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 213ebc1248SPeter Wemm * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 223ebc1248SPeter Wemm * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 233ebc1248SPeter Wemm * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 243ebc1248SPeter Wemm * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 253ebc1248SPeter Wemm * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 263ebc1248SPeter Wemm * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 273ebc1248SPeter Wemm * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 283ebc1248SPeter Wemm * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 293ebc1248SPeter Wemm */ 303ebc1248SPeter Wemm 31f253bb01SKonstantin Belousov #ifndef _COMPAT_IA32_IA32_UTIL_H 32f253bb01SKonstantin Belousov #define _COMPAT_IA32_IA32_UTIL_H 33f253bb01SKonstantin Belousov 343ebc1248SPeter Wemm #include <vm/vm.h> 353ebc1248SPeter Wemm #include <vm/vm_param.h> 363ebc1248SPeter Wemm #include <vm/pmap.h> 373ebc1248SPeter Wemm 383ebc1248SPeter Wemm #include <sys/exec.h> 393ebc1248SPeter Wemm #include <sys/sysent.h> 403ebc1248SPeter Wemm #include <sys/cdefs.h> 413ebc1248SPeter Wemm 426297a3d8SKonstantin Belousov #define FREEBSD32_MAXUSER ((1ul << 32) - IA32_PAGE_SIZE) 43481af8b9SKonstantin Belousov #define FREEBSD32_MINUSER 0 446297a3d8SKonstantin Belousov #define FREEBSD32_SHAREDPAGE (FREEBSD32_MAXUSER - IA32_PAGE_SIZE) 456297a3d8SKonstantin Belousov #define FREEBSD32_USRSTACK FREEBSD32_SHAREDPAGE 46c460ac3aSPeter Wemm 4764d85faaSPeter Wemm #define IA32_PAGE_SIZE 4096 48c460ac3aSPeter Wemm #define IA32_MAXDSIZ (512*1024*1024) /* 512MB */ 49c460ac3aSPeter Wemm #define IA32_MAXSSIZ (64*1024*1024) /* 64MB */ 50c460ac3aSPeter Wemm #define IA32_MAXVMEM 0 /* Unlimited */ 51afe1a688SKonstantin Belousov 52afe1a688SKonstantin Belousov struct syscall_args; 532d88da2fSKonstantin Belousov int ia32_fetch_syscall_args(struct thread *td); 54afe1a688SKonstantin Belousov void ia32_set_syscall_retval(struct thread *, int); 557332c129SKonstantin Belousov void ia32_fixlimit(struct rlimit *rl, int which); 56f253bb01SKonstantin Belousov 57481af8b9SKonstantin Belousov #endif /* _COMPAT_IA32_IA32_UTIL_H */ 58