genassym.c revision 307136
1/*- 2 * Copyright (c) 2004 Olivier Houchard 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in the 12 * documentation and/or other materials provided with the distribution. 13 * 14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * 26 */ 27 28#include <sys/cdefs.h> 29__FBSDID("$FreeBSD: stable/11/sys/arm/arm/genassym.c 307136 2016-10-12 09:17:41Z ed $"); 30#include <sys/param.h> 31#include <sys/cpuset.h> 32#include <sys/systm.h> 33#include <sys/assym.h> 34#include <sys/proc.h> 35#include <sys/mbuf.h> 36#include <sys/vmmeter.h> 37#include <sys/bus.h> 38#include <vm/vm.h> 39#include <vm/vm_param.h> 40#include <vm/pmap.h> 41#include <vm/vm_map.h> 42 43#include <machine/armreg.h> 44#include <machine/frame.h> 45#include <machine/pcb.h> 46#include <machine/cpu.h> 47#include <machine/proc.h> 48#include <machine/cpufunc.h> 49#include <machine/cpuinfo.h> 50#include <machine/intr.h> 51#include <machine/sysarch.h> 52 53#include <netinet/in.h> 54#include <netinet/in_systm.h> 55#include <netinet/ip.h> 56#include <netinet/ip6.h> 57#include <netinet/ip_var.h> 58 59ASSYM(KERNBASE, KERNBASE); 60#if __ARM_ARCH >= 6 61ASSYM(CPU_ASID_KERNEL,CPU_ASID_KERNEL); 62#endif 63ASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault)); 64#if __ARM_ARCH < 6 65ASSYM(PCB_DACR, offsetof(struct pcb, pcb_dacr)); 66#endif 67ASSYM(PCB_PAGEDIR, offsetof(struct pcb, pcb_pagedir)); 68#if __ARM_ARCH < 6 69ASSYM(PCB_L1VEC, offsetof(struct pcb, pcb_l1vec)); 70ASSYM(PCB_PL1VEC, offsetof(struct pcb, pcb_pl1vec)); 71#endif 72ASSYM(PCB_R4, offsetof(struct pcb, pcb_regs.sf_r4)); 73ASSYM(PCB_R5, offsetof(struct pcb, pcb_regs.sf_r5)); 74ASSYM(PCB_R6, offsetof(struct pcb, pcb_regs.sf_r6)); 75ASSYM(PCB_R7, offsetof(struct pcb, pcb_regs.sf_r7)); 76ASSYM(PCB_R8, offsetof(struct pcb, pcb_regs.sf_r8)); 77ASSYM(PCB_R9, offsetof(struct pcb, pcb_regs.sf_r9)); 78ASSYM(PCB_R10, offsetof(struct pcb, pcb_regs.sf_r10)); 79ASSYM(PCB_R11, offsetof(struct pcb, pcb_regs.sf_r11)); 80ASSYM(PCB_R12, offsetof(struct pcb, pcb_regs.sf_r12)); 81ASSYM(PCB_SP, offsetof(struct pcb, pcb_regs.sf_sp)); 82ASSYM(PCB_LR, offsetof(struct pcb, pcb_regs.sf_lr)); 83ASSYM(PCB_PC, offsetof(struct pcb, pcb_regs.sf_pc)); 84#if __ARM_ARCH >= 6 85ASSYM(PCB_TPIDRURW, offsetof(struct pcb, pcb_regs.sf_tpidrurw)); 86#endif 87 88ASSYM(PC_CURPCB, offsetof(struct pcpu, pc_curpcb)); 89ASSYM(PC_CURTHREAD, offsetof(struct pcpu, pc_curthread)); 90ASSYM(M_LEN, offsetof(struct mbuf, m_len)); 91ASSYM(M_DATA, offsetof(struct mbuf, m_data)); 92ASSYM(M_NEXT, offsetof(struct mbuf, m_next)); 93ASSYM(IP_SRC, offsetof(struct ip, ip_src)); 94ASSYM(IP_DST, offsetof(struct ip, ip_dst)); 95ASSYM(CF_CONTEXT_SWITCH, offsetof(struct cpu_functions, cf_context_switch)); 96ASSYM(CF_DCACHE_WB_RANGE, offsetof(struct cpu_functions, cf_dcache_wb_range)); 97ASSYM(CF_IDCACHE_WBINV_ALL, offsetof(struct cpu_functions, cf_idcache_wbinv_all)); 98ASSYM(CF_L2CACHE_WBINV_ALL, offsetof(struct cpu_functions, cf_l2cache_wbinv_all)); 99ASSYM(CF_TLB_FLUSHID_SE, offsetof(struct cpu_functions, cf_tlb_flushID_SE)); 100 101ASSYM(TD_PCB, offsetof(struct thread, td_pcb)); 102ASSYM(TD_FLAGS, offsetof(struct thread, td_flags)); 103ASSYM(TD_PROC, offsetof(struct thread, td_proc)); 104ASSYM(TD_MD, offsetof(struct thread, td_md)); 105ASSYM(TD_LOCK, offsetof(struct thread, td_lock)); 106#if __ARM_ARCH < 6 107ASSYM(MD_TP, offsetof(struct mdthread, md_tp)); 108ASSYM(MD_RAS_START, offsetof(struct mdthread, md_ras_start)); 109ASSYM(MD_RAS_END, offsetof(struct mdthread, md_ras_end)); 110#endif 111 112ASSYM(TF_SPSR, offsetof(struct trapframe, tf_spsr)); 113ASSYM(TF_R0, offsetof(struct trapframe, tf_r0)); 114ASSYM(TF_R1, offsetof(struct trapframe, tf_r1)); 115ASSYM(TF_PC, offsetof(struct trapframe, tf_pc)); 116ASSYM(P_PID, offsetof(struct proc, p_pid)); 117ASSYM(P_FLAG, offsetof(struct proc, p_flag)); 118 119ASSYM(SIGF_UC, offsetof(struct sigframe, sf_uc)); 120 121#if __ARM_ARCH < 6 122ASSYM(ARM_TP_ADDRESS, ARM_TP_ADDRESS); 123ASSYM(ARM_RAS_START, ARM_RAS_START); 124ASSYM(ARM_RAS_END, ARM_RAS_END); 125#endif 126 127#ifdef VFP 128ASSYM(PCB_VFPSTATE, offsetof(struct pcb, pcb_vfpstate)); 129#endif 130 131#if __ARM_ARCH >= 6 132ASSYM(PC_CURPMAP, offsetof(struct pcpu, pc_curpmap)); 133#endif 134 135ASSYM(PAGE_SIZE, PAGE_SIZE); 136#if __ARM_ARCH < 6 137ASSYM(PMAP_DOMAIN_KERNEL, PMAP_DOMAIN_KERNEL); 138#endif 139#ifdef PMAP_INCLUDE_PTE_SYNC 140ASSYM(PMAP_INCLUDE_PTE_SYNC, 1); 141#endif 142ASSYM(TDF_ASTPENDING, TDF_ASTPENDING); 143ASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED); 144 145ASSYM(MAXCOMLEN, MAXCOMLEN); 146ASSYM(MAXCPU, MAXCPU); 147ASSYM(_NCPUWORDS, _NCPUWORDS); 148ASSYM(NIRQ, NIRQ); 149ASSYM(PCPU_SIZE, sizeof(struct pcpu)); 150ASSYM(P_VMSPACE, offsetof(struct proc, p_vmspace)); 151ASSYM(VM_PMAP, offsetof(struct vmspace, vm_pmap)); 152ASSYM(PM_ACTIVE, offsetof(struct pmap, pm_active)); 153ASSYM(PC_CPUID, offsetof(struct pcpu, pc_cpuid)); 154ASSYM(VM_MAXUSER_ADDRESS, VM_MAXUSER_ADDRESS); 155 156ASSYM(DCACHE_LINE_SIZE, offsetof(struct cpuinfo, dcache_line_size)); 157ASSYM(DCACHE_LINE_MASK, offsetof(struct cpuinfo, dcache_line_mask)); 158ASSYM(ICACHE_LINE_SIZE, offsetof(struct cpuinfo, icache_line_size)); 159ASSYM(ICACHE_LINE_MASK, offsetof(struct cpuinfo, icache_line_mask)); 160