1129198Scognet/*-
2129198Scognet * Copyright (c) 2004 Olivier Houchard
3129198Scognet * All rights reserved.
4129198Scognet *
5129198Scognet * Redistribution and use in source and binary forms, with or without
6129198Scognet * modification, are permitted provided that the following conditions
7129198Scognet * are met:
8129198Scognet * 1. Redistributions of source code must retain the above copyright
9129198Scognet *    notice, this list of conditions and the following disclaimer.
10129198Scognet * 2. Redistributions in binary form must reproduce the above copyright
11129198Scognet *    notice, this list of conditions and the following disclaimer in the
12129198Scognet *    documentation and/or other materials provided with the distribution.
13129198Scognet *
14129198Scognet * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15129198Scognet * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16129198Scognet * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17129198Scognet * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18129198Scognet * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19129198Scognet * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20129198Scognet * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21129198Scognet * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22129198Scognet * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23129198Scognet * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24129198Scognet * SUCH DAMAGE.
25129198Scognet *
26129198Scognet */
27129198Scognet
28129198Scognet#include <sys/cdefs.h>
29129198Scognet__FBSDID("$FreeBSD: releng/11.0/sys/arm/arm/genassym.c 301700 2016-06-08 22:29:30Z andrew $");
30129198Scognet#include <sys/param.h>
31299122Sjhb#include <sys/cpuset.h>
32129198Scognet#include <sys/systm.h>
33129198Scognet#include <sys/assym.h>
34129198Scognet#include <sys/proc.h>
35129198Scognet#include <sys/mbuf.h>
36129198Scognet#include <sys/vmmeter.h>
37261252Simp#include <sys/bus.h>
38129198Scognet#include <vm/vm.h>
39239268Sgonzo#include <vm/vm_param.h>
40129198Scognet#include <vm/pmap.h>
41239268Sgonzo#include <vm/vm_map.h>
42284115Sandrew
43129198Scognet#include <machine/armreg.h>
44257200Sian#include <machine/frame.h>
45129198Scognet#include <machine/pcb.h>
46129198Scognet#include <machine/cpu.h>
47129198Scognet#include <machine/proc.h>
48129198Scognet#include <machine/cpufunc.h>
49279811Sian#include <machine/cpuinfo.h>
50137629Scognet#include <machine/intr.h>
51142570Scognet#include <machine/sysarch.h>
52142570Scognet
53129198Scognet#include <netinet/in.h>
54129198Scognet#include <netinet/in_systm.h>
55129198Scognet#include <netinet/ip.h>
56129198Scognet#include <netinet/ip6.h>
57129198Scognet#include <netinet/ip_var.h>
58129198Scognet
59129198ScognetASSYM(KERNBASE, KERNBASE);
60295036Smmel#if __ARM_ARCH >= 6
61280712SianASSYM(CPU_ASID_KERNEL,CPU_ASID_KERNEL);
62280712Sian#endif
63129198ScognetASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault));
64295036Smmel#if __ARM_ARCH < 6
65129198ScognetASSYM(PCB_DACR, offsetof(struct pcb, pcb_dacr));
66280712Sian#endif
67129198ScognetASSYM(PCB_PAGEDIR, offsetof(struct pcb, pcb_pagedir));
68295036Smmel#if __ARM_ARCH < 6
69129198ScognetASSYM(PCB_L1VEC, offsetof(struct pcb, pcb_l1vec));
70129198ScognetASSYM(PCB_PL1VEC, offsetof(struct pcb, pcb_pl1vec));
71280712Sian#endif
72276190SianASSYM(PCB_R4, offsetof(struct pcb, pcb_regs.sf_r4));
73276190SianASSYM(PCB_R5, offsetof(struct pcb, pcb_regs.sf_r5));
74276190SianASSYM(PCB_R6, offsetof(struct pcb, pcb_regs.sf_r6));
75276190SianASSYM(PCB_R7, offsetof(struct pcb, pcb_regs.sf_r7));
76276190SianASSYM(PCB_R8, offsetof(struct pcb, pcb_regs.sf_r8));
77276190SianASSYM(PCB_R9, offsetof(struct pcb, pcb_regs.sf_r9));
78276190SianASSYM(PCB_R10, offsetof(struct pcb, pcb_regs.sf_r10));
79276190SianASSYM(PCB_R11, offsetof(struct pcb, pcb_regs.sf_r11));
80276190SianASSYM(PCB_R12, offsetof(struct pcb, pcb_regs.sf_r12));
81276190SianASSYM(PCB_SP, offsetof(struct pcb, pcb_regs.sf_sp));
82276190SianASSYM(PCB_LR, offsetof(struct pcb, pcb_regs.sf_lr));
83276190SianASSYM(PCB_PC, offsetof(struct pcb, pcb_regs.sf_pc));
84129198Scognet
85129198ScognetASSYM(PC_CURPCB, offsetof(struct pcpu, pc_curpcb));
86129198ScognetASSYM(PC_CURTHREAD, offsetof(struct pcpu, pc_curthread));
87129198ScognetASSYM(M_LEN, offsetof(struct mbuf, m_len));
88129198ScognetASSYM(M_DATA, offsetof(struct mbuf, m_data));
89129198ScognetASSYM(M_NEXT, offsetof(struct mbuf, m_next));
90129198ScognetASSYM(IP_SRC, offsetof(struct ip, ip_src));
91129198ScognetASSYM(IP_DST, offsetof(struct ip, ip_dst));
92129198ScognetASSYM(CF_CONTEXT_SWITCH, offsetof(struct cpu_functions, cf_context_switch));
93129198ScognetASSYM(CF_DCACHE_WB_RANGE, offsetof(struct cpu_functions, cf_dcache_wb_range));
94129198ScognetASSYM(CF_IDCACHE_WBINV_ALL, offsetof(struct cpu_functions, cf_idcache_wbinv_all));
95183838SrajASSYM(CF_L2CACHE_WBINV_ALL, offsetof(struct cpu_functions, cf_l2cache_wbinv_all));
96129198ScognetASSYM(CF_TLB_FLUSHID_SE, offsetof(struct cpu_functions, cf_tlb_flushID_SE));
97129198Scognet
98129198ScognetASSYM(TD_PCB, offsetof(struct thread, td_pcb));
99129198ScognetASSYM(TD_FLAGS, offsetof(struct thread, td_flags));
100129198ScognetASSYM(TD_PROC, offsetof(struct thread, td_proc));
101142570ScognetASSYM(TD_MD, offsetof(struct thread, td_md));
102171788ScognetASSYM(TD_LOCK, offsetof(struct thread, td_lock));
103142570ScognetASSYM(MD_TP, offsetof(struct mdthread, md_tp));
104301700Sandrew#if __ARM_ARCH < 6
105188540ScognetASSYM(MD_RAS_START, offsetof(struct mdthread, md_ras_start));
106188540ScognetASSYM(MD_RAS_END, offsetof(struct mdthread, md_ras_end));
107301700Sandrew#endif
108129198Scognet
109291852SandrewASSYM(TF_SPSR, offsetof(struct trapframe, tf_spsr));
110129198ScognetASSYM(TF_R0, offsetof(struct trapframe, tf_r0));
111129198ScognetASSYM(TF_R1, offsetof(struct trapframe, tf_r1));
112129198ScognetASSYM(TF_PC, offsetof(struct trapframe, tf_pc));
113129198ScognetASSYM(P_PID, offsetof(struct proc, p_pid));
114129198ScognetASSYM(P_FLAG, offsetof(struct proc, p_flag));
115129198Scognet
116262903SianASSYM(SIGF_UC, offsetof(struct sigframe, sf_uc));
117262903Sian
118284115Sandrew#if __ARM_ARCH < 6
119142570ScognetASSYM(ARM_TP_ADDRESS, ARM_TP_ADDRESS);
120175982SrajASSYM(ARM_RAS_START, ARM_RAS_START);
121175982SrajASSYM(ARM_RAS_END, ARM_RAS_END);
122239268Sgonzo#endif
123239268Sgonzo
124254461Sandrew#ifdef VFP
125239268SgonzoASSYM(PCB_VFPSTATE, offsetof(struct pcb, pcb_vfpstate));
126284771Sian#endif
127239268Sgonzo
128284871Sandrew#if __ARM_ARCH >= 6
129239268SgonzoASSYM(PC_CURPMAP, offsetof(struct pcpu, pc_curpmap));
130284871Sandrew#endif
131239268Sgonzo
132150996ScognetASSYM(PAGE_SIZE, PAGE_SIZE);
133295703Sskra#if __ARM_ARCH < 6
134129198ScognetASSYM(PMAP_DOMAIN_KERNEL, PMAP_DOMAIN_KERNEL);
135295703Sskra#endif
136135651Scognet#ifdef PMAP_INCLUDE_PTE_SYNC
137135651ScognetASSYM(PMAP_INCLUDE_PTE_SYNC, 1);
138135651Scognet#endif
139129198ScognetASSYM(TDF_ASTPENDING, TDF_ASTPENDING);
140135651ScognetASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED);
141137629Scognet
142137629ScognetASSYM(MAXCOMLEN, MAXCOMLEN);
143276395SianASSYM(MAXCPU, MAXCPU);
144280712SianASSYM(_NCPUWORDS, _NCPUWORDS);
145137629ScognetASSYM(NIRQ, NIRQ);
146261415ScognetASSYM(PCPU_SIZE, sizeof(struct pcpu));
147280712SianASSYM(P_VMSPACE, offsetof(struct proc, p_vmspace));
148280712SianASSYM(VM_PMAP, offsetof(struct vmspace, vm_pmap));
149280712SianASSYM(PM_ACTIVE, offsetof(struct pmap, pm_active));
150280712SianASSYM(PC_CPUID, offsetof(struct pcpu, pc_cpuid));
151289372SkibASSYM(VM_MAXUSER_ADDRESS, VM_MAXUSER_ADDRESS);
152279811Sian
153279811SianASSYM(DCACHE_LINE_SIZE, offsetof(struct cpuinfo, dcache_line_size));
154279811SianASSYM(DCACHE_LINE_MASK, offsetof(struct cpuinfo, dcache_line_mask));
155279811SianASSYM(ICACHE_LINE_SIZE, offsetof(struct cpuinfo, icache_line_size));
156279811SianASSYM(ICACHE_LINE_MASK, offsetof(struct cpuinfo, icache_line_mask));
157