genassym.c revision 261415
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 261415 2014-02-02 20:58:23Z cognet $");
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>
46129198Scognet#include <machine/proc.h>
47129198Scognet#include <machine/cpufunc.h>
48129198Scognet#include <machine/pte.h>
49137629Scognet#include <machine/intr.h>
50142570Scognet#include <machine/sysarch.h>
51142570Scognet
52129198Scognet#include <netinet/in.h>
53129198Scognet#include <netinet/in_systm.h>
54129198Scognet#include <netinet/ip.h>
55129198Scognet#include <netinet/ip6.h>
56129198Scognet#include <netinet/ip_var.h>
57129198Scognet
58129198ScognetASSYM(KERNBASE, KERNBASE);
59129198ScognetASSYM(PCB_NOALIGNFLT, PCB_NOALIGNFLT);
60129198ScognetASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault));
61129198ScognetASSYM(PCB_DACR, offsetof(struct pcb, pcb_dacr));
62129198ScognetASSYM(PCB_FLAGS, offsetof(struct pcb, pcb_flags));
63129198ScognetASSYM(PCB_UND_SP, offsetof(struct pcb, un_32.pcb32_und_sp));
64129198ScognetASSYM(PCB_PAGEDIR, offsetof(struct pcb, pcb_pagedir));
65129198ScognetASSYM(PCB_L1VEC, offsetof(struct pcb, pcb_l1vec));
66129198ScognetASSYM(PCB_PL1VEC, offsetof(struct pcb, pcb_pl1vec));
67129198ScognetASSYM(PCB_R8, offsetof(struct pcb, un_32.pcb32_r8));
68129198ScognetASSYM(PCB_R9, offsetof(struct pcb, un_32.pcb32_r9));
69129198ScognetASSYM(PCB_R10, offsetof(struct pcb, un_32.pcb32_r10));
70129198ScognetASSYM(PCB_R11, offsetof(struct pcb, un_32.pcb32_r11));
71129198ScognetASSYM(PCB_R12, offsetof(struct pcb, un_32.pcb32_r12));
72129198ScognetASSYM(PCB_PC, offsetof(struct pcb, un_32.pcb32_pc));
73129198ScognetASSYM(PCB_SP, offsetof(struct pcb, un_32.pcb32_sp));
74129198Scognet
75129198ScognetASSYM(PC_CURPCB, offsetof(struct pcpu, pc_curpcb));
76129198ScognetASSYM(PC_CURTHREAD, offsetof(struct pcpu, pc_curthread));
77129198ScognetASSYM(M_LEN, offsetof(struct mbuf, m_len));
78129198ScognetASSYM(M_DATA, offsetof(struct mbuf, m_data));
79129198ScognetASSYM(M_NEXT, offsetof(struct mbuf, m_next));
80129198ScognetASSYM(IP_SRC, offsetof(struct ip, ip_src));
81129198ScognetASSYM(IP_DST, offsetof(struct ip, ip_dst));
82129198ScognetASSYM(CF_SETTTB, offsetof(struct cpu_functions, cf_setttb));
83129198ScognetASSYM(CF_CONTROL, offsetof(struct cpu_functions, cf_control));
84129198ScognetASSYM(CF_CONTEXT_SWITCH, offsetof(struct cpu_functions, cf_context_switch));
85129198ScognetASSYM(CF_DCACHE_WB_RANGE, offsetof(struct cpu_functions, cf_dcache_wb_range));
86183838SrajASSYM(CF_L2CACHE_WB_RANGE, offsetof(struct cpu_functions, cf_l2cache_wb_range));
87129198ScognetASSYM(CF_IDCACHE_WBINV_ALL, offsetof(struct cpu_functions, cf_idcache_wbinv_all));
88183838SrajASSYM(CF_L2CACHE_WBINV_ALL, offsetof(struct cpu_functions, cf_l2cache_wbinv_all));
89129198ScognetASSYM(CF_TLB_FLUSHID_SE, offsetof(struct cpu_functions, cf_tlb_flushID_SE));
90135651ScognetASSYM(CF_ICACHE_SYNC, offsetof(struct cpu_functions, cf_icache_sync_all));
91129198Scognet
92129198ScognetASSYM(V_TRAP, offsetof(struct vmmeter, v_trap));
93129198ScognetASSYM(V_SOFT, offsetof(struct vmmeter, v_soft));
94129198ScognetASSYM(V_INTR, offsetof(struct vmmeter, v_intr));
95129198Scognet
96129198ScognetASSYM(TD_PCB, offsetof(struct thread, td_pcb));
97129198ScognetASSYM(TD_FLAGS, offsetof(struct thread, td_flags));
98129198ScognetASSYM(TD_PROC, offsetof(struct thread, td_proc));
99129198ScognetASSYM(TD_FRAME, offsetof(struct thread, td_frame));
100142570ScognetASSYM(TD_MD, offsetof(struct thread, td_md));
101171788ScognetASSYM(TD_LOCK, offsetof(struct thread, td_lock));
102142570ScognetASSYM(MD_TP, offsetof(struct mdthread, md_tp));
103188540ScognetASSYM(MD_RAS_START, offsetof(struct mdthread, md_ras_start));
104188540ScognetASSYM(MD_RAS_END, offsetof(struct mdthread, md_ras_end));
105129198Scognet
106129198ScognetASSYM(TF_R0, offsetof(struct trapframe, tf_r0));
107129198ScognetASSYM(TF_R1, offsetof(struct trapframe, tf_r1));
108129198ScognetASSYM(TF_PC, offsetof(struct trapframe, tf_pc));
109129198ScognetASSYM(P_PID, offsetof(struct proc, p_pid));
110129198ScognetASSYM(P_FLAG, offsetof(struct proc, p_flag));
111129198Scognet
112239268Sgonzo#ifdef ARM_TP_ADDRESS
113142570ScognetASSYM(ARM_TP_ADDRESS, ARM_TP_ADDRESS);
114175982SrajASSYM(ARM_RAS_START, ARM_RAS_START);
115175982SrajASSYM(ARM_RAS_END, ARM_RAS_END);
116239268Sgonzo#endif
117239268Sgonzo
118254461Sandrew#ifdef VFP
119239268SgonzoASSYM(PCB_VFPSTATE, offsetof(struct pcb, pcb_vfpstate));
120239268SgonzoASSYM(PCB_VFPCPU, offsetof(struct pcb, pcb_vfpcpu));
121239268Sgonzo
122239268SgonzoASSYM(PC_VFPCTHREAD, offsetof(struct pcpu, pc_vfpcthread));
123239268SgonzoASSYM(PC_CPU, offsetof(struct pcpu, pc_cpu));
124239268Sgonzo
125239268SgonzoASSYM(PC_CURPMAP, offsetof(struct pcpu, pc_curpmap));
126239268Sgonzo#endif
127239268Sgonzo
128150996ScognetASSYM(PAGE_SIZE, PAGE_SIZE);
129129198ScognetASSYM(PDESIZE, PDESIZE);
130129198ScognetASSYM(PMAP_DOMAIN_KERNEL, PMAP_DOMAIN_KERNEL);
131135651Scognet#ifdef PMAP_INCLUDE_PTE_SYNC
132135651ScognetASSYM(PMAP_INCLUDE_PTE_SYNC, 1);
133135651Scognet#endif
134129198ScognetASSYM(TDF_ASTPENDING, TDF_ASTPENDING);
135135651ScognetASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED);
136129198ScognetASSYM(P_TRACED, P_TRACED);
137129198ScognetASSYM(P_SIGEVENT, P_SIGEVENT);
138129198ScognetASSYM(P_PROFIL, P_PROFIL);
139129198ScognetASSYM(TRAPFRAMESIZE, sizeof(struct trapframe));
140137629Scognet
141137629ScognetASSYM(MAXCOMLEN, MAXCOMLEN);
142137629ScognetASSYM(NIRQ, NIRQ);
143261415ScognetASSYM(PCPU_SIZE, sizeof(struct pcpu));
144