svr4_machdep.h revision 92765
143412Snewton/* 243412Snewton * Copyright (c) 1998 Mark Newton 343412Snewton * Copyright (c) 1994 Christos Zoulas 443412Snewton * All rights reserved. 543412Snewton * 643412Snewton * Redistribution and use in source and binary forms, with or without 743412Snewton * modification, are permitted provided that the following conditions 843412Snewton * are met: 943412Snewton * 1. Redistributions of source code must retain the above copyright 1043412Snewton * notice, this list of conditions and the following disclaimer. 1143412Snewton * 2. Redistributions in binary form must reproduce the above copyright 1243412Snewton * notice, this list of conditions and the following disclaimer in the 1343412Snewton * documentation and/or other materials provided with the distribution. 1443412Snewton * 3. The name of the author may not be used to endorse or promote products 1543412Snewton * derived from this software without specific prior written permission 1643412Snewton * 1743412Snewton * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 1843412Snewton * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 1943412Snewton * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 2043412Snewton * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 2143412Snewton * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 2243412Snewton * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2343412Snewton * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2443412Snewton * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2543412Snewton * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 2643412Snewton * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2749270Snewton * 2850477Speter * $FreeBSD: head/sys/i386/svr4/svr4_machdep.h 92765 2002-03-20 07:51:46Z alfred $ 2943412Snewton */ 3043412Snewton 3143412Snewton#ifndef _I386_SVR4_MACHDEP_H_ 3243412Snewton#define _I386_SVR4_MACHDEP_H_ 3343412Snewton 3443412Snewton#if !defined(SVR4_MACHDEP_JUST_REGS) 3555484Snewton#include <sys/signal.h> 3665302Sobrien#include <compat/svr4/svr4_types.h> 3743412Snewton#endif 3843412Snewton 3943412Snewton/* 4043412Snewton * Machine dependent portions [X86] 4143412Snewton */ 4243412Snewton 4343412Snewton#define SVR4_X86_GS 0 4443412Snewton#define SVR4_X86_FS 1 4543412Snewton#define SVR4_X86_ES 2 4643412Snewton#define SVR4_X86_DS 3 4743412Snewton#define SVR4_X86_EDI 4 4843412Snewton#define SVR4_X86_ESI 5 4943412Snewton#define SVR4_X86_EBP 6 5043412Snewton#define SVR4_X86_ESP 7 5143412Snewton#define SVR4_X86_EBX 8 5243412Snewton#define SVR4_X86_EDX 9 5343412Snewton#define SVR4_X86_ECX 10 5443412Snewton#define SVR4_X86_EAX 11 5543412Snewton#define SVR4_X86_TRAPNO 12 5643412Snewton#define SVR4_X86_ERR 13 5743412Snewton#define SVR4_X86_EIP 14 5843412Snewton#define SVR4_X86_CS 15 5943412Snewton#define SVR4_X86_EFL 16 6043412Snewton#define SVR4_X86_UESP 17 6143412Snewton#define SVR4_X86_SS 18 6243412Snewton#define SVR4_X86_MAXREG 19 6343412Snewton 6443412Snewton 6543412Snewton#if !defined(SVR4_MACHDEP_JUST_REGS) 6643412Snewtontypedef int svr4_greg_t; 6743412Snewtontypedef svr4_greg_t svr4_gregset_t[SVR4_X86_MAXREG]; 6843412Snewton 6943412Snewtontypedef struct { 7043412Snewton int f_x87[62]; /* x87 registers */ 7143412Snewton long f_weitek[33]; /* weitek */ 7243412Snewton} svr4_fregset_t; 7343412Snewton 7483366Sjulianstruct thread; 7543412Snewtonstruct svr4_ucontext; 7643412Snewton 7792765Salfredvoid svr4_getcontext(struct thread *, struct svr4_ucontext *, sigset_t *, int); 7892765Salfredint svr4_setcontext(struct thread *p, struct svr4_ucontext *); 7943412Snewton 8043412Snewtontypedef struct { 8143412Snewton svr4_gregset_t greg; 8243412Snewton svr4_fregset_t freg; 8343412Snewton} svr4_mcontext_t; 8443412Snewton 8543412Snewton/* 8643412Snewton * SYSARCH numbers 8743412Snewton */ 8843412Snewton#define SVR4_SYSARCH_FPHW 40 8943412Snewton#define SVR4_SYSARCH_DSCR 75 9043412Snewton 9143412Snewtonstruct svr4_ssd { 9243412Snewton unsigned int selector; 9343412Snewton unsigned int base; 9443412Snewton unsigned int limit; 9543412Snewton unsigned int access1; 9643412Snewton unsigned int access2; 9743412Snewton}; 9843412Snewton 9943412Snewton/* 10043412Snewton * Processor traps 10143412Snewton */ 10243412Snewton#define SVR4_T_DIVIDE 0 10343412Snewton#define SVR4_T_TRCTRAP 1 10443412Snewton#define SVR4_T_NMI 2 10543412Snewton#define SVR4_T_BPTFLT 3 10643412Snewton#define SVR4_T_OFLOW 4 10743412Snewton#define SVR4_T_BOUND 5 10843412Snewton#define SVR4_T_PRIVINFLT 6 10943412Snewton#define SVR4_T_DNA 7 11043412Snewton#define SVR4_T_DOUBLEFLT 8 11143412Snewton#define SVR4_T_FPOPFLT 9 11243412Snewton#define SVR4_T_TSSFLT 10 11343412Snewton#define SVR4_T_SEGNPFLT 11 11443412Snewton#define SVR4_T_STKFLT 12 11543412Snewton#define SVR4_T_PROTFLT 13 11643412Snewton#define SVR4_T_PAGEFLT 14 11743412Snewton#define SVR4_T_ALIGNFLT 17 11843412Snewton 11943412Snewton#endif /* !SVR4_MACHDEP_JUST_REGS */ 12043412Snewton#endif /* !_I386_SVR4_MACHDEP_H_ */ 121