[BACK]Return to genassym.cf CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / arch / i386 / i386

Annotation of src/sys/arch/i386/i386/genassym.cf, Revision 1.37

1.37    ! fvdl        1: #      $NetBSD: genassym.cf,v 1.36 2003/04/02 07:35:58 thorpej Exp $
1.9       mycroft     2:
                      3: #
                      4: # Copyright (c) 1998 The NetBSD Foundation, Inc.
                      5: # All rights reserved.
                      6: #
                      7: # This code is derived from software contributed to The NetBSD Foundation
                      8: # by Charles M. Hannum.
                      9: #
                     10: # Redistribution and use in source and binary forms, with or without
                     11: # modification, are permitted provided that the following conditions
                     12: # are met:
                     13: # 1. Redistributions of source code must retain the above copyright
                     14: #    notice, this list of conditions and the following disclaimer.
                     15: # 2. Redistributions in binary form must reproduce the above copyright
                     16: #    notice, this list of conditions and the following disclaimer in the
                     17: #    documentation and/or other materials provided with the distribution.
                     18: # 3. All advertising materials mentioning features or use of this software
                     19: #    must display the following acknowledgement:
                     20: #        This product includes software developed by the NetBSD
                     21: #        Foundation, Inc. and its contributors.
                     22: # 4. Neither the name of The NetBSD Foundation nor the names of its
                     23: #    contributors may be used to endorse or promote products derived
                     24: #    from this software without specific prior written permission.
                     25: #
                     26: # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
                     27: # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
                     28: # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
                     29: # PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
                     30: # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
                     31: # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
                     32: # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
                     33: # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
                     34: # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
                     35: # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
                     36: # POSSIBILITY OF SUCH DAMAGE.
                     37: #
1.1       mycroft    38:
                     39: #
                     40: # Copyright (c) 1982, 1990 The Regents of the University of California.
                     41: # All rights reserved.
                     42: #
                     43: # This code is derived from software contributed to Berkeley by
                     44: # William Jolitz.
                     45: #
                     46: # Redistribution and use in source and binary forms, with or without
                     47: # modification, are permitted provided that the following conditions
                     48: # are met:
                     49: # 1. Redistributions of source code must retain the above copyright
                     50: #    notice, this list of conditions and the following disclaimer.
                     51: # 2. Redistributions in binary form must reproduce the above copyright
                     52: #    notice, this list of conditions and the following disclaimer in the
                     53: #    documentation and/or other materials provided with the distribution.
                     54: # 3. All advertising materials mentioning features or use of this software
                     55: #    must display the following acknowledgement:
                     56: #      This product includes software developed by the University of
                     57: #      California, Berkeley and its contributors.
                     58: # 4. Neither the name of the University nor the names of its contributors
                     59: #    may be used to endorse or promote products derived from this software
                     60: #    without specific prior written permission.
                     61: #
                     62: # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
                     63: # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     64: # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     65: # ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
                     66: # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     67: # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     68: # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     69: # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     70: # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     71: # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     72: # SUCH DAMAGE.
                     73: #
                     74: #      @(#)genassym.c  5.11 (Berkeley) 5/10/91
                     75: #
                     76:
1.29      jdolecek   77: if defined(_KERNEL_OPT)
1.8       thorpej    78: include "opt_compat_svr4.h"
                     79: include "opt_compat_freebsd.h"
                     80: include "opt_compat_linux.h"
1.32      fvdl       81: include "opt_multiprocessor.h"
1.22      jdolecek   82: endif
1.7       thorpej    83:
1.1       mycroft    84: include <sys/param.h>
                     85: include <sys/proc.h>
                     86: include <sys/resourcevar.h>
                     87: include <sys/device.h>
                     88: include <sys/user.h>
                     89: include <sys/mbuf.h>
1.25      fvdl       90: include <netinet/in.h>
                     91: include <netinet/in_systm.h>
                     92: include <netinet/ip.h>
1.27      sommerfe   93: include <netinet/ip6.h>
1.25      fvdl       94: include <netinet/ip_var.h>
1.1       mycroft    95:
1.18      thorpej    96: include <uvm/uvm.h>
1.6       mrg        97:
1.1       mycroft    98: include <machine/trap.h>
                     99: include <machine/pmap.h>
                    100: include <machine/vmparam.h>
1.33      fvdl      101: include <machine/intr.h>
                    102: include <machine/types.h>
1.1       mycroft   103:
1.22      jdolecek  104: if defined(_KERNEL) && !defined(_LKM)
1.33      fvdl      105: include "ioapic.h"
1.1       mycroft   106: include "apm.h"
1.22      jdolecek  107: endif
1.1       mycroft   108: if NAPM > 0
1.3       jtk       109: include <machine/bioscall.h>
1.1       mycroft   110: include <machine/apmvar.h>
                    111: endif
                    112:
                    113: ifdef COMPAT_SVR4
                    114: include <compat/svr4/svr4_ucontext.h>
                    115: endif
                    116:
                    117: ifdef COMPAT_LINUX
1.13      fvdl      118: include <compat/linux/common/linux_signal.h>
                    119: include <compat/linux/common/linux_machdep.h>
1.1       mycroft   120: endif
                    121:
                    122: ifdef COMPAT_FREEBSD
                    123: include <machine/freebsd_machdep.h>
                    124: endif
                    125:
1.32      fvdl      126: ifdef MULTIPROCESSOR
                    127: include <machine/cpu.h>
                    128: endif
                    129:
1.33      fvdl      130: if NIOAPIC > 0
1.37    ! fvdl      131: include <machine/i82093reg.h>
1.33      fvdl      132: include <machine/i82093var.h>
                    133: endif
                    134:
1.22      jdolecek  135: if defined(_KERNEL) && !defined(_LKM)
1.1       mycroft   136: include "isa.h"
1.22      jdolecek  137: endif
1.1       mycroft   138: if NISA > 0
1.14      cgd       139: include <machine/isa_machdep.h>
1.1       mycroft   140: endif
                    141:
1.32      fvdl      142: include <machine/tlog.h>
1.36      thorpej   143:
                    144: define PAGE_SIZE               PAGE_SIZE
                    145:
1.35      thorpej   146: define LSRUN                   LSRUN
                    147: define LSONPROC                LSONPROC
1.1       mycroft   148:
1.6       mrg       149: define PDSLOT_PTE              PDSLOT_PTE
                    150: define PDSLOT_APTE             PDSLOT_APTE
                    151: define PDSLOT_KERN             PDSLOT_KERN
                    152: define NKPTP_MIN               NKPTP_MIN
                    153: define NKPTP_MAX               NKPTP_MAX
1.1       mycroft   154:
                    155: define VM_MAXUSER_ADDRESS      (int)VM_MAXUSER_ADDRESS
1.18      thorpej   156:
                    157: define UVM_PAGE_IDLE_ZERO      offsetof(struct uvm, page_idle_zero)
1.1       mycroft   158:
1.35      thorpej   159: define L_ADDR                  offsetof(struct lwp, l_addr)
                    160: define L_BACK                  offsetof(struct lwp, l_back)
                    161: define L_FORW                  offsetof(struct lwp, l_forw)
                    162: define L_PRIORITY              offsetof(struct lwp, l_priority)
                    163: define L_STAT                  offsetof(struct lwp, l_stat)
                    164: define L_WCHAN                 offsetof(struct lwp, l_wchan)
                    165: define L_PROC                  offsetof(struct lwp, l_proc)
                    166: define L_MD_TSS_SEL            offsetof(struct lwp, l_md.md_tss_sel)
                    167: define L_MD_REGS               offsetof(struct lwp, l_md.md_regs)
                    168: define L_CPU                   offsetof(struct lwp, l_cpu)
1.1       mycroft   169: define P_FLAG                  offsetof(struct proc, p_flag)
1.31      gmcgarry  170: define P_NRAS                  offsetof(struct proc, p_nras)
1.24      mycroft   171: define P_MD_SYSCALL            offsetof(struct proc, p_md.md_syscall)
1.35      thorpej   172: define P_MD_ASTPENDING         offsetof(struct proc, p_md.md_astpending)
1.1       mycroft   173:
                    174: define P_SYSTEM                P_SYSTEM
                    175:
                    176: define M_DATA                  offsetof(struct mbuf, m_data)
                    177: define M_LEN                   offsetof(struct mbuf, m_len)
                    178: define M_NEXT                  offsetof(struct mbuf, m_next)
1.25      fvdl      179:
                    180: define IP_SRC                  offsetof(struct ip, ip_src)
                    181: define IP_DST                  offsetof(struct ip, ip_dst)
1.27      sommerfe  182:
                    183: define IP6_SRC                 offsetof(struct ip6_hdr, ip6_src)
                    184: define IP6_DST                 offsetof(struct ip6_hdr, ip6_dst)
1.1       mycroft   185:
1.6       mrg       186: define V_TRAP                  offsetof(struct uvmexp, traps)
                    187: define V_INTR                  offsetof(struct uvmexp, intrs)
1.1       mycroft   188:
                    189: define PCB_CR3                 offsetof(struct pcb, pcb_cr3)
                    190: define PCB_EBP                 offsetof(struct pcb, pcb_ebp)
                    191: define PCB_ESP                 offsetof(struct pcb, pcb_esp)
                    192: define PCB_CR0                 offsetof(struct pcb, pcb_cr0)
                    193: define PCB_LDT_SEL             offsetof(struct pcb, pcb_ldt_sel)
                    194: define PCB_ONFAULT             offsetof(struct pcb, pcb_onfault)
1.32      fvdl      195: define PCB_FPCPU               offsetof(struct pcb, pcb_fpcpu)
1.1       mycroft   196:
                    197: define TF_CS                   offsetof(struct trapframe, tf_cs)
1.5       mycroft   198: define TF_EIP                  offsetof(struct trapframe, tf_eip)
1.4       mycroft   199: define TF_ERR                  offsetof(struct trapframe, tf_err)
1.1       mycroft   200: define TF_TRAPNO               offsetof(struct trapframe, tf_trapno)
                    201: define TF_EFLAGS               offsetof(struct trapframe, tf_eflags)
                    202:
1.33      fvdl      203: define TF_GS                   offsetof(struct trapframe, tf_gs)
                    204: define TF_FS                   offsetof(struct trapframe, tf_fs)
                    205: define TF_ES                   offsetof(struct trapframe, tf_es)
                    206: define TF_DS                   offsetof(struct trapframe, tf_ds)
                    207: define TF_EDI                  offsetof(struct trapframe, tf_edi)
                    208: define TF_ESI                  offsetof(struct trapframe, tf_esi)
                    209: define TF_EBP                  offsetof(struct trapframe, tf_ebp)
                    210: define TF_EBX                  offsetof(struct trapframe, tf_ebx)
                    211: define TF_EDX                  offsetof(struct trapframe, tf_edx)
                    212: define TF_ECX                  offsetof(struct trapframe, tf_ecx)
                    213: define TF_EAX                  offsetof(struct trapframe, tf_eax)
                    214:
                    215: define TF_PUSHSIZE             offsetof(struct trapframe, tf_trapno)
                    216:
1.1       mycroft   217: define FRAMESIZE               sizeof(struct trapframe)
                    218:
                    219: ifdef COMPAT_SVR4
                    220: define SVR4_SIGF_HANDLER       offsetof(struct svr4_sigframe, sf_handler)
                    221: define SVR4_SIGF_UC            offsetof(struct svr4_sigframe, sf_uc)
                    222: endif
                    223:
                    224: ifdef COMPAT_LINUX
                    225: define LINUX_SIGF_HANDLER      offsetof(struct linux_sigframe, sf_handler)
                    226: define LINUX_SIGF_SC           offsetof(struct linux_sigframe, sf_sc)
1.34      christos  227: define LINUX_RT_SIGF_HANDLER   offsetof(struct linux_rt_sigframe, sf_handler)
                    228: define LINUX_RT_SIGF_SC        offsetof(struct linux_rt_sigframe, sf_sc)
1.1       mycroft   229: endif
                    230:
                    231: ifdef COMPAT_FREEBSD
                    232: define FREEBSD_SIGF_HANDLER    offsetof(struct freebsd_sigframe, sf_handler)
                    233: define FREEBSD_SIGF_SC         offsetof(struct freebsd_sigframe, sf_sc)
                    234: endif
                    235:
                    236: define IH_FUN                  offsetof(struct intrhand, ih_fun)
                    237: define IH_ARG                  offsetof(struct intrhand, ih_arg)
1.33      fvdl      238: define IH_LEVEL                offsetof(struct intrhand, ih_level)
1.1       mycroft   239: define IH_NEXT                 offsetof(struct intrhand, ih_next)
                    240:
                    241: if NAPM > 0
                    242: define APM_CODE32              offsetof(struct apm_connect_info, apm_code32_seg_base)
                    243: define APM_CODE16              offsetof(struct apm_connect_info, apm_code16_seg_base)
                    244: define APM_DATA                offsetof(struct apm_connect_info, apm_data_seg_base)
                    245: define APM_CODE32_LEN          offsetof(struct apm_connect_info, apm_code32_seg_len)
                    246: define APM_DATA_LEN            offsetof(struct apm_connect_info, apm_data_seg_len)
                    247: define APM_ENTRY               offsetof(struct apm_connect_info, apm_entrypt)
                    248: define APM_DETAIL              offsetof(struct apm_connect_info, apm_detail)
                    249: define APM_SIZE                sizeof(struct apm_connect_info)
1.10      jtk       250: define BIOSCALLREG_EAX         offsetof(struct bioscallregs, EAX)
                    251: define BIOSCALLREG_EBX         offsetof(struct bioscallregs, EBX)
                    252: define BIOSCALLREG_ECX         offsetof(struct bioscallregs, ECX)
                    253: define BIOSCALLREG_EDX         offsetof(struct bioscallregs, EDX)
                    254: define BIOSCALLREG_ESI         offsetof(struct bioscallregs, ESI)
                    255: define BIOSCALLREG_EDI         offsetof(struct bioscallregs, EDI)
                    256: define BIOSCALLREG_EFLAGS      offsetof(struct bioscallregs, EFLAGS)
1.26      augustss  257: endif
1.32      fvdl      258:
                    259: define CPU_INFO_SELF           offsetof(struct cpu_info, ci_self)
                    260: define CPU_INFO_RESCHED        offsetof(struct cpu_info, ci_want_resched)
1.35      thorpej   261: define CPU_INFO_CURLWP         offsetof(struct cpu_info, ci_curlwp)
1.32      fvdl      262: define CPU_INFO_CURPCB         offsetof(struct cpu_info, ci_curpcb)
                    263: define CPU_INFO_IDLE_PCB       offsetof(struct cpu_info, ci_idle_pcb)
                    264: define  CPU_INFO_IDLE_TSS_SEL  offsetof(struct cpu_info, ci_idle_tss_sel)
                    265: define CPU_INFO_ASTPENDING     offsetof(struct cpu_info, ci_astpending)
                    266:
                    267: define CPU_INFO_LEVEL          offsetof(struct cpu_info, ci_cpuid_level)
                    268: define CPU_INFO_VENDOR         offsetof(struct cpu_info, ci_vendor[0])
                    269: define CPU_INFO_SIGNATURE      offsetof(struct cpu_info, ci_signature)
                    270: define CPU_INFO_FEATURES       offsetof(struct cpu_info, ci_feature_flags)
                    271: define CPU_INFO_BRAND          offsetof(struct cpu_info, ci_brand_id)
                    272:
                    273: define CPU_TLOG_OFFSET         offsetof(struct cpu_info, ci_tlog_offset)
                    274: define CPU_TLOG_BASE           offsetof(struct cpu_info, ci_tlog_base)
                    275:
                    276: define CPU_INFO_GDT            offsetof(struct cpu_info, ci_gdt)
1.33      fvdl      277: define CPU_INFO_IPENDING       offsetof(struct cpu_info, ci_ipending)
                    278: define CPU_INFO_IMASK          offsetof(struct cpu_info, ci_imask)
                    279: define CPU_INFO_IUNMASK        offsetof(struct cpu_info, ci_iunmask)
                    280: define CPU_INFO_ILEVEL         offsetof(struct cpu_info, ci_ilevel)
                    281: define CPU_INFO_IDEPTH         offsetof(struct cpu_info, ci_idepth)
                    282: define CPU_INFO_ISOURCES       offsetof(struct cpu_info, ci_isources)
                    283:
                    284: if NIOAPIC > 0
                    285: define         IOAPIC_SC_REG           offsetof(struct ioapic_softc, sc_reg)
                    286: define         IOAPIC_SC_DATA          offsetof(struct ioapic_softc, sc_data)
                    287: define         PIC_LOCK                offsetof(struct pic, pic_lock)
                    288: endif
1.32      fvdl      289:
                    290: define SIZEOF_CPU_INFO         sizeof(struct cpu_info)
                    291:
1.33      fvdl      292: define        SIZEOF_ISOURCE          sizeof(struct intrsource)
                    293: define        SIZEOF_ISTUB            sizeof(struct intrstub)
                    294:
                    295: define         IS_RECURSE      offsetof(struct intrsource, is_recurse)
                    296: define         IS_RESUME       offsetof(struct intrsource, is_resume)
                    297: define         IS_EVCNTLO      offsetof(struct intrsource, is_evcnt.ev_count)
                    298: define         IS_EVCNTHI      offsetof(struct intrsource, is_evcnt.ev_count)+4
                    299: define         IS_HANDLERS     offsetof(struct intrsource, is_handlers)
                    300: define         IS_PIC          offsetof(struct intrsource, is_pic)
                    301: define         IS_FLAGS        offsetof(struct intrsource, is_flags)
                    302: define         IS_PIN          offsetof(struct intrsource, is_pin)
                    303: define         IS_TYPE         offsetof(struct intrsource, is_type)
                    304: define         IS_MAXLEVEL     offsetof(struct intrsource, is_maxlevel)
                    305:
1.32      fvdl      306: define TREC_SP                 offsetof(struct trec, tr_sp)
                    307: define TREC_HPC                offsetof(struct trec, tr_hpc)
                    308: define TREC_IPC                offsetof(struct trec, tr_ipc)
                    309: define TREC_TSC                offsetof(struct trec, tr_tsc)
                    310: define TREC_LBF                offsetof(struct trec, tr_lbf)
                    311: define TREC_LBT                offsetof(struct trec, tr_lbt)
                    312: define TREC_IBF                offsetof(struct trec, tr_ibf)
                    313: define TREC_IBT                offsetof(struct trec, tr_ibt)
                    314:
                    315: define SIZEOF_TREC             sizeof(struct trec)
                    316: define SIZEOF_TLOG             sizeof(struct tlog)

CVSweb <webmaster@jp.NetBSD.org>