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