1 /*- 2 * Copyright (c) 1982, 1990 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * William Jolitz. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions 10 * are met: 11 * 1. Redistributions of source code must retain the above copyright 12 * notice, this list of conditions and the following disclaimer. 13 * 2. Redistributions in binary form must reproduce the above copyright 14 * notice, this list of conditions and the following disclaimer in the 15 * documentation and/or other materials provided with the distribution. 16 * 3. All advertising materials mentioning features or use of this software 17 * must display the following acknowledgement: 18 * This product includes software developed by the University of 19 * California, Berkeley and its contributors. 20 * 4. Neither the name of the University nor the names of its contributors 21 * may be used to endorse or promote products derived from this software 22 * without specific prior written permission. 23 * 24 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 25 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * 36 * from: @(#)genassym.c 5.11 (Berkeley) 5/10/91 37 * $FreeBSD$ 38 */ 39 40 #include <stddef.h> 41 42 #include <sys/param.h> 43 #include <sys/systm.h> 44 #include <sys/assym.h> 45 #include <sys/proc.h> 46 #include <sys/buf.h> 47 #include <sys/errno.h> 48 #include <sys/proc.h> 49 #include <sys/mount.h> 50 #include <sys/socket.h> 51 #include <sys/resource.h> 52 #include <sys/resourcevar.h> 53 #include <machine/frame.h> 54 #include <machine/chipset.h> 55 #include <sys/vmmeter.h> 56 #include <vm/vm.h> 57 #include <vm/vm_param.h> 58 #include <vm/pmap.h> 59 #include <vm/vm_map.h> 60 #include <sys/user.h> 61 #include <net/if.h> 62 #include <netinet/in.h> 63 #include <nfs/nfsv2.h> 64 #include <nfs/rpcv2.h> 65 #include <nfs/nfs.h> 66 #include <nfs/nfsdiskless.h> 67 68 ASSYM(P_ADDR, offsetof(struct proc, p_addr)); 69 ASSYM(P_MD_FLAGS, offsetof(struct proc, p_md.md_flags)); 70 ASSYM(P_MD_PCBPADDR, offsetof(struct proc, p_md.md_pcbpaddr)); 71 ASSYM(P_MD_HAE, offsetof(struct proc, p_md.md_hae)); 72 ASSYM(MDP_HAEUSED, MDP_HAEUSED); 73 74 ASSYM(CHIPSET_WRITE_HAE, offsetof(struct alpha_chipset, write_hae)); 75 76 ASSYM(VM_MAXUSER_ADDRESS, VM_MAXUSER_ADDRESS); 77 ASSYM(PTLEV1I, PTLEV1I); 78 ASSYM(PTESIZE, PTESIZE); 79 80 ASSYM(U_PCB_ONFAULT, offsetof(struct user, u_pcb.pcb_onfault)); 81 ASSYM(U_PCB_HWPCB_KSP, offsetof(struct user, u_pcb.pcb_hw.apcb_ksp)); 82 ASSYM(U_PCB_CONTEXT, offsetof(struct user, u_pcb.pcb_context)); 83 84 ASSYM(PCB_HW, offsetof(struct pcb, pcb_hw)); 85 86 ASSYM(FPREG_FPR_REGS, offsetof(struct fpreg, fpr_regs)); 87 ASSYM(FPREG_FPR_CR, offsetof(struct fpreg, fpr_cr)); 88 89 ASSYM(EFAULT, EFAULT); 90 ASSYM(ENAMETOOLONG, ENAMETOOLONG); 91 92 /* Register offsets, for stack frames. */ 93 ASSYM(FRAME_V0, FRAME_V0); 94 ASSYM(FRAME_T0, FRAME_T0); 95 ASSYM(FRAME_T1, FRAME_T1); 96 ASSYM(FRAME_T2, FRAME_T2); 97 ASSYM(FRAME_T3, FRAME_T3); 98 ASSYM(FRAME_T4, FRAME_T4); 99 ASSYM(FRAME_T5, FRAME_T5); 100 ASSYM(FRAME_T6, FRAME_T6); 101 ASSYM(FRAME_T7, FRAME_T7); 102 ASSYM(FRAME_S0, FRAME_S0); 103 ASSYM(FRAME_S1, FRAME_S1); 104 ASSYM(FRAME_S2, FRAME_S2); 105 ASSYM(FRAME_S3, FRAME_S3); 106 ASSYM(FRAME_S4, FRAME_S4); 107 ASSYM(FRAME_S5, FRAME_S5); 108 ASSYM(FRAME_S6, FRAME_S6); 109 ASSYM(FRAME_A3, FRAME_A3); 110 ASSYM(FRAME_A4, FRAME_A4); 111 ASSYM(FRAME_A5, FRAME_A5); 112 ASSYM(FRAME_T8, FRAME_T8); 113 ASSYM(FRAME_T9, FRAME_T9); 114 ASSYM(FRAME_T10, FRAME_T10); 115 ASSYM(FRAME_T11, FRAME_T11); 116 ASSYM(FRAME_RA, FRAME_RA); 117 ASSYM(FRAME_T12, FRAME_T12); 118 ASSYM(FRAME_AT, FRAME_AT); 119 ASSYM(FRAME_SP, FRAME_SP); 120 121 ASSYM(FRAME_SW_SIZE, FRAME_SW_SIZE); 122 123 ASSYM(FRAME_PS, FRAME_PS); 124 ASSYM(FRAME_PC, FRAME_PC); 125 ASSYM(FRAME_GP, FRAME_GP); 126 ASSYM(FRAME_A0, FRAME_A0); 127 ASSYM(FRAME_A1, FRAME_A1); 128 ASSYM(FRAME_A2, FRAME_A2); 129 130 ASSYM(FRAME_SIZE, FRAME_SIZE); 131 132 /* bits of the PS register */ 133 ASSYM(ALPHA_PSL_USERMODE, ALPHA_PSL_USERMODE); 134 ASSYM(ALPHA_PSL_IPL_MASK, ALPHA_PSL_IPL_MASK); 135 ASSYM(ALPHA_PSL_IPL_0, ALPHA_PSL_IPL_0); 136 ASSYM(ALPHA_PSL_IPL_SOFT, ALPHA_PSL_IPL_SOFT); 137 ASSYM(ALPHA_PSL_IPL_HIGH, ALPHA_PSL_IPL_HIGH); 138 139 /* pte bits */ 140 ASSYM(ALPHA_L1SHIFT, ALPHA_L1SHIFT); 141 ASSYM(ALPHA_L2SHIFT, ALPHA_L2SHIFT); 142 ASSYM(ALPHA_L3SHIFT, ALPHA_L3SHIFT); 143 ASSYM(ALPHA_K1SEG_BASE, ALPHA_K1SEG_BASE); 144 ASSYM(ALPHA_PTE_VALID, ALPHA_PTE_VALID); 145 ASSYM(ALPHA_PTE_ASM, ALPHA_PTE_ASM); 146 ASSYM(ALPHA_PTE_KR, ALPHA_PTE_KR); 147 ASSYM(ALPHA_PTE_KW, ALPHA_PTE_KW); 148 149 /* Kernel entries */ 150 ASSYM(ALPHA_KENTRY_ARITH, ALPHA_KENTRY_ARITH); 151 ASSYM(ALPHA_KENTRY_MM, ALPHA_KENTRY_MM); 152 153 ASSYM(ALPHA_KENTRY_IF, ALPHA_KENTRY_IF); 154 ASSYM(ALPHA_KENTRY_UNA, ALPHA_KENTRY_UNA); 155 156 ASSYM(VPTBASE, VPTBASE); 157