genassym.c revision 280712
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: head/sys/arm/arm/genassym.c 280712 2015-03-26 21:13:53Z ian $");
30129198Scognet#include <sys/param.h>
31129198Scognet#include <sys/systm.h>
32129198Scognet#include <sys/assym.h>
33129198Scognet#include <sys/proc.h>
34129198Scognet#include <sys/mbuf.h>
35129198Scognet#include <sys/vmmeter.h>
36261252Simp#include <sys/bus.h>
37129198Scognet#include <vm/vm.h>
38239268Sgonzo#include <vm/vm_param.h>
39129198Scognet#include <vm/pmap.h>
40239268Sgonzo#include <vm/vm_map.h>
41129198Scognet#include <machine/vmparam.h>
42129198Scognet#include <machine/armreg.h>
43257200Sian#include <machine/frame.h>
44129198Scognet#include <machine/pcb.h>
45129198Scognet#include <machine/cpu.h>
46280712Sian#include <machine/cpu-v6.h>
47129198Scognet#include <machine/proc.h>
48129198Scognet#include <machine/cpufunc.h>
49279811Sian#include <machine/cpuinfo.h>
50129198Scognet#include <machine/pte.h>
51137629Scognet#include <machine/intr.h>
52142570Scognet#include <machine/sysarch.h>
53142570Scognet
54129198Scognet#include <netinet/in.h>
55129198Scognet#include <netinet/in_systm.h>
56129198Scognet#include <netinet/ip.h>
57129198Scognet#include <netinet/ip6.h>
58129198Scognet#include <netinet/ip_var.h>
59129198Scognet
60129198ScognetASSYM(KERNBASE, KERNBASE);
61129198ScognetASSYM(PCB_NOALIGNFLT, PCB_NOALIGNFLT);
62280712Sian#ifdef ARM_NEW_PMAP
63280712SianASSYM(CPU_ASID_KERNEL,CPU_ASID_KERNEL);
64280712Sian#endif
65129198ScognetASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault));
66280712Sian#ifndef ARM_NEW_PMAP
67129198ScognetASSYM(PCB_DACR, offsetof(struct pcb, pcb_dacr));
68280712Sian#endif
69129198ScognetASSYM(PCB_FLAGS, offsetof(struct pcb, pcb_flags));
70129198ScognetASSYM(PCB_PAGEDIR, offsetof(struct pcb, pcb_pagedir));
71280712Sian#ifndef ARM_NEW_PMAP
72129198ScognetASSYM(PCB_L1VEC, offsetof(struct pcb, pcb_l1vec));
73129198ScognetASSYM(PCB_PL1VEC, offsetof(struct pcb, pcb_pl1vec));
74280712Sian#endif
75276190SianASSYM(PCB_R4, offsetof(struct pcb, pcb_regs.sf_r4));
76276190SianASSYM(PCB_R5, offsetof(struct pcb, pcb_regs.sf_r5));
77276190SianASSYM(PCB_R6, offsetof(struct pcb, pcb_regs.sf_r6));
78276190SianASSYM(PCB_R7, offsetof(struct pcb, pcb_regs.sf_r7));
79276190SianASSYM(PCB_R8, offsetof(struct pcb, pcb_regs.sf_r8));
80276190SianASSYM(PCB_R9, offsetof(struct pcb, pcb_regs.sf_r9));
81276190SianASSYM(PCB_R10, offsetof(struct pcb, pcb_regs.sf_r10));
82276190SianASSYM(PCB_R11, offsetof(struct pcb, pcb_regs.sf_r11));
83276190SianASSYM(PCB_R12, offsetof(struct pcb, pcb_regs.sf_r12));
84276190SianASSYM(PCB_SP, offsetof(struct pcb, pcb_regs.sf_sp));
85276190SianASSYM(PCB_LR, offsetof(struct pcb, pcb_regs.sf_lr));
86276190SianASSYM(PCB_PC, offsetof(struct pcb, pcb_regs.sf_pc));
87129198Scognet
88129198ScognetASSYM(PC_CURPCB, offsetof(struct pcpu, pc_curpcb));
89129198ScognetASSYM(PC_CURTHREAD, offsetof(struct pcpu, pc_curthread));
90129198ScognetASSYM(M_LEN, offsetof(struct mbuf, m_len));
91129198ScognetASSYM(M_DATA, offsetof(struct mbuf, m_data));
92129198ScognetASSYM(M_NEXT, offsetof(struct mbuf, m_next));
93129198ScognetASSYM(IP_SRC, offsetof(struct ip, ip_src));
94129198ScognetASSYM(IP_DST, offsetof(struct ip, ip_dst));
95129198ScognetASSYM(CF_SETTTB, offsetof(struct cpu_functions, cf_setttb));
96129198ScognetASSYM(CF_CONTROL, offsetof(struct cpu_functions, cf_control));
97129198ScognetASSYM(CF_CONTEXT_SWITCH, offsetof(struct cpu_functions, cf_context_switch));
98129198ScognetASSYM(CF_DCACHE_WB_RANGE, offsetof(struct cpu_functions, cf_dcache_wb_range));
99183838SrajASSYM(CF_L2CACHE_WB_RANGE, offsetof(struct cpu_functions, cf_l2cache_wb_range));
100129198ScognetASSYM(CF_IDCACHE_WBINV_ALL, offsetof(struct cpu_functions, cf_idcache_wbinv_all));
101183838SrajASSYM(CF_L2CACHE_WBINV_ALL, offsetof(struct cpu_functions, cf_l2cache_wbinv_all));
102129198ScognetASSYM(CF_TLB_FLUSHID_SE, offsetof(struct cpu_functions, cf_tlb_flushID_SE));
103135651ScognetASSYM(CF_ICACHE_SYNC, offsetof(struct cpu_functions, cf_icache_sync_all));
104129198Scognet
105129198ScognetASSYM(V_TRAP, offsetof(struct vmmeter, v_trap));
106129198ScognetASSYM(V_SOFT, offsetof(struct vmmeter, v_soft));
107129198ScognetASSYM(V_INTR, offsetof(struct vmmeter, v_intr));
108129198Scognet
109129198ScognetASSYM(TD_PCB, offsetof(struct thread, td_pcb));
110129198ScognetASSYM(TD_FLAGS, offsetof(struct thread, td_flags));
111129198ScognetASSYM(TD_PROC, offsetof(struct thread, td_proc));
112129198ScognetASSYM(TD_FRAME, offsetof(struct thread, td_frame));
113142570ScognetASSYM(TD_MD, offsetof(struct thread, td_md));
114171788ScognetASSYM(TD_LOCK, offsetof(struct thread, td_lock));
115142570ScognetASSYM(MD_TP, offsetof(struct mdthread, md_tp));
116188540ScognetASSYM(MD_RAS_START, offsetof(struct mdthread, md_ras_start));
117188540ScognetASSYM(MD_RAS_END, offsetof(struct mdthread, md_ras_end));
118129198Scognet
119129198ScognetASSYM(TF_R0, offsetof(struct trapframe, tf_r0));
120129198ScognetASSYM(TF_R1, offsetof(struct trapframe, tf_r1));
121129198ScognetASSYM(TF_PC, offsetof(struct trapframe, tf_pc));
122129198ScognetASSYM(P_PID, offsetof(struct proc, p_pid));
123129198ScognetASSYM(P_FLAG, offsetof(struct proc, p_flag));
124129198Scognet
125262903SianASSYM(SIGF_UC, offsetof(struct sigframe, sf_uc));
126262903Sian
127239268Sgonzo#ifdef ARM_TP_ADDRESS
128142570ScognetASSYM(ARM_TP_ADDRESS, ARM_TP_ADDRESS);
129175982SrajASSYM(ARM_RAS_START, ARM_RAS_START);
130175982SrajASSYM(ARM_RAS_END, ARM_RAS_END);
131239268Sgonzo#endif
132239268Sgonzo
133254461Sandrew#ifdef VFP
134239268SgonzoASSYM(PCB_VFPSTATE, offsetof(struct pcb, pcb_vfpstate));
135239268Sgonzo
136239268SgonzoASSYM(PC_CPU, offsetof(struct pcpu, pc_cpu));
137239268Sgonzo
138239268SgonzoASSYM(PC_CURPMAP, offsetof(struct pcpu, pc_curpmap));
139239268Sgonzo#endif
140239268Sgonzo
141150996ScognetASSYM(PAGE_SIZE, PAGE_SIZE);
142129198ScognetASSYM(PMAP_DOMAIN_KERNEL, PMAP_DOMAIN_KERNEL);
143135651Scognet#ifdef PMAP_INCLUDE_PTE_SYNC
144135651ScognetASSYM(PMAP_INCLUDE_PTE_SYNC, 1);
145135651Scognet#endif
146129198ScognetASSYM(TDF_ASTPENDING, TDF_ASTPENDING);
147135651ScognetASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED);
148129198ScognetASSYM(P_TRACED, P_TRACED);
149129198ScognetASSYM(P_SIGEVENT, P_SIGEVENT);
150129198ScognetASSYM(P_PROFIL, P_PROFIL);
151129198ScognetASSYM(TRAPFRAMESIZE, sizeof(struct trapframe));
152137629Scognet
153137629ScognetASSYM(MAXCOMLEN, MAXCOMLEN);
154276395SianASSYM(MAXCPU, MAXCPU);
155280712SianASSYM(_NCPUWORDS, _NCPUWORDS);
156137629ScognetASSYM(NIRQ, NIRQ);
157261415ScognetASSYM(PCPU_SIZE, sizeof(struct pcpu));
158280712SianASSYM(P_VMSPACE, offsetof(struct proc, p_vmspace));
159280712SianASSYM(VM_PMAP, offsetof(struct vmspace, vm_pmap));
160280712SianASSYM(PM_ACTIVE, offsetof(struct pmap, pm_active));
161280712SianASSYM(PC_CPUID, offsetof(struct pcpu, pc_cpuid));
162279811Sian
163279811SianASSYM(DCACHE_LINE_SIZE, offsetof(struct cpuinfo, dcache_line_size));
164279811SianASSYM(DCACHE_LINE_MASK, offsetof(struct cpuinfo, dcache_line_mask));
165279811SianASSYM(ICACHE_LINE_SIZE, offsetof(struct cpuinfo, icache_line_size));
166279811SianASSYM(ICACHE_LINE_MASK, offsetof(struct cpuinfo, icache_line_mask));
167