Home | History | Annotate | Line # | Download | only in sun3x
genassym.cf revision 1.3
      1 #	$NetBSD: genassym.cf,v 1.3 2003/01/18 07:03:36 thorpej Exp $
      2 
      3 #
      4 # Copyright (c) 1994, 1995 Gordon W. Ross
      5 # Copyright (c) 1993 Adam Glass
      6 # Copyright (c) 1982, 1990, 1993
      7 #	The Regents of the University of California.  All rights reserved.
      8 #
      9 # Redistribution and use in source and binary forms, with or without
     10 # modification, are permitted provided that the following conditions
     11 # are met:
     12 # 1. Redistributions of source code must retain the above copyright
     13 #    notice, this list of conditions and the following disclaimer.
     14 # 2. Redistributions in binary form must reproduce the above copyright
     15 #    notice, this list of conditions and the following disclaimer in the
     16 #    documentation and/or other materials provided with the distribution.
     17 # 3. All advertising materials mentioning features or use of this software
     18 #    must display the following acknowledgement:
     19 #	This product includes software developed by the University of
     20 #	California, Berkeley and its contributors.
     21 # 4. Neither the name of the University nor the names of its contributors
     22 #    may be used to endorse or promote products derived from this software
     23 #    without specific prior written permission.
     24 #
     25 # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     26 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     27 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     28 # ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     29 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     30 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     31 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     32 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     33 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     34 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     35 # SUCH DAMAGE.
     36 #
     37 #	from: @(#)genassym.c	8.3 (Berkeley) 1/4/94
     38 #
     39 
     40 if defined(_KERNEL_OPT)
     41 include "opt_compat_svr4.h"
     42 endif
     43 
     44 include <sys/param.h>
     45 include <sys/cdefs.h>
     46 include <sys/errno.h>
     47 include <sys/proc.h>
     48 include <sys/syscall.h>
     49 
     50 include <uvm/uvm_extern.h>
     51 
     52 ifdef COMPAT_SVR4
     53 include <compat/svr4/svr4_syscall.h>
     54 include <compat/svr4/svr4_ucontext.h>
     55 endif
     56 
     57 include <machine/cpu.h>
     58 include <machine/dvma.h>
     59 include <machine/mon.h>
     60 include <machine/pcb.h>
     61 include <machine/pmap.h>
     62 include <machine/psl.h>
     63 include <machine/pte.h>
     64 include <machine/vmparam.h>
     65 
     66 include <sun3/sun3/buserr.h>
     67 include <sun3/sun3/cache.h>
     68 include <sun3/sun3/fc.h>
     69 
     70 include <sun3/sun3x/enable.h>
     71 
     72 include <m68k/saframe.h>
     73 
     74 # XXX: for copy.s
     75 define	M68030			1
     76 
     77 # bus error stuff XXX
     78 # define	BUSERR_REG			BUSERR_REG
     79 # define	BUSERR_MMU			BUSERR_MMU
     80 
     81 # 68k isms
     82 define	PSL_LOWIPL			PSL_LOWIPL
     83 define	PSL_HIGHIPL			PSL_HIGHIPL
     84 define	PSL_USER			PSL_USER
     85 define	PSL_S				PSL_S
     86 define	PSL_TS				PSL_T | PSL_S
     87 define	FC_CONTROL			FC_CONTROL
     88 define	FC_SUPERD			FC_SUPERD
     89 define	FC_USERD			FC_USERD
     90 define	IC_CLEAR			IC_CLEAR
     91 define	DC_CLEAR			DC_CLEAR
     92 define	CACHE_CLR			CACHE_CLR
     93 
     94 # sun3 memory map
     95 define	USRSTACK			USRSTACK
     96 define	SUN3X_MONSTART			SUN3X_MONSTART
     97 define	SUN3X_PROM_BASE			SUN3X_PROM_BASE
     98 define	SUN3X_MONEND			SUN3X_MONEND
     99 
    100 # kernel-isms
    101 define	KERNBASE			KERNBASE
    102 define	USPACE				USPACE
    103 define	NBPG				NBPG
    104 
    105 # system calls
    106 define	SYS_exit			SYS_exit
    107 define	SYS___sigreturn14		SYS___sigreturn14
    108 define	SYS_compat_13_sigreturn13	SYS_compat_13_sigreturn13
    109 
    110 # errno-isms
    111 define	EFAULT				EFAULT
    112 define	ENAMETOOLONG			ENAMETOOLONG
    113 
    114 # trap types: locore.s includes trap.h
    115 
    116 #
    117 # unix structure-isms
    118 #
    119 
    120 # lwp & proc fields and values
    121 define	L_ADDR			offsetof(struct lwp, l_addr)
    122 define	L_BACK			offsetof(struct lwp, l_back)
    123 define	L_FORW			offsetof(struct lwp, l_forw)
    124 define	L_PRIORITY		offsetof(struct lwp, l_priority)
    125 define	L_STAT			offsetof(struct lwp, l_stat)
    126 define	L_WCHAN			offsetof(struct lwp, l_wchan)
    127 define	L_PROC			offsetof(struct lwp, l_proc)
    128 define	L_MD_REGS		offsetof(struct lwp, l_md.md_regs)
    129 define	L_MD_FLAGS		offsetof(struct lwp, l_md.md_flags)
    130 define	P_FLAG			offsetof(struct proc, p_flag)
    131 define	P_VMSPACE		offsetof(struct proc, p_vmspace)
    132 
    133 # lwp fields and values
    134 
    135 define	LSSLEEP			LSSLEEP
    136 define	LSRUN			LSRUN
    137 define	LSONPROC		LSONPROC
    138 
    139 # XXX: HP-UX trace bit?
    140 
    141 # VM/pmap structure fields
    142 define	VM_PMAP			offsetof(struct vmspace, vm_map.pmap)
    143 define	PM_A_PHYS		offsetof(struct pmap, pm_a_phys)
    144 define	PM_A_TMGR		offsetof(struct pmap, pm_a_tmgr)
    145 
    146 # pcb offsets
    147 define	PCB_FLAGS		offsetof(struct pcb, pcb_flags)
    148 define	PCB_PS			offsetof(struct pcb, pcb_ps)
    149 define	PCB_USP			offsetof(struct pcb, pcb_usp)
    150 define	PCB_REGS		offsetof(struct pcb, pcb_regs[0])
    151 define	PCB_ONFAULT		offsetof(struct pcb, pcb_onfault)
    152 define	PCB_FPCTX		offsetof(struct pcb, pcb_fpregs)
    153 define	SIZEOF_PCB		sizeof(struct pcb)
    154 
    155 # exception frame offset/sizes
    156 define	FR_SP			offsetof(struct trapframe, tf_regs[15])
    157 define	FR_ADJ			offsetof(struct trapframe, tf_stackadj)
    158 define	FR_HW			offsetof(struct trapframe, tf_sr)
    159 define	FR_SIZE			sizeof(struct trapframe)
    160 
    161 # FP frame offsets
    162 define	FPF_REGS		offsetof(struct fpframe, fpf_regs[0])
    163 define	FPF_FPCR		offsetof(struct fpframe, fpf_fpcr)
    164 
    165 # SVR4 binary compatibility
    166 ifdef COMPAT_SVR4
    167 define	SVR4_SIGF_HANDLER	offsetof(struct svr4_sigframe, sf_handler)
    168 define	SVR4_SIGF_UC		offsetof(struct svr4_sigframe, sf_uc)
    169 define	SVR4_SYS_context	SVR4_SYS_context
    170 define	SVR4_SYS_exit		SVR4_SYS_exit
    171 define	SVR4_SETCONTEXT		SVR4_SETCONTEXT
    172 endif
    173