]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/arm/arm/genassym.c
ARM: Replace only once used cpu_icache_sync_all() by ranged equivalent.
[FreeBSD/FreeBSD.git] / sys / arm / arm / genassym.c
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$");
30 #include <sys/param.h>
31 #include <sys/systm.h>
32 #include <sys/assym.h>
33 #include <sys/proc.h>
34 #include <sys/mbuf.h>
35 #include <sys/vmmeter.h>
36 #include <sys/bus.h>
37 #include <vm/vm.h>
38 #include <vm/vm_param.h>
39 #include <vm/pmap.h>
40 #include <vm/vm_map.h>
41
42 #include <machine/acle-compat.h>
43 #include <machine/vmparam.h>
44 #include <machine/armreg.h>
45 #include <machine/frame.h>
46 #include <machine/pcb.h>
47 #include <machine/cpu.h>
48 #include <machine/cpu-v6.h>
49 #include <machine/proc.h>
50 #include <machine/cpufunc.h>
51 #include <machine/cpuinfo.h>
52 #include <machine/intr.h>
53 #include <machine/sysarch.h>
54
55 #include <netinet/in.h>
56 #include <netinet/in_systm.h>
57 #include <netinet/ip.h>
58 #include <netinet/ip6.h>
59 #include <netinet/ip_var.h>
60
61 ASSYM(KERNBASE, KERNBASE);
62 ASSYM(PCB_NOALIGNFLT, PCB_NOALIGNFLT);
63 #if __ARM_ARCH >= 6
64 ASSYM(CPU_ASID_KERNEL,CPU_ASID_KERNEL);
65 #endif
66 ASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault));
67 #if __ARM_ARCH < 6
68 ASSYM(PCB_DACR, offsetof(struct pcb, pcb_dacr));
69 #endif
70 ASSYM(PCB_FLAGS, offsetof(struct pcb, pcb_flags));
71 ASSYM(PCB_PAGEDIR, offsetof(struct pcb, pcb_pagedir));
72 #if __ARM_ARCH < 6
73 ASSYM(PCB_L1VEC, offsetof(struct pcb, pcb_l1vec));
74 ASSYM(PCB_PL1VEC, offsetof(struct pcb, pcb_pl1vec));
75 #endif
76 ASSYM(PCB_R4, offsetof(struct pcb, pcb_regs.sf_r4));
77 ASSYM(PCB_R5, offsetof(struct pcb, pcb_regs.sf_r5));
78 ASSYM(PCB_R6, offsetof(struct pcb, pcb_regs.sf_r6));
79 ASSYM(PCB_R7, offsetof(struct pcb, pcb_regs.sf_r7));
80 ASSYM(PCB_R8, offsetof(struct pcb, pcb_regs.sf_r8));
81 ASSYM(PCB_R9, offsetof(struct pcb, pcb_regs.sf_r9));
82 ASSYM(PCB_R10, offsetof(struct pcb, pcb_regs.sf_r10));
83 ASSYM(PCB_R11, offsetof(struct pcb, pcb_regs.sf_r11));
84 ASSYM(PCB_R12, offsetof(struct pcb, pcb_regs.sf_r12));
85 ASSYM(PCB_SP, offsetof(struct pcb, pcb_regs.sf_sp));
86 ASSYM(PCB_LR, offsetof(struct pcb, pcb_regs.sf_lr));
87 ASSYM(PCB_PC, offsetof(struct pcb, pcb_regs.sf_pc));
88
89 ASSYM(PC_CURPCB, offsetof(struct pcpu, pc_curpcb));
90 ASSYM(PC_CURTHREAD, offsetof(struct pcpu, pc_curthread));
91 ASSYM(M_LEN, offsetof(struct mbuf, m_len));
92 ASSYM(M_DATA, offsetof(struct mbuf, m_data));
93 ASSYM(M_NEXT, offsetof(struct mbuf, m_next));
94 ASSYM(IP_SRC, offsetof(struct ip, ip_src));
95 ASSYM(IP_DST, offsetof(struct ip, ip_dst));
96 ASSYM(CF_SETTTB, offsetof(struct cpu_functions, cf_setttb));
97 ASSYM(CF_CONTROL, offsetof(struct cpu_functions, cf_control));
98 ASSYM(CF_CONTEXT_SWITCH, offsetof(struct cpu_functions, cf_context_switch));
99 ASSYM(CF_DCACHE_WB_RANGE, offsetof(struct cpu_functions, cf_dcache_wb_range));
100 ASSYM(CF_L2CACHE_WB_RANGE, offsetof(struct cpu_functions, cf_l2cache_wb_range));
101 ASSYM(CF_IDCACHE_WBINV_ALL, offsetof(struct cpu_functions, cf_idcache_wbinv_all));
102 ASSYM(CF_L2CACHE_WBINV_ALL, offsetof(struct cpu_functions, cf_l2cache_wbinv_all));
103 ASSYM(CF_TLB_FLUSHID_SE, offsetof(struct cpu_functions, cf_tlb_flushID_SE));
104
105 ASSYM(V_TRAP, offsetof(struct vmmeter, v_trap));
106 ASSYM(V_SOFT, offsetof(struct vmmeter, v_soft));
107 ASSYM(V_INTR, offsetof(struct vmmeter, v_intr));
108
109 ASSYM(TD_PCB, offsetof(struct thread, td_pcb));
110 ASSYM(TD_FLAGS, offsetof(struct thread, td_flags));
111 ASSYM(TD_PROC, offsetof(struct thread, td_proc));
112 ASSYM(TD_FRAME, offsetof(struct thread, td_frame));
113 ASSYM(TD_MD, offsetof(struct thread, td_md));
114 ASSYM(TD_LOCK, offsetof(struct thread, td_lock));
115 ASSYM(MD_TP, offsetof(struct mdthread, md_tp));
116 ASSYM(MD_RAS_START, offsetof(struct mdthread, md_ras_start));
117 ASSYM(MD_RAS_END, offsetof(struct mdthread, md_ras_end));
118
119 ASSYM(TF_SPSR, offsetof(struct trapframe, tf_spsr));
120 ASSYM(TF_R0, offsetof(struct trapframe, tf_r0));
121 ASSYM(TF_R1, offsetof(struct trapframe, tf_r1));
122 ASSYM(TF_PC, offsetof(struct trapframe, tf_pc));
123 ASSYM(P_PID, offsetof(struct proc, p_pid));
124 ASSYM(P_FLAG, offsetof(struct proc, p_flag));
125
126 ASSYM(SIGF_UC, offsetof(struct sigframe, sf_uc));
127
128 #if __ARM_ARCH < 6
129 ASSYM(ARM_TP_ADDRESS, ARM_TP_ADDRESS);
130 ASSYM(ARM_RAS_START, ARM_RAS_START);
131 ASSYM(ARM_RAS_END, ARM_RAS_END);
132 #endif
133
134 #ifdef VFP
135 ASSYM(PCB_VFPSTATE, offsetof(struct pcb, pcb_vfpstate));
136 #endif
137
138 #if __ARM_ARCH >= 6
139 ASSYM(PC_CURPMAP, offsetof(struct pcpu, pc_curpmap));
140 #endif
141
142 ASSYM(PAGE_SIZE, PAGE_SIZE);
143 ASSYM(PMAP_DOMAIN_KERNEL, PMAP_DOMAIN_KERNEL);
144 #ifdef PMAP_INCLUDE_PTE_SYNC
145 ASSYM(PMAP_INCLUDE_PTE_SYNC, 1);
146 #endif
147 ASSYM(TDF_ASTPENDING, TDF_ASTPENDING);
148 ASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED);
149 ASSYM(P_TRACED, P_TRACED);
150 ASSYM(P_SIGEVENT, P_SIGEVENT);
151 ASSYM(P_PROFIL, P_PROFIL);
152 ASSYM(TRAPFRAMESIZE, sizeof(struct trapframe));
153
154 ASSYM(MAXCOMLEN, MAXCOMLEN);
155 ASSYM(MAXCPU, MAXCPU);
156 ASSYM(_NCPUWORDS, _NCPUWORDS);
157 ASSYM(NIRQ, NIRQ);
158 ASSYM(PCPU_SIZE, sizeof(struct pcpu));
159 ASSYM(P_VMSPACE, offsetof(struct proc, p_vmspace));
160 ASSYM(VM_PMAP, offsetof(struct vmspace, vm_pmap));
161 ASSYM(PM_ACTIVE, offsetof(struct pmap, pm_active));
162 ASSYM(PC_CPUID, offsetof(struct pcpu, pc_cpuid));
163 ASSYM(VM_MAXUSER_ADDRESS, VM_MAXUSER_ADDRESS);
164
165 ASSYM(DCACHE_LINE_SIZE, offsetof(struct cpuinfo, dcache_line_size));
166 ASSYM(DCACHE_LINE_MASK, offsetof(struct cpuinfo, dcache_line_mask));
167 ASSYM(ICACHE_LINE_SIZE, offsetof(struct cpuinfo, icache_line_size));
168 ASSYM(ICACHE_LINE_MASK, offsetof(struct cpuinfo, icache_line_mask));