xref: /titanic_50/usr/src/uts/sun4v/ml/mach_offsets.in (revision dbed73cbda2229fd1aa6dc5743993cae7f0a7ee9)
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 2009 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
102\#define	CPU_MPCB_PA	(CPU_MCPU + MCPU_MPCB_PA)
103\#define	CPU_KWBUF_FULL	(CPU_MCPU + MCPU_KWBUF_FULL)
104\#define	CPU_KWBUF_SP	(CPU_MCPU + MCPU_KWBUF_SP)
105\#define	CPU_KWBUF	(CPU_MCPU + MCPU_KWBUF)
106\#define	CPU_Q_BASE	(CPU_MCPU + MCPU_CPU_Q_BASE)
107\#define	CPU_Q_SIZE	(CPU_MCPU + MCPU_CPU_Q_SIZE)
108\#define	DEV_Q_BASE	(CPU_MCPU + MCPU_DEV_Q_BASE)
109\#define	DEV_Q_SIZE	(CPU_MCPU + MCPU_DEV_Q_SIZE)
110\#define	CPU_RQ_BASE_VA_OFF	(CPU_MCPU + MCPU_RQ_BASE_VA)
111\#define	CPU_RQ_BASE_OFF		(CPU_MCPU + MCPU_RQ_BASE)
112\#define	CPU_RQ_SIZE_OFF		(CPU_MCPU + MCPU_RQ_SIZE)
113\#define	CPU_NRQ_BASE_VA_OFF	(CPU_MCPU + MCPU_NRQ_BASE_VA)
114\#define	CPU_NRQ_BASE_OFF	(CPU_MCPU + MCPU_NRQ_BASE)
115\#define	CPU_NRQ_SIZE_OFF	(CPU_MCPU + MCPU_NRQ_SIZE)
116\#define	CPU_TSTAT_FLAGS		(CPU_MCPU + MCPU_TSTAT_FLAGS)
117
118trap_trace_record	TRAP_ENT_SIZE
119	tt_gl		TRAP_ENT_GL
120	tt_tl		TRAP_ENT_TL
121	tt_tt		TRAP_ENT_TT
122	tt_tpc		TRAP_ENT_TPC
123	tt_tstate	TRAP_ENT_TSTATE
124	tt_tick		TRAP_ENT_TICK
125	tt_sp		TRAP_ENT_SP
126	tt_tr		TRAP_ENT_TR
127	tt_f1		TRAP_ENT_F1
128	tt_f2		TRAP_ENT_F2
129	tt_f3		TRAP_ENT_F3
130	tt_f4		TRAP_ENT_F4
131
132htrap_trace_record	HTRAP_ENT_SIZE
133
134hat	HAT_SIZE
135	sfmmu_cpusran
136	sfmmu_tsb
137	sfmmu_ismblkpa
138	sfmmu_tteflags
139	sfmmu_rtteflags
140	sfmmu_srdp
141	sfmmu_region_map.h_rmap_s.hmeregion_map	SFMMU_HMERMAP
142	sfmmu_scdp
143	sfmmu_hvblock
144	sfmmu_cext
145	sfmmu_ctx_lock
146	sfmmu_ctxs
147
148sf_scd SCD_SIZE
149	scd_sfmmup
150	scd_region_map.h_rmap_s.hmeregion_map	SCD_HMERMAP
151
152sfmmu_global_stat HATSTAT_SIZE
153	sf_pagefaults		HATSTAT_PAGEFAULT
154	sf_uhash_searches	HATSTAT_UHASH_SEARCH
155	sf_uhash_links		HATSTAT_UHASH_LINKS
156	sf_khash_searches	HATSTAT_KHASH_SEARCH
157	sf_khash_links		HATSTAT_KHASH_LINKS
158
159sf_hment	SFHME_SIZE	SFHME_SHIFT
160	hme_tte		SFHME_TTE
161
162tsbmiss		TSBMISS_SIZE
163	ksfmmup		TSBMISS_KHATID
164	usfmmup		TSBMISS_UHATID
165	usrdp		TSBMISS_SHARED_UHATID
166	tsbptr		TSBMISS_TSBPTR
167	tsbptr4m	TSBMISS_TSBPTR4M
168	tsbscdptr	TSBMISS_TSBSCDPTR
169	tsbscdptr4m	TSBMISS_TSBSCDPTR4M
170	ismblkpa	TSBMISS_ISMBLKPA
171	khashstart	TSBMISS_KHASHSTART
172	uhashstart	TSBMISS_UHASHSTART
173	khashsz		TSBMISS_KHASHSZ
174	uhashsz		TSBMISS_UHASHSZ
175	uhat_tteflags	TSBMISS_UTTEFLAGS
176	uhat_rtteflags	TSBMISS_URTTEFLAGS
177	utsb_misses	TSBMISS_UTSBMISS
178	ktsb_misses	TSBMISS_KTSBMISS
179	uprot_traps	TSBMISS_UPROTS
180	kprot_traps	TSBMISS_KPROTS
181	scratch		TSBMISS_SCRATCH
182	shmermap	TSBMISS_SHMERMAP
183	scd_shmermap	TSBMISS_SCDSHMERMAP
184
185\#define	TSB_TAGACC	(0 * TSBMISS_SCRATCH_INCR)
186\#define	TSBMISS_HMEBP	(1 * TSBMISS_SCRATCH_INCR)
187\#define	TSBMISS_HATID	(2 * TSBMISS_SCRATCH_INCR)
188
189kpmtsbm		KPMTSBM_SIZE KPMTSBM_SHIFT
190	vbase		KPMTSBM_VBASE
191	vend		KPMTSBM_VEND
192	flags		KPMTSBM_FLAGS
193	sz_shift	KPMTSBM_SZSHIFT
194	kpmp_shift	KPMTSBM_KPMPSHIFT
195	kpmp2pshft	KPMTSBM_KPMP2PSHFT
196	kpmp_table_sz	KPMTSBM_KPMPTABLESZ
197	kpmp_tablepa	KPMTSBM_KPMPTABLEPA
198	msegphashpa	KPMTSBM_MSEGPHASHPA
199	tsbptr		KPMTSBM_TSBPTR
200	kpm_dtlb_misses	KPMTSBM_DTLBMISS
201	kpm_tsb_misses	KPMTSBM_TSBMISS
202
203kpm_page	KPMPAGE_SIZE KPMPAGE_SHIFT
204	kp_refcnt	KPMPAGE_REFCNT
205	kp_refcnta	KPMPAGE_REFCNTA
206	kp_refcntc	KPMPAGE_REFCNTC
207	kp_refcnts	KPMPAGE_REFCNTS
208
209kpm_hlk		KPMHLK_SIZE KPMHLK_SHIFT
210	khl_mutex	KPMHLK_MUTEX
211	khl_lock	KPMHLK_LOCK
212
213kpm_spage	KPMSPAGE_SIZE KPMSPAGE_SHIFT
214	kp_mapped_flag	KPMSPAGE_MAPPED
215
216kpm_shlk	KPMSHLK_SIZE KPMSHLK_SHIFT
217	kshl_lock	KPMSHLK_LOCK
218
219memseg		MEMSEG_SIZE
220	pages		MEMSEG_PAGES
221	epages		MEMSEG_EPAGES
222	pages_base	MEMSEG_PAGES_BASE
223	pages_end	MEMSEG_PAGES_END
224	next		MEMSEG_NEXT
225	lnext		MEMSEG_LNEXT
226	nextpa		MEMSEG_NEXTPA
227	pagespa		MEMSEG_PAGESPA
228	epagespa	MEMSEG_EPAGESPA
229	kpm_pbase	MEMSEG_KPM_PBASE
230	kpm_nkpmpgs	MEMSEG_KPM_NKPMPGS
231	mseg_un
232	kpm_pagespa	MEMSEG_KPM_PAGESPA
233
234\#define	MEMSEG_KPM_PAGES	(MSEG_UN)
235\#define	MEMSEG_KPM_SPAGES	(MSEG_UN)
236
237page		PAGE_SIZE
238	p_pagenum	PAGE_PAGENUM
239
240tsb_info	TSBINFO_SIZE
241	tsb_tte		TSBINFO_TTE
242	tsb_va		TSBINFO_VADDR
243	tsb_pa		TSBINFO_PADDR
244	tsb_szc		TSBINFO_SZCODE
245	tsb_next	TSBINFO_NEXTPTR
246
247hv_tsb_block
248	hv_tsb_info_pa
249	hv_tsb_info_cnt
250
251cpu_node	CPU_NODE_SIZE
252	nodeid
253	clock_freq
254	tick_nsec_scale
255	ecache_size	ECACHE_SIZE
256	ecache_linesize	ECACHE_LINESIZE
257	device_id	DEVICE_ID
258
259ptl1_regs
260	ptl1_trap_regs
261	ptl1_gregs
262	ptl1_tick
263	ptl1_dmmu_type
264	ptl1_dmmu_addr
265	ptl1_dmmu_ctx
266	ptl1_immu_type
267	ptl1_immu_addr
268	ptl1_immu_ctx
269	ptl1_rwindow
270	ptl1_softint
271	ptl1_pstate
272	ptl1_pil
273	ptl1_cwp
274	ptl1_wstate
275	ptl1_otherwin
276	ptl1_cleanwin
277	ptl1_cansave
278	ptl1_canrestore
279
280ptl1_gregs
281	ptl1_gl
282	ptl1_g1
283	ptl1_g2
284	ptl1_g3
285	ptl1_g4
286	ptl1_g5
287	ptl1_g6
288	ptl1_g7
289
290lpad_data
291	magic		LPAD_MAGIC
292	inuse		LPAD_INUSE
293	mmfsa_ra	LPAD_MMFSA_RA
294	pc		LPAD_PC
295	arg		LPAD_ARG
296	nmap		LPAD_NMAP
297	map		LPAD_MAP
298
299lpad_map	LPAD_MAP_SIZE
300	flags		LPAD_MAP_FLAGS
301	va		LPAD_MAP_VA
302	tte		LPAD_MAP_TTE
303