17c478bdstevel@tonic-gate/*
27c478bdstevel@tonic-gate * CDDL HEADER START
37c478bdstevel@tonic-gate *
47c478bdstevel@tonic-gate * The contents of this file are subject to the terms of the
54179143andrei * Common Development and Distribution License (the "License").
64179143andrei * You may not use this file except in compliance with the License.
77c478bdstevel@tonic-gate *
87c478bdstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bdstevel@tonic-gate * or http://www.opensolaris.org/os/licensing.
107c478bdstevel@tonic-gate * See the License for the specific language governing permissions
117c478bdstevel@tonic-gate * and limitations under the License.
127c478bdstevel@tonic-gate *
137c478bdstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each
147c478bdstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bdstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the
167c478bdstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying
177c478bdstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bdstevel@tonic-gate *
197c478bdstevel@tonic-gate * CDDL HEADER END
207c478bdstevel@tonic-gate */
217c478bdstevel@tonic-gate/*
227af88acKuriakose Kuruvilla * Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
2374ecdb5John Levon *
2474ecdb5John Levon * Copyright 2018 Joyent, Inc.
257c478bdstevel@tonic-gate */
267c478bdstevel@tonic-gate
277c478bdstevel@tonic-gate#ifndef	_GENASSYM
287c478bdstevel@tonic-gate#define	_GENASSYM
297c478bdstevel@tonic-gate#endif
307c478bdstevel@tonic-gate
317c478bdstevel@tonic-gate#define	exit	kern_exit
327c478bdstevel@tonic-gate
337c478bdstevel@tonic-gate#include <sys/types.h>
347c478bdstevel@tonic-gate#include <sys/param.h>
357c478bdstevel@tonic-gate#include <sys/systm.h>
367c478bdstevel@tonic-gate#include <sys/elf_notes.h>
377c478bdstevel@tonic-gate#include <sys/thread.h>
387c478bdstevel@tonic-gate#include <sys/rwlock.h>
397c478bdstevel@tonic-gate#include <sys/proc.h>
407c478bdstevel@tonic-gate#include <sys/cpuvar.h>
417c478bdstevel@tonic-gate#include <sys/clock.h>
427c478bdstevel@tonic-gate#include <sys/trap.h>
437c478bdstevel@tonic-gate#include <sys/modctl.h>
447c478bdstevel@tonic-gate#include <sys/traptrace.h>
457c478bdstevel@tonic-gate#include <vm/seg.h>
467c478bdstevel@tonic-gate#include <sys/avintr.h>
477c478bdstevel@tonic-gate#include <sys/pic.h>
487c478bdstevel@tonic-gate#include <sys/pit.h>
497c478bdstevel@tonic-gate#include <sys/fp.h>
50ae115bcmrj#include <sys/disp.h>
517c478bdstevel@tonic-gate#include <sys/archsystm.h>
52ae115bcmrj#include <sys/x86_archext.h>
537c478bdstevel@tonic-gate#include <sys/sunddi.h>
54ae115bcmrj#include <sys/mach_mmu.h>
557c478bdstevel@tonic-gate
56843e198johnlev#if defined(__xpv)
57843e198johnlev#include <sys/hypervisor.h>
58843e198johnlev#endif
59843e198johnlev
607c478bdstevel@tonic-gate#undef	exit		/* unhide exit, see comment above */
617c478bdstevel@tonic-gateextern void exit(int);
627c478bdstevel@tonic-gate
637c478bdstevel@tonic-gate/*
647c478bdstevel@tonic-gate * Proactively discourage anyone from referring to structures or
657c478bdstevel@tonic-gate * member offsets in this program.
667c478bdstevel@tonic-gate */
677c478bdstevel@tonic-gate#define	struct	struct...
687c478bdstevel@tonic-gate#define	OFFSET	OFFSET...
697c478bdstevel@tonic-gate
707c478bdstevel@tonic-gateint
717c478bdstevel@tonic-gatemain(int argc, char *argv[])
727c478bdstevel@tonic-gate{
737c478bdstevel@tonic-gate	printf("#define\tLOCK_LEVEL 0x%x\n", LOCK_LEVEL);
747c478bdstevel@tonic-gate	printf("#define\tCLOCK_LEVEL 0x%x\n", CLOCK_LEVEL);
757c478bdstevel@tonic-gate	printf("#define\tDISP_LEVEL 0x%x\n", DISP_LEVEL);
767c478bdstevel@tonic-gate	printf("#define\tPIL_MAX 0x%x\n", PIL_MAX);
777c478bdstevel@tonic-gate	printf("#define\tHIGH_LEVELS 0x%x\n", HIGH_LEVELS);
787c478bdstevel@tonic-gate	printf("#define\tCPU_INTR_ACTV_HIGH_LEVEL_MASK 0x%x\n",
797c478bdstevel@tonic-gate	    CPU_INTR_ACTV_HIGH_LEVEL_MASK);
807c478bdstevel@tonic-gate
817c478bdstevel@tonic-gate	printf("#define\tPIC_NSEOI 0x%x\n", PIC_NSEOI);
827c478bdstevel@tonic-gate	printf("#define\tPIC_SEOI_LVL7 0x%x\n", PIC_SEOI_LVL7);
837c478bdstevel@tonic-gate
847f11fd0Richard Lowe	printf("#define\tNANOSEC 0x%llx\n", NANOSEC);
857c478bdstevel@tonic-gate	printf("#define\tADJ_SHIFT 0x%x\n", ADJ_SHIFT);
867c478bdstevel@tonic-gate
877c478bdstevel@tonic-gate	printf("#define\tSSLEEP 0x%x\n", SSLEEP);
887c478bdstevel@tonic-gate	printf("#define\tSRUN 0x%x\n", SRUN);
897c478bdstevel@tonic-gate	printf("#define\tSONPROC 0x%x\n", SONPROC);
907c478bdstevel@tonic-gate
917c478bdstevel@tonic-gate	printf("#define\tT_INTR_THREAD 0x%x\n", T_INTR_THREAD);
927c478bdstevel@tonic-gate	printf("#define\tFREE_THREAD 0x%x\n", TS_FREE);
937c478bdstevel@tonic-gate	printf("#define\tTS_FREE 0x%x\n", TS_FREE);
947c478bdstevel@tonic-gate	printf("#define\tTS_ZOMB 0x%x\n", TS_ZOMB);
957c478bdstevel@tonic-gate	printf("#define\tTP_MSACCT 0x%x\n", TP_MSACCT);
967c478bdstevel@tonic-gate	printf("#define\tTP_WATCHPT 0x%x\n", TP_WATCHPT);
977c478bdstevel@tonic-gate	printf("#define\tONPROC_THREAD 0x%x\n", TS_ONPROC);
987c478bdstevel@tonic-gate
997c478bdstevel@tonic-gate	printf("#define\tS_READ 0x%x\n", (int)S_READ);
1007c478bdstevel@tonic-gate	printf("#define\tS_WRITE 0x%x\n", (int)S_WRITE);
1017c478bdstevel@tonic-gate	printf("#define\tS_EXEC 0x%x\n", (int)S_EXEC);
1027c478bdstevel@tonic-gate	printf("#define\tS_OTHER 0x%x\n", (int)S_OTHER);
1037c478bdstevel@tonic-gate
1047c478bdstevel@tonic-gate	printf("#define\tNORMALRETURN 0x%x\n", (int)NORMALRETURN);
1057c478bdstevel@tonic-gate	printf("#define\tLWP_USER 0x%x\n", LWP_USER);
1067c478bdstevel@tonic-gate	printf("#define\tLWP_SYS 0x%x\n", LWP_SYS);
1077c478bdstevel@tonic-gate	printf("#define\tLMS_USER 0x%x\n", LMS_USER);
1087c478bdstevel@tonic-gate	printf("#define\tLMS_SYSTEM 0x%x\n", LMS_SYSTEM);
1097c478bdstevel@tonic-gate
1107c478bdstevel@tonic-gate	printf("#define\tSSE_MXCSR_EFLAGS 0x%x\n", SSE_MXCSR_EFLAGS);
1117c478bdstevel@tonic-gate
1127af88acKuriakose Kuruvilla	printf("#define\tFP_FXSAVE 0x%x\n", FP_FXSAVE);
1137af88acKuriakose Kuruvilla	printf("#define\tFP_XSAVE 0x%x\n", FP_XSAVE);
1147af88acKuriakose Kuruvilla
1157c478bdstevel@tonic-gate	printf("#define\tAV_INT_SPURIOUS 0x%x\n", AV_INT_SPURIOUS);
1167c478bdstevel@tonic-gate
1177c478bdstevel@tonic-gate	printf("#define\tCPU_READY 0x%x\n", CPU_READY);
1187c478bdstevel@tonic-gate	printf("#define\tCPU_QUIESCED 0x%x\n", CPU_QUIESCED);
1197c478bdstevel@tonic-gate
1207c478bdstevel@tonic-gate	printf("#define\tMCMD_PORT 0x%x\n", MCMD_PORT);
1217c478bdstevel@tonic-gate	printf("#define\tSCMD_PORT 0x%x\n", SCMD_PORT);
1227c478bdstevel@tonic-gate	printf("#define\tMIMR_PORT 0x%x\n", MIMR_PORT);
1237c478bdstevel@tonic-gate	printf("#define\tSIMR_PORT 0x%x\n", SIMR_PORT);
1247c478bdstevel@tonic-gate
1257c478bdstevel@tonic-gate	printf("#define\tDMP_NOSYNC 0x%x\n", DMP_NOSYNC);
1267c478bdstevel@tonic-gate
1277c478bdstevel@tonic-gate	printf("#define\tRW_WRITER\t0x%x\n", RW_WRITER);
1287c478bdstevel@tonic-gate	printf("#define\tRW_READER\t0x%x\n", RW_READER);
1297c478bdstevel@tonic-gate
1307c478bdstevel@tonic-gate	printf("#define\tNSYSCALL 0x%x\n", NSYSCALL);
1317c478bdstevel@tonic-gate
1327c478bdstevel@tonic-gate	printf("#define\tSE_32RVAL1 0x%x\n", SE_32RVAL1);
1337c478bdstevel@tonic-gate	printf("#define\tSE_32RVAL2 0x%x\n", SE_32RVAL2);
1347c478bdstevel@tonic-gate	printf("#define\tSE_64RVAL 0x%x\n", SE_64RVAL);
1357c478bdstevel@tonic-gate
1367c478bdstevel@tonic-gate	printf("#define\tMAXSYSARGS 0x%x\n", MAXSYSARGS);
1377c478bdstevel@tonic-gate
1387c478bdstevel@tonic-gate	/* Hack value just to allow clock to be kicked */
1397f11fd0Richard Lowe	printf("#define\tNSEC_PER_CLOCK_TICK 0x%llx\n", NANOSEC / 100);
1407c478bdstevel@tonic-gate
1417f11fd0Richard Lowe	printf("#define\tNSEC_PER_COUNTER_TICK 0x%llx\n", NANOSEC / PIT_HZ);
1427c478bdstevel@tonic-gate
1437c478bdstevel@tonic-gate	printf("#define\tNBPW 0x%x\n", NBPW);
1447c478bdstevel@tonic-gate
1457c478bdstevel@tonic-gate	printf("#define\tDDI_ACCATTR_IO_SPACE 0x%x\n", DDI_ACCATTR_IO_SPACE);
1467c478bdstevel@tonic-gate	printf("#define\tDDI_ACCATTR_DIRECT 0x%x\n", DDI_ACCATTR_DIRECT);
1477c478bdstevel@tonic-gate	printf("#define\tDDI_ACCATTR_CPU_VADDR 0x%x\n", DDI_ACCATTR_CPU_VADDR);
1487c478bdstevel@tonic-gate	printf("#define\tDDI_DEV_AUTOINCR 0x%x\n", DDI_DEV_AUTOINCR);
1497c478bdstevel@tonic-gate
1507c478bdstevel@tonic-gate	printf("#define\tMMU_STD_PAGESIZE 0x%x\n", (uint_t)MMU_STD_PAGESIZE);
1517c478bdstevel@tonic-gate	printf("#define\tMMU_STD_PAGEMASK 0x%x\n", (uint_t)MMU_STD_PAGEMASK);
152ae115bcmrj	printf("#define\tFOUR_MEG 0x%x\n", (uint_t)FOUR_MEG);
1537c478bdstevel@tonic-gate
1547c478bdstevel@tonic-gate	printf("#define\tTRAPTR_NENT 0x%x\n", TRAPTR_NENT);
1557c478bdstevel@tonic-gate
1567c478bdstevel@tonic-gate	printf("#define\tCPU_DTRACE_NOFAULT 0x%x\n", CPU_DTRACE_NOFAULT);
1577c478bdstevel@tonic-gate	printf("#define\tCPU_DTRACE_BADADDR 0x%x\n", CPU_DTRACE_BADADDR);
15882d2d14Bryan Cantrill	printf("#define\tCPU_DTRACE_DIVZERO 0x%x\n", CPU_DTRACE_DIVZERO);
1597c478bdstevel@tonic-gate	printf("#define\tCPU_DTRACE_ILLOP 0x%x\n", CPU_DTRACE_ILLOP);
1607c478bdstevel@tonic-gate
1617c478bdstevel@tonic-gate	printf("#define\tMODS_NOUNLOAD 0x%x\n", MODS_NOUNLOAD);
1627c478bdstevel@tonic-gate	printf("#define\tMODS_WEAK 0x%x\n", MODS_WEAK);
1637c478bdstevel@tonic-gate	printf("#define\tMODS_INSTALLED 0x%x\n", MODS_INSTALLED);
1647c478bdstevel@tonic-gate
165ae115bcmrj	printf("#define\tKPREEMPT_SYNC 0x%x\n", KPREEMPT_SYNC);
166ae115bcmrj
167843e198johnlev#if defined(__xpv)
168843e198johnlev	printf("#define\tSHUTDOWN_reboot 0x%x\n", SHUTDOWN_reboot);
169843e198johnlev	printf("#define\tSCHEDOP_block 0x%x\n", SCHEDOP_block);
1709a4611fStuart Maybee	printf("#define\tVGCF_IN_KERNEL 0x%x\n", VGCF_IN_KERNEL);
171843e198johnlev#endif
1727c478bdstevel@tonic-gate	return (0);
1737c478bdstevel@tonic-gate}
174