netbsd32_machdep.h revision 1.7 1 1.7 matt /* $NetBSD: netbsd32_machdep.h,v 1.7 2011/06/20 06:21:45 matt Exp $ */
2 1.1 matt
3 1.1 matt /*
4 1.1 matt * Copyright (c) 1998, 2001 Matthew R. Green
5 1.1 matt * All rights reserved.
6 1.1 matt *
7 1.1 matt * Redistribution and use in source and binary forms, with or without
8 1.1 matt * modification, are permitted provided that the following conditions
9 1.1 matt * are met:
10 1.1 matt * 1. Redistributions of source code must retain the above copyright
11 1.1 matt * notice, this list of conditions and the following disclaimer.
12 1.1 matt * 2. Redistributions in binary form must reproduce the above copyright
13 1.1 matt * notice, this list of conditions and the following disclaimer in the
14 1.1 matt * documentation and/or other materials provided with the distribution.
15 1.1 matt *
16 1.1 matt * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 1.1 matt * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 1.1 matt * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 1.1 matt * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 1.1 matt * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 1.1 matt * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 1.1 matt * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23 1.1 matt * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 1.1 matt * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 1.1 matt * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 1.1 matt * SUCH DAMAGE.
27 1.1 matt */
28 1.1 matt
29 1.1 matt #ifndef _MACHINE_NETBSD32_H_
30 1.1 matt #define _MACHINE_NETBSD32_H_
31 1.1 matt
32 1.1 matt #include <sys/types.h>
33 1.1 matt #include <sys/proc.h>
34 1.1 matt
35 1.1 matt typedef u_int32_t netbsd32_pointer_t;
36 1.1 matt
37 1.1 matt /*
38 1.1 matt * Convert a pointer in the 32-bit world to a valid 64-bit pointer.
39 1.1 matt */
40 1.1 matt #define NETBSD32PTR64(p32) ((void *)(u_long)(u_int)(p32))
41 1.1 matt
42 1.3 dsl /* ppc32 has 32bit aligned 64bit integers */
43 1.3 dsl #define NETBSD32_INT64_ALIGN __attribute__((__aligned__(4)))
44 1.3 dsl
45 1.1 matt #include <compat/netbsd32/netbsd32.h>
46 1.1 matt #include <powerpc/frame.h>
47 1.1 matt
48 1.7 matt /* from <sparc/include/signal.h> */
49 1.1 matt typedef u_int32_t netbsd32_sigcontextp_t;
50 1.1 matt
51 1.1 matt struct netbsd32_sigcontext {
52 1.1 matt int sc_onstack; /* sigstack state to restore */
53 1.1 matt int __sc_mask13; /* signal mask to restore (old style) */
54 1.1 matt /* begin machine dependent portion */
55 1.1 matt struct trapframe32 sc_frame; /* saved registers */
56 1.1 matt sigset_t sc_mask; /* signal mask to restore (new style) */
57 1.1 matt };
58 1.1 matt
59 1.1 matt struct netbsd32_sigcontext13 {
60 1.1 matt int sc_onstack; /* sigstack state to restore */
61 1.1 matt int sc_mask; /* signal mask to restore (old style) */
62 1.1 matt /* begin machine dependent portion */
63 1.1 matt struct trapframe32 sc_frame; /* saved registers */
64 1.1 matt };
65 1.1 matt
66 1.1 matt struct exec_package;
67 1.6 matt void netbsd32_setregs (struct lwp *, struct exec_package *, vaddr_t);
68 1.1 matt int netbsd32_sigreturn (struct lwp *, void *, register_t *);
69 1.1 matt void netbsd32_sendsig (int sig, sigset_t *, u_long);
70 1.1 matt
71 1.1 matt extern char netbsd32_esigcode[], netbsd32_sigcode[];
72 1.1 matt
73 1.1 matt /*
74 1.1 matt * Need to plug into get sparc specific ioctl's.
75 1.1 matt */
76 1.1 matt #define NETBSD32_MD_IOCTL /* enable netbsd32_md_ioctl() */
77 1.2 dsl int netbsd32_md_ioctl(struct file *, netbsd32_u_long, void *, struct proc *);
78 1.1 matt
79 1.1 matt #endif /* _MACHINE_NETBSD32_H_ */
80