netbsd32_machdep.h revision 1.29
11.29Sskrll/* $NetBSD: netbsd32_machdep.h,v 1.29 2016/10/19 09:44:00 skrll 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 * 161.1Smrg * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 171.1Smrg * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 181.1Smrg * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 191.1Smrg * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 201.1Smrg * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 211.1Smrg * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 221.1Smrg * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 231.1Smrg * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 241.1Smrg * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 251.1Smrg * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 261.1Smrg * SUCH DAMAGE. 271.1Smrg */ 281.1Smrg 291.1Smrg#ifndef _MACHINE_NETBSD32_H_ 301.1Smrg#define _MACHINE_NETBSD32_H_ 311.8Smrg 321.8Smrg#include <sys/types.h> 331.18Schs 341.18Schsstruct proc; 351.10Sscw 361.22Sdsl/* sparc64 uses an unsigned 32bit integer for 32bit pointers */ 371.22Sdsl#define NETBSD32_POINTER_TYPE uint32_t 381.22Sdsltypedef struct { NETBSD32_POINTER_TYPE i32; } netbsd32_pointer_t; 391.10Sscw 401.24Sdsl/* sparc32 has 64bit aligned 64bit integers */ 411.24Sdsl#define NETBSD32_INT64_ALIGN 421.23Sdsl 431.1Smrg/* from <arch/sparc/include/signal.h> */ 441.20Scditypedef uint32_t netbsd32_sigcontextp_t; 451.1Smrg 461.2Smrgstruct netbsd32_sigcontext { 471.5Seeh int sc_onstack; /* sigstack state to restore */ 481.5Seeh int __sc_mask13; /* signal mask to restore (old style) */ 491.5Seeh /* begin machine dependent portion */ 501.5Seeh int sc_sp; /* %sp to restore */ 511.5Seeh int sc_pc; /* pc to restore */ 521.5Seeh int sc_npc; /* npc to restore */ 531.6Skleink int sc_psr; /* pstate to restore */ 541.5Seeh int sc_g1; /* %g1 to restore */ 551.5Seeh int sc_o0; /* %o0 to restore */ 561.5Seeh sigset_t sc_mask; /* signal mask to restore (new style) */ 571.5Seeh}; 581.5Seeh 591.5Seehstruct netbsd32_sigcontext13 { 601.1Smrg int sc_onstack; /* sigstack state to restore */ 611.5Seeh int sc_mask; /* signal mask to restore (old style) */ 621.1Smrg /* begin machine dependent portion */ 631.1Smrg int sc_sp; /* %sp to restore */ 641.1Smrg int sc_pc; /* pc to restore */ 651.1Smrg int sc_npc; /* npc to restore */ 661.5Seeh int sc_psr; /* pstate to restore */ 671.1Smrg int sc_g1; /* %g1 to restore */ 681.1Smrg int sc_o0; /* %o0 to restore */ 691.1Smrg}; 701.3Seeh 711.7Smrg/* 721.7Smrg * Need to plug into get sparc specific ioctl's. 731.7Smrg */ 741.7Smrg#define NETBSD32_MD_IOCTL /* enable netbsd32_md_ioctl() */ 751.19Schristosint netbsd32_md_ioctl(struct file *, netbsd32_u_long, void *, struct lwp *); 761.1Smrg 771.16Sdrochner#define NETBSD32_MID_MACHINE MID_SPARC 781.16Sdrochner 791.21Scubeint netbsd32_process_read_regs(struct lwp *, struct reg32 *); 801.28Sdslint netbsd32_process_read_fpregs(struct lwp *, struct fpreg32 *, size_t *); 811.21Scube 821.29Sskrllint netbsd32_process_write_regs(struct lwp *, const struct reg32 *); 831.29Sskrllint netbsd32_process_write_fpregs(struct lwp *, const struct fpreg32 *, size_t); 841.29Sskrll 851.1Smrg#endif /* _MACHINE_NETBSD32_H_ */ 86