The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/i386/i386/genassym.c

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    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  * 4. Neither the name of the University nor the names of its contributors
   17  *    may be used to endorse or promote products derived from this software
   18  *    without specific prior written permission.
   19  *
   20  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   21  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   22  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   23  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   24  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   25  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   26  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   27  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   28  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   29  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   30  * SUCH DAMAGE.
   31  *
   32  *      from: @(#)genassym.c    5.11 (Berkeley) 5/10/91
   33  */
   34 
   35 #include <sys/cdefs.h>
   36 __FBSDID("$FreeBSD: releng/9.0/sys/i386/i386/genassym.c 224187 2011-07-18 15:19:40Z attilio $");
   37 
   38 #include "opt_apic.h"
   39 #include "opt_compat.h"
   40 #include "opt_hwpmc_hooks.h"
   41 #include "opt_kstack_pages.h"
   42 
   43 #include <sys/param.h>
   44 #include <sys/systm.h>
   45 #include <sys/assym.h>
   46 #include <sys/bio.h>
   47 #include <sys/buf.h>
   48 #ifdef  HWPMC_HOOKS
   49 #include <sys/pmckern.h>
   50 #endif
   51 #include <sys/proc.h>
   52 #include <sys/errno.h>
   53 #include <sys/mount.h>
   54 #include <sys/mutex.h>
   55 #include <sys/socket.h>
   56 #include <sys/resourcevar.h>
   57 #include <sys/signalvar.h>
   58 #include <sys/ucontext.h>
   59 #include <machine/bootinfo.h>
   60 #include <machine/tss.h>
   61 #include <sys/vmmeter.h>
   62 #include <vm/vm.h>
   63 #include <vm/vm_param.h>
   64 #include <vm/pmap.h>
   65 #include <vm/vm_map.h>
   66 #include <sys/proc.h>
   67 #include <net/if.h>
   68 #include <netinet/in.h>
   69 #include <nfs/nfsproto.h>
   70 #include <nfsclient/nfs.h>
   71 #include <nfs/nfsdiskless.h>
   72 #ifdef DEV_APIC
   73 #include <x86/apicreg.h>
   74 #endif
   75 #include <machine/cpu.h>
   76 #include <machine/pcb.h>
   77 #include <machine/sigframe.h>
   78 #include <machine/vm86.h>
   79 #include <machine/proc.h>
   80 
   81 ASSYM(P_VMSPACE, offsetof(struct proc, p_vmspace));
   82 ASSYM(VM_PMAP, offsetof(struct vmspace, vm_pmap));
   83 ASSYM(PM_ACTIVE, offsetof(struct pmap, pm_active));
   84 
   85 ASSYM(TD_FLAGS, offsetof(struct thread, td_flags));
   86 ASSYM(TD_LOCK, offsetof(struct thread, td_lock));
   87 ASSYM(TD_PCB, offsetof(struct thread, td_pcb));
   88 ASSYM(TD_PFLAGS, offsetof(struct thread, td_pflags));
   89 ASSYM(TD_PROC, offsetof(struct thread, td_proc));
   90 ASSYM(TD_MD, offsetof(struct thread, td_md));
   91 ASSYM(TD_TID, offsetof(struct thread, td_tid));
   92 
   93 ASSYM(TDP_CALLCHAIN, TDP_CALLCHAIN);
   94 
   95 ASSYM(P_MD, offsetof(struct proc, p_md));
   96 ASSYM(MD_LDT, offsetof(struct mdproc, md_ldt));
   97 
   98 ASSYM(TDF_ASTPENDING, TDF_ASTPENDING);
   99 ASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED);
  100 
  101 ASSYM(V_TRAP, offsetof(struct vmmeter, v_trap));
  102 ASSYM(V_SYSCALL, offsetof(struct vmmeter, v_syscall));
  103 ASSYM(V_INTR, offsetof(struct vmmeter, v_intr));
  104 /* ASSYM(UPAGES, UPAGES);*/
  105 ASSYM(KSTACK_PAGES, KSTACK_PAGES);
  106 ASSYM(PAGE_SIZE, PAGE_SIZE);
  107 ASSYM(NPTEPG, NPTEPG);
  108 ASSYM(NPDEPG, NPDEPG);
  109 ASSYM(NPDEPTD, NPDEPTD);
  110 ASSYM(NPGPTD, NPGPTD);
  111 ASSYM(PDESIZE, sizeof(pd_entry_t));
  112 ASSYM(PTESIZE, sizeof(pt_entry_t));
  113 ASSYM(PDESHIFT, PDESHIFT);
  114 ASSYM(PTESHIFT, PTESHIFT);
  115 ASSYM(PAGE_SHIFT, PAGE_SHIFT);
  116 ASSYM(PAGE_MASK, PAGE_MASK);
  117 ASSYM(PDRSHIFT, PDRSHIFT);
  118 ASSYM(PDRMASK, PDRMASK);
  119 ASSYM(USRSTACK, USRSTACK);
  120 ASSYM(VM_MAXUSER_ADDRESS, VM_MAXUSER_ADDRESS);
  121 ASSYM(KERNBASE, KERNBASE);
  122 ASSYM(KERNLOAD, KERNLOAD);
  123 ASSYM(MCLBYTES, MCLBYTES);
  124 ASSYM(PCB_CR3, offsetof(struct pcb, pcb_cr3));
  125 ASSYM(PCB_EDI, offsetof(struct pcb, pcb_edi));
  126 ASSYM(PCB_ESI, offsetof(struct pcb, pcb_esi));
  127 ASSYM(PCB_EBP, offsetof(struct pcb, pcb_ebp));
  128 ASSYM(PCB_ESP, offsetof(struct pcb, pcb_esp));
  129 ASSYM(PCB_EBX, offsetof(struct pcb, pcb_ebx));
  130 ASSYM(PCB_EIP, offsetof(struct pcb, pcb_eip));
  131 ASSYM(TSS_ESP0, offsetof(struct i386tss, tss_esp0));
  132 
  133 ASSYM(PCB_GS, offsetof(struct pcb, pcb_gs));
  134 ASSYM(PCB_DR0, offsetof(struct pcb, pcb_dr0));
  135 ASSYM(PCB_DR1, offsetof(struct pcb, pcb_dr1));
  136 ASSYM(PCB_DR2, offsetof(struct pcb, pcb_dr2));
  137 ASSYM(PCB_DR3, offsetof(struct pcb, pcb_dr3));
  138 ASSYM(PCB_DR6, offsetof(struct pcb, pcb_dr6));
  139 ASSYM(PCB_DR7, offsetof(struct pcb, pcb_dr7));
  140 ASSYM(PCB_USERFPU, offsetof(struct pcb, pcb_user_save));
  141 ASSYM(PCB_PSL, offsetof(struct pcb, pcb_psl));
  142 ASSYM(PCB_DBREGS, PCB_DBREGS);
  143 ASSYM(PCB_EXT, offsetof(struct pcb, pcb_ext));
  144 
  145 ASSYM(PCB_FSD, offsetof(struct pcb, pcb_fsd));
  146 ASSYM(PCB_VM86, offsetof(struct pcb, pcb_vm86));
  147 ASSYM(PCB_FLAGS, offsetof(struct pcb, pcb_flags));
  148 ASSYM(PCB_SAVEFPU, offsetof(struct pcb, pcb_save));
  149 ASSYM(PCB_SAVEFPU_SIZE, sizeof(union savefpu));
  150 ASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault));
  151 
  152 ASSYM(PCB_SIZE, sizeof(struct pcb));
  153 ASSYM(PCB_VM86CALL, PCB_VM86CALL);
  154 
  155 ASSYM(TF_TRAPNO, offsetof(struct trapframe, tf_trapno));
  156 ASSYM(TF_ERR, offsetof(struct trapframe, tf_err));
  157 ASSYM(TF_EIP, offsetof(struct trapframe, tf_eip));
  158 ASSYM(TF_CS, offsetof(struct trapframe, tf_cs));
  159 ASSYM(TF_EFLAGS, offsetof(struct trapframe, tf_eflags));
  160 ASSYM(SIGF_HANDLER, offsetof(struct sigframe, sf_ahu.sf_handler));
  161 #ifdef COMPAT_43
  162 ASSYM(SIGF_SC, offsetof(struct osigframe, sf_siginfo.si_sc));
  163 #endif
  164 ASSYM(SIGF_UC, offsetof(struct sigframe, sf_uc));
  165 #ifdef COMPAT_FREEBSD4
  166 ASSYM(SIGF_UC4, offsetof(struct sigframe4, sf_uc));
  167 #endif
  168 #ifdef COMPAT_43
  169 ASSYM(SC_PS, offsetof(struct osigcontext, sc_ps));
  170 ASSYM(SC_FS, offsetof(struct osigcontext, sc_fs));
  171 ASSYM(SC_GS, offsetof(struct osigcontext, sc_gs));
  172 ASSYM(SC_TRAPNO, offsetof(struct osigcontext, sc_trapno));
  173 #endif
  174 #ifdef COMPAT_FREEBSD4
  175 ASSYM(UC4_EFLAGS, offsetof(struct ucontext4, uc_mcontext.mc_eflags));
  176 ASSYM(UC4_GS, offsetof(struct ucontext4, uc_mcontext.mc_gs));
  177 #endif
  178 ASSYM(UC_EFLAGS, offsetof(ucontext_t, uc_mcontext.mc_eflags));
  179 ASSYM(UC_GS, offsetof(ucontext_t, uc_mcontext.mc_gs));
  180 ASSYM(ENOENT, ENOENT);
  181 ASSYM(EFAULT, EFAULT);
  182 ASSYM(ENAMETOOLONG, ENAMETOOLONG);
  183 ASSYM(MAXCOMLEN, MAXCOMLEN);
  184 ASSYM(MAXPATHLEN, MAXPATHLEN);
  185 ASSYM(BOOTINFO_SIZE, sizeof(struct bootinfo));
  186 ASSYM(BI_VERSION, offsetof(struct bootinfo, bi_version));
  187 ASSYM(BI_KERNELNAME, offsetof(struct bootinfo, bi_kernelname));
  188 ASSYM(BI_NFS_DISKLESS, offsetof(struct bootinfo, bi_nfs_diskless));
  189 ASSYM(BI_ENDCOMMON, offsetof(struct bootinfo, bi_endcommon));
  190 ASSYM(NFSDISKLESS_SIZE, sizeof(struct nfs_diskless));
  191 ASSYM(BI_SIZE, offsetof(struct bootinfo, bi_size));
  192 ASSYM(BI_SYMTAB, offsetof(struct bootinfo, bi_symtab));
  193 ASSYM(BI_ESYMTAB, offsetof(struct bootinfo, bi_esymtab));
  194 ASSYM(BI_KERNEND, offsetof(struct bootinfo, bi_kernend));
  195 ASSYM(PC_SIZEOF, sizeof(struct pcpu));
  196 ASSYM(PC_PRVSPACE, offsetof(struct pcpu, pc_prvspace));
  197 ASSYM(PC_CURTHREAD, offsetof(struct pcpu, pc_curthread));
  198 ASSYM(PC_FPCURTHREAD, offsetof(struct pcpu, pc_fpcurthread));
  199 ASSYM(PC_IDLETHREAD, offsetof(struct pcpu, pc_idlethread));
  200 ASSYM(PC_CURPCB, offsetof(struct pcpu, pc_curpcb));
  201 ASSYM(PC_COMMON_TSS, offsetof(struct pcpu, pc_common_tss));
  202 ASSYM(PC_COMMON_TSSD, offsetof(struct pcpu, pc_common_tssd));
  203 ASSYM(PC_TSS_GDT, offsetof(struct pcpu, pc_tss_gdt));
  204 ASSYM(PC_FSGS_GDT, offsetof(struct pcpu, pc_fsgs_gdt));
  205 ASSYM(PC_CURRENTLDT, offsetof(struct pcpu, pc_currentldt));
  206 ASSYM(PC_CPUID, offsetof(struct pcpu, pc_cpuid));
  207 ASSYM(PC_CURPMAP, offsetof(struct pcpu, pc_curpmap));
  208 ASSYM(PC_PRIVATE_TSS, offsetof(struct pcpu, pc_private_tss));
  209 
  210 #ifdef DEV_APIC
  211 ASSYM(LA_VER, offsetof(struct LAPIC, version));
  212 ASSYM(LA_TPR, offsetof(struct LAPIC, tpr));
  213 ASSYM(LA_EOI, offsetof(struct LAPIC, eoi));
  214 ASSYM(LA_SVR, offsetof(struct LAPIC, svr));
  215 ASSYM(LA_ICR_LO, offsetof(struct LAPIC, icr_lo));
  216 ASSYM(LA_ICR_HI, offsetof(struct LAPIC, icr_hi));
  217 ASSYM(LA_ISR, offsetof(struct LAPIC, isr0));
  218 #endif
  219 
  220 ASSYM(KCSEL, GSEL(GCODE_SEL, SEL_KPL));
  221 ASSYM(KDSEL, GSEL(GDATA_SEL, SEL_KPL));
  222 ASSYM(KPSEL, GSEL(GPRIV_SEL, SEL_KPL));
  223 
  224 ASSYM(BC32SEL, GSEL(GBIOSCODE32_SEL, SEL_KPL));
  225 ASSYM(GPROC0_SEL, GPROC0_SEL);
  226 ASSYM(VM86_FRAMESIZE, sizeof(struct vm86frame));
  227 
  228 #ifdef PC98
  229 #include <machine/bus.h>
  230 
  231 ASSYM(BUS_SPACE_HANDLE_BASE, offsetof(struct bus_space_handle, bsh_base));
  232 ASSYM(BUS_SPACE_HANDLE_IAT, offsetof(struct bus_space_handle, bsh_iat));
  233 #endif
  234 
  235 #ifdef XEN
  236 #include <xen/hypervisor.h>
  237 ASSYM(PC_CR3, offsetof(struct pcpu, pc_cr3));
  238 ASSYM(HYPERVISOR_VIRT_START, __HYPERVISOR_VIRT_START);
  239 #endif
  240 
  241 #ifdef  HWPMC_HOOKS
  242 ASSYM(PMC_FN_USER_CALLCHAIN, PMC_FN_USER_CALLCHAIN);
  243 #endif

Cache object: cb37650ac5202be6c11cf5ff6b7c70c8


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.