xref: /titanic_51/usr/src/uts/sun4v/ml/mach_offsets.in (revision 8d8453de6847166cd4079123d746fa7e23023bca)
1\
2\ CDDL HEADER START
3\
4\ The contents of this file are subject to the terms of the
5\ Common Development and Distribution License (the "License").
6\ You may not use this file except in compliance with the License.
7\
8\ You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9\ or http://www.opensolaris.org/os/licensing.
10\ See the License for the specific language governing permissions
11\ and limitations under the License.
12\
13\ When distributing Covered Code, include this CDDL HEADER in each
14\ file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15\ If applicable, add the following below this CDDL HEADER, with the
16\ fields enclosed by brackets "[]" replaced with your own identifying
17\ information: Portions Copyright [yyyy] [name of copyright owner]
18\
19\ CDDL HEADER END
20\
21\ Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
22\ Use is subject to license terms.
23\
24\ offsets.in: input file to produce assym.h using the stabs program
25\
26\
27\ Guidelines:
28\
29\ A blank line is required between structure/union/intrinsic names.
30\
31\ The general form is:
32\
33\	name size_define [shift_define]
34\		[member_name [offset_define]]
35\	{blank line}
36\
37\ If no individual member_name's are specified then all members are processed.
38\ If offset_define is not specified then the member_name is
39\ converted to all caps and used instead.  If the size of an item is
40\ a power of two then an optional shift count may be output using
41\ shift_define as the name but only if shift_define was specified.
42\
43\ Arrays cause stabs to automatically output the per-array-item increment
44\ in addition to the base address:
45\
46\	 foo FOO_SIZE
47\		array	FOO_ARRAY
48\
49\ results in:
50\
51\	#define	FOO_ARRAY	0x0
52\	#define	FOO_ARRAY_INCR	0x4
53\
54\ which allows \#define's to be used to specify array items:
55\
56\	#define	FOO_0	(FOO_ARRAY + (0 * FOO_ARRAY_INCR))
57\	#define	FOO_1	(FOO_ARRAY + (1 * FOO_ARRAY_INCR))
58\	...
59\	#define	FOO_n	(FOO_ARRAY + (n * FOO_ARRAY_INCR))
60\
61\ There are several examples below (search for _INCR).
62\
63\ There is currently no manner in which to identify "anonymous"
64\ structures or unions so if they are to be used in assembly code
65\ they must be given names.
66\
67\ When specifying the offsets of nested structures/unions each nested
68\ structure or union must be listed separately then use the
69\ "\#define" escapes to add the offsets from the base structure/union
70\ and all of the nested structures/unions together.  See the many
71\ examples already in this file.
72
73#ifndef	_GENASSYM
74#define	_GENASSYM
75#endif
76
77#include <vm/hat_sfmmu.h>
78#include <sys/traptrace.h>
79#include <sys/lpad.h>
80
81machcpu
82	intrstat	MCPU_INTRSTAT
83	pil_high_start	MCPU_PIL_HIGH_START
84	mpcb_pa	MCPU_MPCB_PA
85	kwbuf_full	MCPU_KWBUF_FULL
86	kwbuf_sp	MCPU_KWBUF_SP
87	kwbuf	MCPU_KWBUF
88	cpu_q_base_pa	MCPU_CPU_Q_BASE
89	cpu_q_size	MCPU_CPU_Q_SIZE
90	dev_q_base_pa	MCPU_DEV_Q_BASE
91	dev_q_size	MCPU_DEV_Q_SIZE
92	mondo_data	MCPU_MONDO_DATA
93	mondo_data_ra	MCPU_MONDO_DATA_RA
94	cpu_rq_va		MCPU_RQ_BASE_VA
95	cpu_rq_base_pa		MCPU_RQ_BASE
96	cpu_rq_size		MCPU_RQ_SIZE
97	cpu_nrq_va		MCPU_NRQ_BASE_VA
98	cpu_nrq_base_pa		MCPU_NRQ_BASE
99	cpu_nrq_size		MCPU_NRQ_SIZE
100	cpu_tstat_flags		MCPU_TSTAT_FLAGS
101	cpu_nre_error		MCPU_NRE_ERROR
102
103\#define	CPU_MPCB_PA	(CPU_MCPU + MCPU_MPCB_PA)
104\#define	CPU_KWBUF_FULL	(CPU_MCPU + MCPU_KWBUF_FULL)
105\#define	CPU_KWBUF_SP	(CPU_MCPU + MCPU_KWBUF_SP)
106\#define	CPU_KWBUF	(CPU_MCPU + MCPU_KWBUF)
107\#define	CPU_Q_BASE	(CPU_MCPU + MCPU_CPU_Q_BASE)
108\#define	CPU_Q_SIZE	(CPU_MCPU + MCPU_CPU_Q_SIZE)
109\#define	DEV_Q_BASE	(CPU_MCPU + MCPU_DEV_Q_BASE)
110\#define	DEV_Q_SIZE	(CPU_MCPU + MCPU_DEV_Q_SIZE)
111\#define	CPU_RQ_BASE_VA_OFF	(CPU_MCPU + MCPU_RQ_BASE_VA)
112\#define	CPU_RQ_BASE_OFF		(CPU_MCPU + MCPU_RQ_BASE)
113\#define	CPU_RQ_SIZE_OFF		(CPU_MCPU + MCPU_RQ_SIZE)
114\#define	CPU_NRQ_BASE_VA_OFF	(CPU_MCPU + MCPU_NRQ_BASE_VA)
115\#define	CPU_NRQ_BASE_OFF	(CPU_MCPU + MCPU_NRQ_BASE)
116\#define	CPU_NRQ_SIZE_OFF	(CPU_MCPU + MCPU_NRQ_SIZE)
117\#define	CPU_TSTAT_FLAGS		(CPU_MCPU + MCPU_TSTAT_FLAGS)
118
119trap_trace_record	TRAP_ENT_SIZE
120	tt_gl		TRAP_ENT_GL
121	tt_tl		TRAP_ENT_TL
122	tt_tt		TRAP_ENT_TT
123	tt_tpc		TRAP_ENT_TPC
124	tt_tstate	TRAP_ENT_TSTATE
125	tt_tick		TRAP_ENT_TICK
126	tt_sp		TRAP_ENT_SP
127	tt_tr		TRAP_ENT_TR
128	tt_f1		TRAP_ENT_F1
129	tt_f2		TRAP_ENT_F2
130	tt_f3		TRAP_ENT_F3
131	tt_f4		TRAP_ENT_F4
132
133htrap_trace_record	HTRAP_ENT_SIZE
134
135hat	HAT_SIZE
136	sfmmu_cpusran
137	sfmmu_tsb
138	sfmmu_ismblkpa
139	sfmmu_tteflags
140	sfmmu_rtteflags
141	sfmmu_srdp
142	sfmmu_region_map.h_rmap_s.hmeregion_map	SFMMU_HMERMAP
143	sfmmu_scdp
144	sfmmu_hvblock
145	sfmmu_cext
146	sfmmu_ctx_lock
147	sfmmu_ctxs
148
149sf_scd SCD_SIZE
150	scd_sfmmup
151	scd_region_map.h_rmap_s.hmeregion_map	SCD_HMERMAP
152
153sfmmu_global_stat HATSTAT_SIZE
154	sf_pagefaults		HATSTAT_PAGEFAULT
155	sf_uhash_searches	HATSTAT_UHASH_SEARCH
156	sf_uhash_links		HATSTAT_UHASH_LINKS
157	sf_khash_searches	HATSTAT_KHASH_SEARCH
158	sf_khash_links		HATSTAT_KHASH_LINKS
159
160sf_hment	SFHME_SIZE	SFHME_SHIFT
161	hme_tte		SFHME_TTE
162
163tsbmiss		TSBMISS_SIZE
164	ksfmmup		TSBMISS_KHATID
165	usfmmup		TSBMISS_UHATID
166	usrdp		TSBMISS_SHARED_UHATID
167	tsbptr		TSBMISS_TSBPTR
168	tsbptr4m	TSBMISS_TSBPTR4M
169	tsbscdptr	TSBMISS_TSBSCDPTR
170	tsbscdptr4m	TSBMISS_TSBSCDPTR4M
171	ismblkpa	TSBMISS_ISMBLKPA
172	khashstart	TSBMISS_KHASHSTART
173	uhashstart	TSBMISS_UHASHSTART
174	khashsz		TSBMISS_KHASHSZ
175	uhashsz		TSBMISS_UHASHSZ
176	uhat_tteflags	TSBMISS_UTTEFLAGS
177	uhat_rtteflags	TSBMISS_URTTEFLAGS
178	utsb_misses	TSBMISS_UTSBMISS
179	ktsb_misses	TSBMISS_KTSBMISS
180	uprot_traps	TSBMISS_UPROTS
181	kprot_traps	TSBMISS_KPROTS
182	scratch		TSBMISS_SCRATCH
183	shmermap	TSBMISS_SHMERMAP
184	scd_shmermap	TSBMISS_SCDSHMERMAP
185
186\#define	TSB_TAGACC	(0 * TSBMISS_SCRATCH_INCR)
187\#define	TSBMISS_HMEBP	(1 * TSBMISS_SCRATCH_INCR)
188\#define	TSBMISS_HATID	(2 * TSBMISS_SCRATCH_INCR)
189
190kpmtsbm		KPMTSBM_SIZE KPMTSBM_SHIFT
191	vbase		KPMTSBM_VBASE
192	vend		KPMTSBM_VEND
193	flags		KPMTSBM_FLAGS
194	sz_shift	KPMTSBM_SZSHIFT
195	kpmp_shift	KPMTSBM_KPMPSHIFT
196	kpmp2pshft	KPMTSBM_KPMP2PSHFT
197	kpmp_table_sz	KPMTSBM_KPMPTABLESZ
198	kpmp_tablepa	KPMTSBM_KPMPTABLEPA
199	msegphashpa	KPMTSBM_MSEGPHASHPA
200	tsbptr		KPMTSBM_TSBPTR
201	kpm_dtlb_misses	KPMTSBM_DTLBMISS
202	kpm_tsb_misses	KPMTSBM_TSBMISS
203
204kpm_page	KPMPAGE_SIZE KPMPAGE_SHIFT
205	kp_refcnt	KPMPAGE_REFCNT
206	kp_refcnta	KPMPAGE_REFCNTA
207	kp_refcntc	KPMPAGE_REFCNTC
208	kp_refcnts	KPMPAGE_REFCNTS
209
210kpm_hlk		KPMHLK_SIZE KPMHLK_SHIFT
211	khl_mutex	KPMHLK_MUTEX
212	khl_lock	KPMHLK_LOCK
213
214kpm_spage	KPMSPAGE_SIZE KPMSPAGE_SHIFT
215	kp_mapped_flag	KPMSPAGE_MAPPED
216
217kpm_shlk	KPMSHLK_SIZE KPMSHLK_SHIFT
218	kshl_lock	KPMSHLK_LOCK
219
220memseg		MEMSEG_SIZE
221	pages		MEMSEG_PAGES
222	epages		MEMSEG_EPAGES
223	pages_base	MEMSEG_PAGES_BASE
224	pages_end	MEMSEG_PAGES_END
225	next		MEMSEG_NEXT
226	lnext		MEMSEG_LNEXT
227	nextpa		MEMSEG_NEXTPA
228	pagespa		MEMSEG_PAGESPA
229	epagespa	MEMSEG_EPAGESPA
230	kpm_pbase	MEMSEG_KPM_PBASE
231	kpm_nkpmpgs	MEMSEG_KPM_NKPMPGS
232	mseg_un
233	kpm_pagespa	MEMSEG_KPM_PAGESPA
234
235\#define	MEMSEG_KPM_PAGES	(MSEG_UN)
236\#define	MEMSEG_KPM_SPAGES	(MSEG_UN)
237
238page		PAGE_SIZE
239	p_pagenum	PAGE_PAGENUM
240
241tsb_info	TSBINFO_SIZE
242	tsb_tte		TSBINFO_TTE
243	tsb_va		TSBINFO_VADDR
244	tsb_pa		TSBINFO_PADDR
245	tsb_szc		TSBINFO_SZCODE
246	tsb_next	TSBINFO_NEXTPTR
247
248hv_tsb_block
249	hv_tsb_info_pa
250	hv_tsb_info_cnt
251
252cpu_node	CPU_NODE_SIZE
253	nodeid
254	clock_freq
255	tick_nsec_scale
256	ecache_size	ECACHE_SIZE
257	ecache_linesize	ECACHE_LINESIZE
258	device_id	DEVICE_ID
259
260ptl1_regs
261	ptl1_trap_regs
262	ptl1_gregs
263	ptl1_tick
264	ptl1_dmmu_type
265	ptl1_dmmu_addr
266	ptl1_dmmu_ctx
267	ptl1_immu_type
268	ptl1_immu_addr
269	ptl1_immu_ctx
270	ptl1_rwindow
271	ptl1_softint
272	ptl1_pstate
273	ptl1_pil
274	ptl1_cwp
275	ptl1_wstate
276	ptl1_otherwin
277	ptl1_cleanwin
278	ptl1_cansave
279	ptl1_canrestore
280
281ptl1_gregs
282	ptl1_gl
283	ptl1_g1
284	ptl1_g2
285	ptl1_g3
286	ptl1_g4
287	ptl1_g5
288	ptl1_g6
289	ptl1_g7
290
291lpad_data
292	magic		LPAD_MAGIC
293	inuse		LPAD_INUSE
294	mmfsa_ra	LPAD_MMFSA_RA
295	pc		LPAD_PC
296	arg		LPAD_ARG
297	nmap		LPAD_NMAP
298	map		LPAD_MAP
299
300lpad_map	LPAD_MAP_SIZE
301	flags		LPAD_MAP_FLAGS
302	va		LPAD_MAP_VA
303	tte		LPAD_MAP_TTE
304