1 /**	$MirOS: src/sys/compat/common/compat_util.h,v 1.2 2005/03/06 21:27:28 tg Exp $ */
2 /*	$OpenBSD: compat_util.h,v 1.7 2002/03/14 01:26:49 millert Exp $	*/
3 /*	$NetBSD: compat_util.h,v 1.1 1995/06/24 20:16:05 christos Exp $	*/
4 
5 /*
6  * Copyright (c) 1994 Christos Zoulas
7  * Copyright (c) 1995 Frank van der Linden
8  * All rights reserved.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  * 1. Redistributions of source code must retain the above copyright
14  *    notice, this list of conditions and the following disclaimer.
15  * 2. Redistributions in binary form must reproduce the above copyright
16  *    notice, this list of conditions and the following disclaimer in the
17  *    documentation and/or other materials provided with the distribution.
18  * 3. The name of the author may not be used to endorse or promote products
19  *    derived from this software without specific prior written permission
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  *
32  */
33 
34 #ifndef	_COMPAT_UTIL_H_
35 #define	_COMPAT_UTIL_H_
36 
37 #include <uvm/uvm_extern.h>
38 #include <sys/exec.h>
39 
40 struct emul;
41 /* struct proc; */
42 
43 caddr_t stackgap_init(struct emul *);
44 void    *stackgap_alloc(caddr_t *, size_t);
45 
46 struct emul_flags_xtab {
47         unsigned long omask;
48         unsigned long oval;
49         unsigned long nval;
50 };
51 
52 int emul_find(struct proc *, caddr_t *, const char *, char *,
53 		   char **, int);
54 
55 #define CHECK_ALT_EXIST(p, sgp, root, path) \
56     emul_find(p, sgp, root, path, &(path), 0)
57 
58 #define CHECK_ALT_CREAT(p, sgp, root, path) \
59     emul_find(p, sgp, root, path, &(path), 1)
60 
61 #endif /* !_COMPAT_UTIL_H_ */
62