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

Annotation of src/sys/arch/amd64/amd64/genassym.cf, Revision 1.3.16.5

1.3.16.5! yamt        1: #      $NetBSD: genassym.cf,v 1.3.16.4 2007/10/27 11:25:03 yamt Exp $
1.1       fvdl        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: #
                     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:
                     77: if defined(_KERNEL_OPT)
                     78: include "opt_compat_netbsd32.h"
1.3.16.1  yamt       79: include "opt_compat_linux32.h"
1.1       fvdl       80: include "opt_multiprocessor.h"
                     81: endif
                     82:
1.3.16.2  yamt       83: quote #define __MUTEX_PRIVATE
                     84: quote #define __RWLOCK_PRIVATE
                     85:
1.1       fvdl       86: include <sys/param.h>
                     87: include <sys/proc.h>
                     88: include <sys/resourcevar.h>
                     89: include <sys/device.h>
                     90: include <sys/user.h>
                     91: include <sys/mbuf.h>
1.3.16.2  yamt       92: include <sys/mutex.h>
                     93: include <sys/rwlock.h>
                     94: include <sys/cpu_data.h>
1.3.16.3  yamt       95: include <sys/evcnt.h>
1.3.16.2  yamt       96:
1.1       fvdl       97: include <netinet/in.h>
                     98: include <netinet/in_systm.h>
                     99: include <netinet/ip.h>
                    100: include <netinet/ip_var.h>
                    101:
                    102: include <uvm/uvm.h>
                    103:
                    104: include <machine/trap.h>
                    105: include <machine/pmap.h>
                    106: include <machine/vmparam.h>
                    107: include <machine/intr.h>
                    108: include <machine/types.h>
1.3.16.4  yamt      109: include <machine/cpufunc.h>
1.1       fvdl      110:
                    111: if defined(COMPAT_NETBSD32)
                    112: include <machine/netbsd32_machdep.h>
                    113: endif
                    114:
1.3.16.1  yamt      115: if defined(COMPAT_LINUX32)
                    116: include <machine/linux32_machdep.h>
                    117: endif
                    118:
1.1       fvdl      119: if defined(_KERNEL) && !defined(_LKM)
                    120: include "isa.h"
                    121: include "ioapic.h"
                    122: endif
                    123: if NISA > 0
                    124: include <machine/isa_machdep.h>
                    125: endif
                    126:
                    127: ifdef MULTIPROCESSOR
                    128: include <machine/cpu.h>
                    129: endif
                    130:
                    131: if NIOAPIC > 0
1.2       fvdl      132: include <machine/i82093reg.h>
1.1       fvdl      133: include <machine/i82093var.h>
                    134: endif
                    135:
1.3.16.4  yamt      136: include <x86/busdefs.h>
                    137:
1.1       fvdl      138: define LSRUN                   LSRUN
                    139: define LSONPROC                LSONPROC
                    140:
1.3.16.4  yamt      141: define UPAGES                  UPAGES
                    142: define USPACE                  USPACE
                    143:
                    144: define KERNBASE_LO             KERNBASE_LO
                    145: define KERNBASE_HI             KERNBASE_HI
                    146: define KERNBASE                KERNBASE
                    147: define KERNTEXTOFF_LO          KERNTEXTOFF_LO
                    148: define KERNTEXTOFF             KERNTEXTOFF
                    149:
                    150: define NBPG                    NBPG
                    151:
                    152: define L4_SLOT_KERNBASE        L4_SLOT_KERNBASE
1.1       fvdl      153: define L3_SLOT_KERNBASE        pl3_pi(KERNBASE)
                    154: define L2_SLOT_KERNBASE        pl2_pi(KERNBASE)
                    155: define L1_SLOT_KERNBASE        pl1_pi(KERNBASE)
                    156:
1.3.16.4  yamt      157: define PDIR_SLOT_PTE           PDIR_SLOT_PTE
                    158:
1.1       fvdl      159: define VM_MAXUSER_ADDRESS      (unsigned long long)VM_MAXUSER_ADDRESS
                    160:
                    161: define UVM_PAGE_IDLE_ZERO      offsetof(struct uvm, page_idle_zero)
                    162:
1.3.16.2  yamt      163: define L_ADDR                  offsetof(struct lwp, l_addr)
1.3.16.3  yamt      164: define L_FLAG                  offsetof(struct lwp, l_flag)
1.3.16.2  yamt      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_MD_FLAGS              offsetof(struct lwp, l_md.md_flags)
                    169: define L_MUTEX                 offsetof(struct lwp, l_mutex)
                    170: define L_MD_ASTPENDING         offsetof(struct lwp, l_md.md_astpending)
1.1       fvdl      171:
1.3.16.2  yamt      172: define PAGE_SIZE               PAGE_SIZE
1.1       fvdl      173:
1.3.16.2  yamt      174: define MDP_IRET                MDP_IRET
1.1       fvdl      175:
                    176: define P_FLAG                  offsetof(struct proc, p_flag)
1.3       dsl       177: define P_RASLIST               offsetof(struct proc, p_raslist)
1.1       fvdl      178: define P_MD_SYSCALL            offsetof(struct proc, p_md.md_syscall)
                    179:
1.3.16.3  yamt      180: define LW_SYSTEM               LW_SYSTEM
                    181:
1.1       fvdl      182: define M_DATA                  offsetof(struct mbuf, m_data)
                    183: define M_LEN                   offsetof(struct mbuf, m_len)
                    184: define M_NEXT                  offsetof(struct mbuf, m_next)
                    185:
                    186: define IP_SRC                  offsetof(struct ip, ip_src)
                    187: define IP_DST                  offsetof(struct ip, ip_dst)
                    188:
                    189: define V_TRAP                  offsetof(struct uvmexp, traps)
                    190: define V_INTR                  offsetof(struct uvmexp, intrs)
                    191:
                    192: define PCB_CR3                 offsetof(struct pcb, pcb_cr3)
                    193: define PCB_RBP                 offsetof(struct pcb, pcb_rbp)
                    194: define PCB_RSP                 offsetof(struct pcb, pcb_rsp)
                    195: define PCB_USERSP              offsetof(struct pcb, pcb_usersp)
                    196: define PCB_RSP0                offsetof(struct pcb, pcb_tss.tss_rsp0)
                    197: define PCB_CR0                 offsetof(struct pcb, pcb_cr0)
                    198: define PCB_LDT_SEL             offsetof(struct pcb, pcb_ldt_sel)
                    199: define PCB_ONFAULT             offsetof(struct pcb, pcb_onfault)
                    200: define PCB_FPCPU               offsetof(struct pcb, pcb_fpcpu)
                    201:
                    202: define TF_RDI                  offsetof(struct trapframe, tf_rdi)
                    203: define TF_RSI                  offsetof(struct trapframe, tf_rsi)
                    204: define TF_RDX                  offsetof(struct trapframe, tf_rdx)
                    205: define TF_RCX                  offsetof(struct trapframe, tf_rcx)
                    206: define TF_R8                   offsetof(struct trapframe, tf_r8)
                    207: define TF_R9                   offsetof(struct trapframe, tf_r9)
                    208: define TF_R10                  offsetof(struct trapframe, tf_r10)
                    209: define TF_R11                  offsetof(struct trapframe, tf_r11)
                    210: define TF_R12                  offsetof(struct trapframe, tf_r12)
                    211: define TF_R13                  offsetof(struct trapframe, tf_r13)
                    212: define TF_R14                  offsetof(struct trapframe, tf_r14)
                    213: define TF_R15                  offsetof(struct trapframe, tf_r15)
                    214: define TF_RBP                  offsetof(struct trapframe, tf_rbp)
                    215: define TF_RBX                  offsetof(struct trapframe, tf_rbx)
                    216: define TF_RAX                  offsetof(struct trapframe, tf_rax)
                    217: define TF_GS                   offsetof(struct trapframe, tf_gs)
                    218: define TF_FS                   offsetof(struct trapframe, tf_fs)
                    219: define TF_ES                   offsetof(struct trapframe, tf_es)
                    220: define TF_DS                   offsetof(struct trapframe, tf_ds)
                    221: define TF_TRAPNO               offsetof(struct trapframe, tf_trapno)
                    222: define TF_ERR                  offsetof(struct trapframe, tf_err)
                    223: define TF_RIP                  offsetof(struct trapframe, tf_rip)
                    224: define TF_CS                   offsetof(struct trapframe, tf_cs)
                    225: define TF_RFLAGS               offsetof(struct trapframe, tf_rflags)
                    226: define TF_RSP                  offsetof(struct trapframe, tf_rsp)
                    227: define TF_SS                   offsetof(struct trapframe, tf_ss)
                    228:
                    229: define FRAMESIZE               sizeof(struct trapframe)
                    230:
                    231: define CPU_INFO_SCRATCH        offsetof(struct cpu_info, ci_scratch)
1.3.16.4  yamt      232: define CPU_INFO_SELF           offsetof(struct cpu_info, ci_self)
                    233: define CPU_INFO_RESCHED        offsetof(struct cpu_info, ci_want_resched)
                    234: define CPU_INFO_WANT_PMAPLOAD  offsetof(struct cpu_info, ci_want_pmapload)
1.3.16.3  yamt      235: define CPU_INFO_PMAP_CPU       offsetof(struct cpu_info, ci_pmap_cpu)
1.3.16.4  yamt      236: define CPU_INFO_TLBSTATE       offsetof(struct cpu_info, ci_tlbstate)
                    237: define TLBSTATE_VALID          TLBSTATE_VALID
                    238: define TLBSTATE_LAZY           TLBSTATE_LAZY
                    239: define TLBSTATE_STALE          TLBSTATE_STALE
1.3.16.3  yamt      240: define CPU_INFO_TLB_EVCNT      offsetof(struct cpu_info, ci_tlb_evcnt)
1.3.16.4  yamt      241: define CPU_INFO_CURLWP         offsetof(struct cpu_info, ci_curlwp)
                    242: define CPU_INFO_IDLELWP        offsetof(struct cpu_info, ci_data.cpu_idlelwp)
                    243: define CPU_INFO_PMAP           offsetof(struct cpu_info, ci_pmap)
                    244: define CPU_INFO_CPUMASK        offsetof(struct cpu_info, ci_cpumask)
                    245:
                    246: define CPU_INFO_GDT            offsetof(struct cpu_info, ci_gdt)
                    247: define CPU_INFO_IPENDING       offsetof(struct cpu_info, ci_ipending)
                    248: define CPU_INFO_IMASK          offsetof(struct cpu_info, ci_imask)
                    249: define CPU_INFO_IUNMASK        offsetof(struct cpu_info, ci_iunmask)
                    250: define CPU_INFO_ILEVEL         offsetof(struct cpu_info, ci_ilevel)
                    251: define CPU_INFO_IDEPTH         offsetof(struct cpu_info, ci_idepth)
                    252: define CPU_INFO_ISOURCES       offsetof(struct cpu_info, ci_isources)
1.3.16.2  yamt      253: define CPU_INFO_MTX_COUNT      offsetof(struct cpu_info, ci_mtx_count)
                    254: define CPU_INFO_MTX_OLDSPL     offsetof(struct cpu_info, ci_mtx_oldspl)
1.3.16.4  yamt      255: define CPU_INFO_ISTATE         offsetof(struct cpu_info, ci_istate)
1.2       fvdl      256:
                    257: if NIOAPIC > 0
                    258: define         IOAPIC_SC_REG           offsetof(struct ioapic_softc, sc_reg)
                    259: define         IOAPIC_SC_DATA          offsetof(struct ioapic_softc, sc_data)
                    260: define         PIC_LOCK                offsetof(struct pic, pic_lock)
                    261: endif
1.1       fvdl      262:
                    263: define IH_FUN                  offsetof(struct intrhand, ih_fun)
                    264: define IH_ARG                  offsetof(struct intrhand, ih_arg)
                    265: define IH_NEXT                 offsetof(struct intrhand, ih_next)
                    266: define  IH_LEVEL               offsetof(struct intrhand, ih_level)
                    267:
                    268: ifdef COMPAT_NETBSD32
                    269: define SC_FS32                 offsetof(struct netbsd32_sigcontext, sc_fs)
                    270: define SC_GS32                 offsetof(struct netbsd32_sigcontext, sc_gs)
                    271: endif
                    272:
1.3.16.1  yamt      273: ifdef COMPAT_LINUX32
                    274: define  LINUX32_SF_HANDLER     offsetof(struct linux32_sigframe, sf_handler)
                    275: define  LINUX32_SF_SC          offsetof(struct linux32_sigframe, sf_sc)
                    276: define  LINUX32_RT_SF_HANDLER  offsetof(struct linux32_rt_sigframe, sf_handler)
                    277: define  LINUX32_RT_SF_UC       offsetof(struct linux32_rt_sigframe, sf_uc)
                    278: define  LINUX32_SYS_rt_sigreturn       LINUX32_SYS_rt_sigreturn
                    279: define  LINUX32_SYS_sigreturn          LINUX32_SYS_sigreturn
1.3.16.5! yamt      280: define  LINUX32_SYS_exit               LINUX32_SYS_netbsd32_exit
1.3.16.1  yamt      281: endif
                    282:
1.3.16.4  yamt      283: define IS_RECURSE              offsetof(struct intrsource, is_recurse)
                    284: define IS_RESUME               offsetof(struct intrsource, is_resume)
                    285: define IS_EVCNT                offsetof(struct intrsource, is_evcnt.ev_count)
                    286: define IS_HANDLERS             offsetof(struct intrsource, is_handlers)
                    287: define IS_PIC                  offsetof(struct intrsource, is_pic)
                    288: define IS_FLAGS                offsetof(struct intrsource, is_flags)
                    289: define IS_PIN                  offsetof(struct intrsource, is_pin)
                    290: define IS_TYPE                 offsetof(struct intrsource, is_type)
                    291: define IS_MAXLEVEL             offsetof(struct intrsource, is_maxlevel)
                    292:
                    293: define IPL_NONE                IPL_NONE
                    294: define IPL_CLOCK               IPL_CLOCK
                    295: define IPL_IPI                 IPL_IPI
                    296:
                    297: define IPL_SOFTNET             IPL_SOFTNET
                    298: define IPL_SOFTCLOCK           IPL_SOFTCLOCK
                    299: define IPL_SOFTSERIAL          IPL_SOFTSERIAL
                    300:
                    301: define LIR_IPI                 LIR_IPI
                    302: define LIR_TIMER               LIR_TIMER
                    303:
                    304: define SIR_NET                 SIR_NET
                    305: define SIR_CLOCK               SIR_CLOCK
                    306: define SIR_SERIAL              SIR_SERIAL
                    307:
                    308: define IREENT_MAGIC            IREENT_MAGIC
                    309:
                    310: define X86_SOFTINTR_SOFTSERIAL X86_SOFTINTR_SOFTSERIAL
                    311: define X86_SOFTINTR_SOFTNET    X86_SOFTINTR_SOFTNET
                    312: define X86_SOFTINTR_SOFTCLOCK  X86_SOFTINTR_SOFTCLOCK
                    313:
                    314: define PSL_MBO                 PSL_MBO
1.3.16.2  yamt      315:
                    316: define MTX_IPL                 offsetof(struct kmutex, u.s.mtxs_ipl)
                    317: define MTX_LOCK                offsetof(struct kmutex, u.s.mtxs_lock)
                    318: define MTX_OWNER               offsetof(struct kmutex, u.mtxa_owner)
                    319:
1.3.16.4  yamt      320: define RW_OWNER                offsetof(struct krwlock, rw_owner)
                    321: define RW_WRITE_LOCKED         RW_WRITE_LOCKED
                    322: define RW_WRITE_WANTED         RW_WRITE_WANTED
                    323: define RW_READ_INCR            RW_READ_INCR
                    324: define RW_HAS_WAITERS          RW_HAS_WAITERS
                    325: define RW_THREAD               RW_THREAD
                    326: define RW_READER               RW_READER
                    327: define RW_WRITER               RW_WRITER
1.3.16.3  yamt      328:
                    329: define MB_POINTER              offsetof(struct pmap_mbox, mb_pointer)
                    330: define MB_GLOBAL               offsetof(struct pmap_mbox, mb_global)
                    331: define MB_ADDR1                offsetof(struct pmap_mbox, mb_addr1)
                    332: define MB_ADDR2                offsetof(struct pmap_mbox, mb_addr2)
                    333: define MB_HEAD                 offsetof(struct pmap_mbox, mb_head)
                    334: define MB_TAIL                 offsetof(struct pmap_mbox, mb_tail)
                    335:
1.3.16.4  yamt      336: define PM_CPUS                 offsetof(struct pmap, pm_cpus)
                    337:
1.3.16.3  yamt      338: define EV_COUNT                offsetof(struct evcnt, ev_count)
1.3.16.4  yamt      339:
                    340: define OPTERON_MSR_PASSCODE    OPTERON_MSR_PASSCODE
                    341:
                    342: define X86_BUS_SPACE_IO        X86_BUS_SPACE_IO
                    343:
                    344: define NKL4_KIMG_ENTRIES       NKL4_KIMG_ENTRIES
                    345: define NKL3_KIMG_ENTRIES       NKL3_KIMG_ENTRIES
                    346: define NKL2_KIMG_ENTRIES       NKL2_KIMG_ENTRIES
                    347:
                    348: define PGOFSET                 PGOFSET
                    349: define PGSHIFT                 PGSHIFT

CVSweb <webmaster@jp.NetBSD.org>