netbsd32_machdep.h revision 1.10
11.10Sscw/* $NetBSD: netbsd32_machdep.h,v 1.10 2002/10/23 13:16:38 scw Exp $ */ 21.1Smrg 31.1Smrg/* 41.7Smrg * Copyright (c) 1998, 2001 Matthew R. Green 51.1Smrg * All rights reserved. 61.1Smrg * 71.1Smrg * Redistribution and use in source and binary forms, with or without 81.1Smrg * modification, are permitted provided that the following conditions 91.1Smrg * are met: 101.1Smrg * 1. Redistributions of source code must retain the above copyright 111.1Smrg * notice, this list of conditions and the following disclaimer. 121.1Smrg * 2. Redistributions in binary form must reproduce the above copyright 131.1Smrg * notice, this list of conditions and the following disclaimer in the 141.1Smrg * documentation and/or other materials provided with the distribution. 151.1Smrg * 3. The name of the author may not be used to endorse or promote products 161.1Smrg * derived from this software without specific prior written permission. 171.1Smrg * 181.1Smrg * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 191.1Smrg * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 201.1Smrg * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 211.1Smrg * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 221.1Smrg * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 231.1Smrg * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 241.1Smrg * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 251.1Smrg * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 261.1Smrg * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 271.1Smrg * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 281.1Smrg * SUCH DAMAGE. 291.1Smrg */ 301.1Smrg 311.1Smrg#ifndef _MACHINE_NETBSD32_H_ 321.1Smrg#define _MACHINE_NETBSD32_H_ 331.8Smrg 341.8Smrg#include <sys/types.h> 351.8Smrg#include <sys/proc.h> 361.10Sscw 371.10Sscwtypedef u_int32_t netbsd32_pointer_t; 381.10Sscw 391.10Sscw/* 401.10Sscw * Convert a pointer in the 32-bit world to a valid 64-bit pointer. 411.10Sscw */ 421.10Sscw#define NETBSD32PTR64(p32) ((void *)(u_long)(u_int)(p32)) 431.10Sscw 441.8Smrg#include <compat/netbsd32/netbsd32.h> 451.1Smrg 461.1Smrg/* from <arch/sparc/include/signal.h> */ 471.1Smrgtypedef u_int32_t netbsd32_sigcontextp_t; 481.1Smrg 491.2Smrgstruct netbsd32_sigcontext { 501.5Seeh int sc_onstack; /* sigstack state to restore */ 511.5Seeh int __sc_mask13; /* signal mask to restore (old style) */ 521.5Seeh /* begin machine dependent portion */ 531.5Seeh int sc_sp; /* %sp to restore */ 541.5Seeh int sc_pc; /* pc to restore */ 551.5Seeh int sc_npc; /* npc to restore */ 561.6Skleink int sc_psr; /* pstate to restore */ 571.5Seeh int sc_g1; /* %g1 to restore */ 581.5Seeh int sc_o0; /* %o0 to restore */ 591.5Seeh sigset_t sc_mask; /* signal mask to restore (new style) */ 601.5Seeh}; 611.5Seeh 621.5Seehstruct netbsd32_sigcontext13 { 631.1Smrg int sc_onstack; /* sigstack state to restore */ 641.5Seeh int sc_mask; /* signal mask to restore (old style) */ 651.1Smrg /* begin machine dependent portion */ 661.1Smrg int sc_sp; /* %sp to restore */ 671.1Smrg int sc_pc; /* pc to restore */ 681.1Smrg int sc_npc; /* npc to restore */ 691.5Seeh int sc_psr; /* pstate to restore */ 701.1Smrg int sc_g1; /* %g1 to restore */ 711.1Smrg int sc_o0; /* %o0 to restore */ 721.1Smrg}; 731.3Seeh 741.5Seehstruct exec_package; 751.7Smrgvoid netbsd32_setregs (struct proc *p, struct exec_package *pack, u_long stack); 761.7Smrgint netbsd32_sigreturn (struct proc *p, void *v, register_t *retval); 771.9Sthorpejvoid netbsd32_sendsig (int sig, sigset_t *mask, u_long code); 781.3Seeh 791.3Seehextern char netbsd32_esigcode[], netbsd32_sigcode[]; 801.3Seeh 811.7Smrg/* 821.7Smrg * Need to plug into get sparc specific ioctl's. 831.7Smrg */ 841.7Smrg#define NETBSD32_MD_IOCTL /* enable netbsd32_md_ioctl() */ 851.7Smrgint netbsd32_md_ioctl (struct file *, netbsd32_u_long, caddr_t, struct proc *); 861.1Smrg 871.1Smrg#endif /* _MACHINE_NETBSD32_H_ */ 88