sunos32.h revision 1.1.2.2 1 1.1.2.2 bouyer /* $NetBSD: sunos32.h,v 1.1.2.2 2001/02/11 19:14:30 bouyer Exp $ */
2 1.1.2.2 bouyer
3 1.1.2.2 bouyer /*
4 1.1.2.2 bouyer * Copyright (c) 2001 Matthew R. Green
5 1.1.2.2 bouyer * All rights reserved.
6 1.1.2.2 bouyer *
7 1.1.2.2 bouyer * Redistribution and use in source and binary forms, with or without
8 1.1.2.2 bouyer * modification, are permitted provided that the following conditions
9 1.1.2.2 bouyer * are met:
10 1.1.2.2 bouyer * 1. Redistributions of source code must retain the above copyright
11 1.1.2.2 bouyer * notice, this list of conditions and the following disclaimer.
12 1.1.2.2 bouyer * 2. Redistributions in binary form must reproduce the above copyright
13 1.1.2.2 bouyer * notice, this list of conditions and the following disclaimer in the
14 1.1.2.2 bouyer * documentation and/or other materials provided with the distribution.
15 1.1.2.2 bouyer * 3. The name of the author may not be used to endorse or promote products
16 1.1.2.2 bouyer * derived from this software without specific prior written permission.
17 1.1.2.2 bouyer *
18 1.1.2.2 bouyer * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19 1.1.2.2 bouyer * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 1.1.2.2 bouyer * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 1.1.2.2 bouyer * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 1.1.2.2 bouyer * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 1.1.2.2 bouyer * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 1.1.2.2 bouyer * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
25 1.1.2.2 bouyer * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 1.1.2.2 bouyer * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 1.1.2.2 bouyer * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 1.1.2.2 bouyer * SUCH DAMAGE.
29 1.1.2.2 bouyer */
30 1.1.2.2 bouyer
31 1.1.2.2 bouyer #ifndef _COMPAT_SUNOS32_SUNOS32_H_
32 1.1.2.2 bouyer #define _COMPAT_SUNOS32_SUNOS32_H_
33 1.1.2.2 bouyer
34 1.1.2.2 bouyer /*
35 1.1.2.2 bouyer * 32-bit SunOS 4.x compatibility module.
36 1.1.2.2 bouyer */
37 1.1.2.2 bouyer
38 1.1.2.2 bouyer #include <compat/sunos/sunos.h>
39 1.1.2.2 bouyer
40 1.1.2.2 bouyer /*
41 1.1.2.2 bouyer * Typedefs for pointer-types.
42 1.1.2.2 bouyer */
43 1.1.2.2 bouyer /* stime() */
44 1.1.2.2 bouyer typedef u_int32_t sunos32_time_tp;
45 1.1.2.2 bouyer
46 1.1.2.2 bouyer /* statfs(), fstatfs() */
47 1.1.2.2 bouyer typedef u_int32_t sunos32_statfsp_t;
48 1.1.2.2 bouyer
49 1.1.2.2 bouyer /* ustat() */
50 1.1.2.2 bouyer typedef u_int32_t sunos32_ustatp_t;
51 1.1.2.2 bouyer
52 1.1.2.2 bouyer /* uname() */
53 1.1.2.2 bouyer typedef u_int32_t sunos32_utsnamep_t;
54 1.1.2.2 bouyer
55 1.1.2.2 bouyer /*
56 1.1.2.2 bouyer * general prototypes
57 1.1.2.2 bouyer */
58 1.1.2.2 bouyer __BEGIN_DECLS
59 1.1.2.2 bouyer /* Defined in arch/<arch>/sunos_machdep.c */
60 1.1.2.2 bouyer void sunos32_sendsig __P((sig_t, int, sigset_t *, u_long));
61 1.1.2.2 bouyer __END_DECLS
62 1.1.2.2 bouyer
63 1.1.2.2 bouyer /*
64 1.1.2.2 bouyer * here are some macros to convert between sunos32 and sparc64 types.
65 1.1.2.2 bouyer * note that they do *NOT* act like good macros and put ()'s around all
66 1.1.2.2 bouyer * arguments cuz this _breaks_ SCARG().
67 1.1.2.2 bouyer */
68 1.1.2.2 bouyer #define SUNOS32TO64(s32uap, uap, name) \
69 1.1.2.2 bouyer SCARG(uap, name) = SCARG(s32uap, name)
70 1.1.2.2 bouyer #define SUNOS32TOP(s32uap, uap, name, type) \
71 1.1.2.2 bouyer SCARG(uap, name) = (type *)(u_long)(u_int)SCARG(s32uap, name)
72 1.1.2.2 bouyer #define SUNOS32TOX(s32uap, uap, name, type) \
73 1.1.2.2 bouyer SCARG(uap, name) = (type)SCARG(s32uap, name)
74 1.1.2.2 bouyer #define SUNOS32TOX64(s32uap, uap, name, type) \
75 1.1.2.2 bouyer SCARG(uap, name) = (type)(u_long)SCARG(s32uap, name)
76 1.1.2.2 bouyer
77 1.1.2.2 bouyer /* and some standard versions */
78 1.1.2.2 bouyer #define SUNOS32TO64_UAP(name) SUNOS32TO64(uap, &ua, name);
79 1.1.2.2 bouyer #define SUNOS32TOP_UAP(name, type) SUNOS32TOP(uap, &ua, name, type);
80 1.1.2.2 bouyer #define SUNOS32TOX_UAP(name, type) SUNOS32TOX(uap, &ua, name, type);
81 1.1.2.2 bouyer #define SUNOS32TOX64_UAP(name, type) SUNOS32TOX64(uap, &ua, name, type);
82 1.1.2.2 bouyer
83 1.1.2.2 bouyer #define SUNOS32_CHECK_ALT_EXIST(p, sgp, path) \
84 1.1.2.2 bouyer emul_find(p, sgp, p->p_emul->e_path, (char *)(u_long)path, (const char **)&(path), CHECK_ALT_FL_EXISTS)
85 1.1.2.2 bouyer
86 1.1.2.2 bouyer #define SUNOS32_CHECK_ALT_CREAT(p, sgp, path) \
87 1.1.2.2 bouyer emul_find(p, sgp, p->p_emul->e_path, (char *)(u_long)path, (const char **)&(path), CHECK_ALT_FL_CREAT)
88 1.1.2.2 bouyer
89 1.1.2.2 bouyer #endif /* _COMPAT_SUNOS32_SUNOS32_H_ */
90