genassym.c revision 283336
1283441Sdchagin/*-
2283441Sdchagin * Copyright (c) 2004 Olivier Houchard
3283441Sdchagin * All rights reserved.
4283441Sdchagin *
5283441Sdchagin * Redistribution and use in source and binary forms, with or without
6283441Sdchagin * modification, are permitted provided that the following conditions
7283441Sdchagin * are met:
8283441Sdchagin * 1. Redistributions of source code must retain the above copyright
9283441Sdchagin *    notice, this list of conditions and the following disclaimer.
10283441Sdchagin * 2. Redistributions in binary form must reproduce the above copyright
11283441Sdchagin *    notice, this list of conditions and the following disclaimer in the
12283441Sdchagin *    documentation and/or other materials provided with the distribution.
13283441Sdchagin *
14283441Sdchagin * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15283441Sdchagin * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16283441Sdchagin * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17283441Sdchagin * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18283441Sdchagin * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19283441Sdchagin * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20283441Sdchagin * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21283441Sdchagin * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22283441Sdchagin * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23283441Sdchagin * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24283441Sdchagin * SUCH DAMAGE.
25283441Sdchagin *
26283441Sdchagin */
27283441Sdchagin
28283441Sdchagin#include <sys/cdefs.h>
29283441Sdchagin__FBSDID("$FreeBSD: stable/10/sys/arm/arm/genassym.c 283336 2015-05-23 23:05:31Z ian $");
30283441Sdchagin#include <sys/param.h>
31283441Sdchagin#include <sys/systm.h>
32283441Sdchagin#include <sys/assym.h>
33283441Sdchagin#include <sys/proc.h>
34283441Sdchagin#include <sys/mbuf.h>
35283441Sdchagin#include <sys/vmmeter.h>
36283441Sdchagin#include <sys/bus.h>
37283441Sdchagin#include <vm/vm.h>
38283441Sdchagin#include <vm/vm_param.h>
39283441Sdchagin#include <vm/pmap.h>
40283441Sdchagin#include <vm/vm_map.h>
41283441Sdchagin#include <machine/vmparam.h>
42283469Sdchagin#include <machine/armreg.h>
43283441Sdchagin#include <machine/frame.h>
44283441Sdchagin#include <machine/pcb.h>
45297296Sdchagin#include <machine/cpu.h>
46283441Sdchagin#include <machine/proc.h>
47283441Sdchagin#include <machine/cpufunc.h>
48283444Sdchagin#include <machine/cpuinfo.h>
49283441Sdchagin#include <machine/pte.h>
50283444Sdchagin#include <machine/intr.h>
51283441Sdchagin#include <machine/sysarch.h>
52283441Sdchagin
53283441Sdchagin#include <netinet/in.h>
54283441Sdchagin#include <netinet/in_systm.h>
55283441Sdchagin#include <netinet/ip.h>
56283441Sdchagin#include <netinet/ip6.h>
57283441Sdchagin#include <netinet/ip_var.h>
58283441Sdchagin
59283441SdchaginASSYM(KERNBASE, KERNBASE);
60283441SdchaginASSYM(PCB_NOALIGNFLT, PCB_NOALIGNFLT);
61283441SdchaginASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault));
62283441SdchaginASSYM(PCB_DACR, offsetof(struct pcb, pcb_dacr));
63283441SdchaginASSYM(PCB_FLAGS, offsetof(struct pcb, pcb_flags));
64283441SdchaginASSYM(PCB_PAGEDIR, offsetof(struct pcb, pcb_pagedir));
65283441SdchaginASSYM(PCB_L1VEC, offsetof(struct pcb, pcb_l1vec));
66283441SdchaginASSYM(PCB_PL1VEC, offsetof(struct pcb, pcb_pl1vec));
67283441SdchaginASSYM(PCB_R4, offsetof(struct pcb, pcb_regs.sf_r4));
68283441SdchaginASSYM(PCB_R5, offsetof(struct pcb, pcb_regs.sf_r5));
69283441SdchaginASSYM(PCB_R6, offsetof(struct pcb, pcb_regs.sf_r6));
70283441SdchaginASSYM(PCB_R7, offsetof(struct pcb, pcb_regs.sf_r7));
71283441SdchaginASSYM(PCB_R8, offsetof(struct pcb, pcb_regs.sf_r8));
72283441SdchaginASSYM(PCB_R9, offsetof(struct pcb, pcb_regs.sf_r9));
73283441SdchaginASSYM(PCB_R10, offsetof(struct pcb, pcb_regs.sf_r10));
74283441SdchaginASSYM(PCB_R11, offsetof(struct pcb, pcb_regs.sf_r11));
75283441SdchaginASSYM(PCB_R12, offsetof(struct pcb, pcb_regs.sf_r12));
76283441SdchaginASSYM(PCB_SP, offsetof(struct pcb, pcb_regs.sf_sp));
77283441SdchaginASSYM(PCB_LR, offsetof(struct pcb, pcb_regs.sf_lr));
78283441SdchaginASSYM(PCB_PC, offsetof(struct pcb, pcb_regs.sf_pc));
79283441Sdchagin
80283441SdchaginASSYM(PC_CURPCB, offsetof(struct pcpu, pc_curpcb));
81283441SdchaginASSYM(PC_CURTHREAD, offsetof(struct pcpu, pc_curthread));
82283441SdchaginASSYM(M_LEN, offsetof(struct mbuf, m_len));
83283441SdchaginASSYM(M_DATA, offsetof(struct mbuf, m_data));
84283441SdchaginASSYM(M_NEXT, offsetof(struct mbuf, m_next));
85283441SdchaginASSYM(IP_SRC, offsetof(struct ip, ip_src));
86283441SdchaginASSYM(IP_DST, offsetof(struct ip, ip_dst));
87283441SdchaginASSYM(CF_SETTTB, offsetof(struct cpu_functions, cf_setttb));
88283441SdchaginASSYM(CF_CONTROL, offsetof(struct cpu_functions, cf_control));
89283441SdchaginASSYM(CF_CONTEXT_SWITCH, offsetof(struct cpu_functions, cf_context_switch));
90283441SdchaginASSYM(CF_DCACHE_WB_RANGE, offsetof(struct cpu_functions, cf_dcache_wb_range));
91283441SdchaginASSYM(CF_L2CACHE_WB_RANGE, offsetof(struct cpu_functions, cf_l2cache_wb_range));
92283441SdchaginASSYM(CF_IDCACHE_WBINV_ALL, offsetof(struct cpu_functions, cf_idcache_wbinv_all));
93283441SdchaginASSYM(CF_L2CACHE_WBINV_ALL, offsetof(struct cpu_functions, cf_l2cache_wbinv_all));
94283441SdchaginASSYM(CF_TLB_FLUSHID_SE, offsetof(struct cpu_functions, cf_tlb_flushID_SE));
95283441SdchaginASSYM(CF_ICACHE_SYNC, offsetof(struct cpu_functions, cf_icache_sync_all));
96283441Sdchagin
97283441SdchaginASSYM(V_TRAP, offsetof(struct vmmeter, v_trap));
98283441SdchaginASSYM(V_SOFT, offsetof(struct vmmeter, v_soft));
99283441SdchaginASSYM(V_INTR, offsetof(struct vmmeter, v_intr));
100283441Sdchagin
101283441SdchaginASSYM(TD_PCB, offsetof(struct thread, td_pcb));
102283441SdchaginASSYM(TD_FLAGS, offsetof(struct thread, td_flags));
103283441SdchaginASSYM(TD_PROC, offsetof(struct thread, td_proc));
104283441SdchaginASSYM(TD_FRAME, offsetof(struct thread, td_frame));
105283441SdchaginASSYM(TD_MD, offsetof(struct thread, td_md));
106283441SdchaginASSYM(TD_LOCK, offsetof(struct thread, td_lock));
107283441SdchaginASSYM(MD_TP, offsetof(struct mdthread, md_tp));
108283441SdchaginASSYM(MD_RAS_START, offsetof(struct mdthread, md_ras_start));
109283441SdchaginASSYM(MD_RAS_END, offsetof(struct mdthread, md_ras_end));
110283441Sdchagin
111283441SdchaginASSYM(TF_R0, offsetof(struct trapframe, tf_r0));
112283441SdchaginASSYM(TF_R1, offsetof(struct trapframe, tf_r1));
113283441SdchaginASSYM(TF_PC, offsetof(struct trapframe, tf_pc));
114283441SdchaginASSYM(P_PID, offsetof(struct proc, p_pid));
115283441SdchaginASSYM(P_FLAG, offsetof(struct proc, p_flag));
116283441Sdchagin
117283441SdchaginASSYM(SIGF_UC, offsetof(struct sigframe, sf_uc));
118283441Sdchagin
119283441Sdchagin#ifdef ARM_TP_ADDRESS
120283441SdchaginASSYM(ARM_TP_ADDRESS, ARM_TP_ADDRESS);
121283444SdchaginASSYM(ARM_RAS_START, ARM_RAS_START);
122283444SdchaginASSYM(ARM_RAS_END, ARM_RAS_END);
123283441Sdchagin#endif
124283444Sdchagin
125283444Sdchagin#ifdef VFP
126283444SdchaginASSYM(PCB_VFPSTATE, offsetof(struct pcb, pcb_vfpstate));
127283444Sdchagin
128283444SdchaginASSYM(PC_CPU, offsetof(struct pcpu, pc_cpu));
129283444Sdchagin
130283444SdchaginASSYM(PC_CURPMAP, offsetof(struct pcpu, pc_curpmap));
131283444Sdchagin#endif
132283469Sdchagin
133283444SdchaginASSYM(PAGE_SIZE, PAGE_SIZE);
134283444SdchaginASSYM(PDESIZE, PDESIZE);
135283444SdchaginASSYM(PMAP_DOMAIN_KERNEL, PMAP_DOMAIN_KERNEL);
136283444Sdchagin#ifdef PMAP_INCLUDE_PTE_SYNC
137283444SdchaginASSYM(PMAP_INCLUDE_PTE_SYNC, 1);
138283444Sdchagin#endif
139283444SdchaginASSYM(TDF_ASTPENDING, TDF_ASTPENDING);
140283444SdchaginASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED);
141283444SdchaginASSYM(P_TRACED, P_TRACED);
142283444SdchaginASSYM(P_SIGEVENT, P_SIGEVENT);
143283444SdchaginASSYM(P_PROFIL, P_PROFIL);
144283444SdchaginASSYM(TRAPFRAMESIZE, sizeof(struct trapframe));
145283444Sdchagin
146283469SdchaginASSYM(MAXCOMLEN, MAXCOMLEN);
147283444SdchaginASSYM(MAXCPU, MAXCPU);
148283444SdchaginASSYM(NIRQ, NIRQ);
149283444SdchaginASSYM(PCPU_SIZE, sizeof(struct pcpu));
150283444Sdchagin
151283444SdchaginASSYM(DCACHE_LINE_SIZE, offsetof(struct cpuinfo, dcache_line_size));
152283444SdchaginASSYM(DCACHE_LINE_MASK, offsetof(struct cpuinfo, dcache_line_mask));
153283444SdchaginASSYM(ICACHE_LINE_SIZE, offsetof(struct cpuinfo, icache_line_size));
154283444SdchaginASSYM(ICACHE_LINE_MASK, offsetof(struct cpuinfo, icache_line_mask));
155283444Sdchagin