1 /*- 2 * Copyright (c) 1982, 1990 The Regents of the University of California. 3 * Copyright (c) 2008 The DragonFly Project. 4 * All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * William Jolitz. 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 5.11 (Berkeley) 5/10/91 38 * $FreeBSD: src/sys/i386/i386/genassym.c,v 1.86.2.3 2002/03/03 05:42:49 nyan Exp $ 39 * $DragonFly: src/sys/platform/pc64/amd64/genassym.c,v 1.2 2008/08/29 17:07:10 dillon Exp $ 40 */ 41 42 #include <sys/param.h> 43 #include <sys/systm.h> 44 #include <sys/assym.h> 45 #include <sys/interrupt.h> 46 #include <sys/buf.h> 47 #include <sys/proc.h> 48 #include <sys/errno.h> 49 #include <sys/mount.h> 50 #include <sys/socket.h> 51 #include <sys/lock.h> 52 #include <sys/resourcevar.h> 53 #include <machine/frame.h> 54 /*#include <machine/bootinfo.h>*/ 55 #include <machine/tss.h> 56 #include <sys/vmmeter.h> 57 #include <sys/machintr.h> 58 #include <vm/vm.h> 59 #include <vm/vm_param.h> 60 #include <vm/pmap.h> 61 #include <vm/vm_map.h> 62 #include <net/if.h> 63 #include <netinet/in.h> 64 #include <vfs/nfs/nfsv2.h> 65 #include <vfs/nfs/rpcv2.h> 66 #include <vfs/nfs/nfs.h> 67 #include <vfs/nfs/nfsdiskless.h> 68 69 #include <machine/segments.h> 70 #include <machine/sigframe.h> 71 #include <machine/globaldata.h> 72 #include <machine/specialreg.h> 73 #include <machine/pcb.h> 74 #include <machine/smp.h> 75 76 ASSYM(VM_PMAP, offsetof(struct vmspace, vm_pmap)); 77 ASSYM(PM_ACTIVE, offsetof(struct pmap, pm_active)); 78 79 ASSYM(LWP_VMSPACE, offsetof(struct lwp, lwp_vmspace)); 80 ASSYM(GD_CURTHREAD, offsetof(struct mdglobaldata, mi.gd_curthread)); 81 ASSYM(GD_CPUID, offsetof(struct mdglobaldata, mi.gd_cpuid)); 82 ASSYM(PCB_R15, offsetof(struct pcb, pcb_r15)); 83 ASSYM(PCB_R14, offsetof(struct pcb, pcb_r14)); 84 ASSYM(PCB_R13, offsetof(struct pcb, pcb_r13)); 85 ASSYM(PCB_R12, offsetof(struct pcb, pcb_r12)); 86 ASSYM(PCB_RBP, offsetof(struct pcb, pcb_rbp)); 87 ASSYM(PCB_RSP, offsetof(struct pcb, pcb_rsp)); 88 ASSYM(PCB_RBX, offsetof(struct pcb, pcb_rbx)); 89 ASSYM(PCB_RIP, offsetof(struct pcb, pcb_rip)); 90 ASSYM(TSS_RSP0, offsetof(struct x86_64tss, tss_rsp0)); 91 92 ASSYM(PCB_DR0, offsetof(struct pcb, pcb_dr0)); 93 ASSYM(PCB_DR1, offsetof(struct pcb, pcb_dr1)); 94 ASSYM(PCB_DR2, offsetof(struct pcb, pcb_dr2)); 95 ASSYM(PCB_DR3, offsetof(struct pcb, pcb_dr3)); 96 ASSYM(PCB_DR6, offsetof(struct pcb, pcb_dr6)); 97 ASSYM(PCB_DR7, offsetof(struct pcb, pcb_dr7)); 98 ASSYM(PCB_DBREGS, PCB_DBREGS); 99 ASSYM(PCB_FLAGS, offsetof(struct pcb, pcb_flags)); 100 ASSYM(PCB_FSBASE, offsetof(struct pcb, pcb_fsbase)); 101 ASSYM(PCB_GSBASE, offsetof(struct pcb, pcb_gsbase)); 102 ASSYM(PCB_SAVEFPU, offsetof(struct pcb, pcb_save)); 103 104 ASSYM(PCB_SAVEFPU_SIZE, sizeof(union savefpu)); 105 ASSYM(SIGF_HANDLER, offsetof(struct sigframe, sf_ahu.sf_handler)); 106 ASSYM(SIGF_UC, offsetof(struct sigframe, sf_uc)); 107 108 ASSYM(TD_LWP, offsetof(struct thread, td_lwp)); 109 ASSYM(TD_PCB, offsetof(struct thread, td_pcb)); 110 ASSYM(TD_SP, offsetof(struct thread, td_sp)); 111 ASSYM(TD_PRI, offsetof(struct thread, td_pri)); 112 ASSYM(TD_CRITCOUNT, offsetof(struct thread, td_critcount)); 113 ASSYM(TD_FLAGS, offsetof(struct thread, td_flags)); 114 ASSYM(TD_SAVEFPU, offsetof(struct thread, td_savefpu)); 115 ASSYM(TDF_RUNNING, TDF_RUNNING); 116 ASSYM(GD_NPXTHREAD, offsetof(struct mdglobaldata, gd_npxthread)); 117