xref: /illumos-gate/usr/src/uts/i86pc/ml/genassym.c (revision 7f11fd00fc23e2af7ae21cc8837a2b86380dcfa7)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
541791439Sandrei  * Common Development and Distribution License (the "License").
641791439Sandrei  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
227af88ac7SKuriakose Kuruvilla  * Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
237c478bd9Sstevel@tonic-gate  */
247c478bd9Sstevel@tonic-gate 
257c478bd9Sstevel@tonic-gate #ifndef	_GENASSYM
267c478bd9Sstevel@tonic-gate #define	_GENASSYM
277c478bd9Sstevel@tonic-gate #endif
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate #define	exit	kern_exit
307c478bd9Sstevel@tonic-gate 
317c478bd9Sstevel@tonic-gate #include <sys/types.h>
327c478bd9Sstevel@tonic-gate #include <sys/param.h>
337c478bd9Sstevel@tonic-gate #include <sys/systm.h>
347c478bd9Sstevel@tonic-gate #include <sys/elf_notes.h>
357c478bd9Sstevel@tonic-gate #include <sys/thread.h>
367c478bd9Sstevel@tonic-gate #include <sys/rwlock.h>
377c478bd9Sstevel@tonic-gate #include <sys/proc.h>
387c478bd9Sstevel@tonic-gate #include <sys/cpuvar.h>
397c478bd9Sstevel@tonic-gate #include <sys/clock.h>
407c478bd9Sstevel@tonic-gate #include <sys/trap.h>
417c478bd9Sstevel@tonic-gate #include <sys/modctl.h>
427c478bd9Sstevel@tonic-gate #include <sys/traptrace.h>
437c478bd9Sstevel@tonic-gate #include <vm/seg.h>
447c478bd9Sstevel@tonic-gate #include <sys/avintr.h>
457c478bd9Sstevel@tonic-gate #include <sys/pic.h>
467c478bd9Sstevel@tonic-gate #include <sys/pit.h>
477c478bd9Sstevel@tonic-gate #include <sys/fp.h>
48ae115bc7Smrj #include <sys/disp.h>
497c478bd9Sstevel@tonic-gate #include <sys/archsystm.h>
50ae115bc7Smrj #include <sys/x86_archext.h>
517c478bd9Sstevel@tonic-gate #include <sys/sunddi.h>
52ae115bc7Smrj #include <sys/mach_mmu.h>
537c478bd9Sstevel@tonic-gate 
54843e1988Sjohnlev #if defined(__xpv)
55843e1988Sjohnlev #include <sys/hypervisor.h>
56843e1988Sjohnlev #endif
57843e1988Sjohnlev 
587c478bd9Sstevel@tonic-gate #undef	exit		/* unhide exit, see comment above */
597c478bd9Sstevel@tonic-gate extern void exit(int);
607c478bd9Sstevel@tonic-gate 
617c478bd9Sstevel@tonic-gate /*
627c478bd9Sstevel@tonic-gate  * Proactively discourage anyone from referring to structures or
637c478bd9Sstevel@tonic-gate  * member offsets in this program.
647c478bd9Sstevel@tonic-gate  */
657c478bd9Sstevel@tonic-gate #define	struct	struct...
667c478bd9Sstevel@tonic-gate #define	OFFSET	OFFSET...
677c478bd9Sstevel@tonic-gate 
687c478bd9Sstevel@tonic-gate int
697c478bd9Sstevel@tonic-gate main(int argc, char *argv[])
707c478bd9Sstevel@tonic-gate {
717c478bd9Sstevel@tonic-gate 	printf("#define\tT_AST 0x%x\n", T_AST);
727c478bd9Sstevel@tonic-gate 
737c478bd9Sstevel@tonic-gate 	printf("#define\tLOCK_LEVEL 0x%x\n", LOCK_LEVEL);
747c478bd9Sstevel@tonic-gate 	printf("#define\tCLOCK_LEVEL 0x%x\n", CLOCK_LEVEL);
757c478bd9Sstevel@tonic-gate 	printf("#define\tDISP_LEVEL 0x%x\n", DISP_LEVEL);
767c478bd9Sstevel@tonic-gate 	printf("#define\tPIL_MAX 0x%x\n", PIL_MAX);
777c478bd9Sstevel@tonic-gate 	printf("#define\tHIGH_LEVELS 0x%x\n", HIGH_LEVELS);
787c478bd9Sstevel@tonic-gate 	printf("#define\tCPU_INTR_ACTV_HIGH_LEVEL_MASK 0x%x\n",
797c478bd9Sstevel@tonic-gate 	    CPU_INTR_ACTV_HIGH_LEVEL_MASK);
807c478bd9Sstevel@tonic-gate 
817c478bd9Sstevel@tonic-gate 	printf("#define\tPIC_NSEOI 0x%x\n", PIC_NSEOI);
827c478bd9Sstevel@tonic-gate 	printf("#define\tPIC_SEOI_LVL7 0x%x\n", PIC_SEOI_LVL7);
837c478bd9Sstevel@tonic-gate 
84*7f11fd00SRichard Lowe 	printf("#define\tNANOSEC 0x%llx\n", NANOSEC);
857c478bd9Sstevel@tonic-gate 	printf("#define\tADJ_SHIFT 0x%x\n", ADJ_SHIFT);
867c478bd9Sstevel@tonic-gate 
877c478bd9Sstevel@tonic-gate 	printf("#define\tSSLEEP 0x%x\n", SSLEEP);
887c478bd9Sstevel@tonic-gate 	printf("#define\tSRUN 0x%x\n", SRUN);
897c478bd9Sstevel@tonic-gate 	printf("#define\tSONPROC 0x%x\n", SONPROC);
907c478bd9Sstevel@tonic-gate 
917c478bd9Sstevel@tonic-gate 	printf("#define\tT_INTR_THREAD 0x%x\n", T_INTR_THREAD);
927c478bd9Sstevel@tonic-gate 	printf("#define\tFREE_THREAD 0x%x\n", TS_FREE);
937c478bd9Sstevel@tonic-gate 	printf("#define\tTS_FREE 0x%x\n", TS_FREE);
947c478bd9Sstevel@tonic-gate 	printf("#define\tTS_ZOMB 0x%x\n", TS_ZOMB);
957c478bd9Sstevel@tonic-gate 	printf("#define\tTP_MSACCT 0x%x\n", TP_MSACCT);
967c478bd9Sstevel@tonic-gate 	printf("#define\tTP_WATCHPT 0x%x\n", TP_WATCHPT);
977c478bd9Sstevel@tonic-gate 	printf("#define\tONPROC_THREAD 0x%x\n", TS_ONPROC);
987c478bd9Sstevel@tonic-gate 
997c478bd9Sstevel@tonic-gate 	printf("#define\tS_READ 0x%x\n", (int)S_READ);
1007c478bd9Sstevel@tonic-gate 	printf("#define\tS_WRITE 0x%x\n", (int)S_WRITE);
1017c478bd9Sstevel@tonic-gate 	printf("#define\tS_EXEC 0x%x\n", (int)S_EXEC);
1027c478bd9Sstevel@tonic-gate 	printf("#define\tS_OTHER 0x%x\n", (int)S_OTHER);
1037c478bd9Sstevel@tonic-gate 
1047c478bd9Sstevel@tonic-gate 	printf("#define\tNORMALRETURN 0x%x\n", (int)NORMALRETURN);
1057c478bd9Sstevel@tonic-gate 	printf("#define\tLWP_USER 0x%x\n", LWP_USER);
1067c478bd9Sstevel@tonic-gate 	printf("#define\tLWP_SYS 0x%x\n", LWP_SYS);
1077c478bd9Sstevel@tonic-gate 	printf("#define\tLMS_USER 0x%x\n", LMS_USER);
1087c478bd9Sstevel@tonic-gate 	printf("#define\tLMS_SYSTEM 0x%x\n", LMS_SYSTEM);
1097c478bd9Sstevel@tonic-gate 
1107c478bd9Sstevel@tonic-gate 	printf("#define\tSSE_MXCSR_EFLAGS 0x%x\n", SSE_MXCSR_EFLAGS);
1117c478bd9Sstevel@tonic-gate 
1127c478bd9Sstevel@tonic-gate 	printf("#define\tFP_487 0x%x\n", FP_487);
1137c478bd9Sstevel@tonic-gate 	printf("#define\tFP_486 0x%x\n", FP_486);
1147c478bd9Sstevel@tonic-gate 	printf("#define\tFPU_CW_INIT 0x%x\n", FPU_CW_INIT);
1157c478bd9Sstevel@tonic-gate 	printf("#define\tFPU_EN 0x%x\n", FPU_EN);
1167c478bd9Sstevel@tonic-gate 	printf("#define\tFPU_VALID 0x%x\n", FPU_VALID);
1177c478bd9Sstevel@tonic-gate 
1187c478bd9Sstevel@tonic-gate 	printf("#define\tFP_NO 0x%x\n", FP_NO);
1197c478bd9Sstevel@tonic-gate 	printf("#define\tFP_SW 0x%x\n", FP_SW);
1207c478bd9Sstevel@tonic-gate 	printf("#define\tFP_HW 0x%x\n", FP_HW);
1217c478bd9Sstevel@tonic-gate 	printf("#define\tFP_287 0x%x\n", FP_287);
1227c478bd9Sstevel@tonic-gate 	printf("#define\tFP_387 0x%x\n", FP_387);
1237c478bd9Sstevel@tonic-gate 	printf("#define\t__FP_SSE 0x%x\n", __FP_SSE);
1247c478bd9Sstevel@tonic-gate 
1257af88ac7SKuriakose Kuruvilla 	printf("#define\tFP_FNSAVE 0x%x\n", FP_FNSAVE);
1267af88ac7SKuriakose Kuruvilla 	printf("#define\tFP_FXSAVE 0x%x\n", FP_FXSAVE);
1277af88ac7SKuriakose Kuruvilla 	printf("#define\tFP_XSAVE 0x%x\n", FP_XSAVE);
1287af88ac7SKuriakose Kuruvilla 
1297c478bd9Sstevel@tonic-gate 	printf("#define\tAV_INT_SPURIOUS 0x%x\n", AV_INT_SPURIOUS);
1307c478bd9Sstevel@tonic-gate 
1317c478bd9Sstevel@tonic-gate 	printf("#define\tCPU_READY 0x%x\n", CPU_READY);
1327c478bd9Sstevel@tonic-gate 	printf("#define\tCPU_QUIESCED 0x%x\n", CPU_QUIESCED);
1337c478bd9Sstevel@tonic-gate 
1347c478bd9Sstevel@tonic-gate 	printf("#define\tMCMD_PORT 0x%x\n", MCMD_PORT);
1357c478bd9Sstevel@tonic-gate 	printf("#define\tSCMD_PORT 0x%x\n", SCMD_PORT);
1367c478bd9Sstevel@tonic-gate 	printf("#define\tMIMR_PORT 0x%x\n", MIMR_PORT);
1377c478bd9Sstevel@tonic-gate 	printf("#define\tSIMR_PORT 0x%x\n", SIMR_PORT);
1387c478bd9Sstevel@tonic-gate 
1397c478bd9Sstevel@tonic-gate 	printf("#define\tDMP_NOSYNC 0x%x\n", DMP_NOSYNC);
1407c478bd9Sstevel@tonic-gate 
1417c478bd9Sstevel@tonic-gate 	printf("#define\tRW_WRITER\t0x%x\n", RW_WRITER);
1427c478bd9Sstevel@tonic-gate 	printf("#define\tRW_READER\t0x%x\n", RW_READER);
1437c478bd9Sstevel@tonic-gate 
1447c478bd9Sstevel@tonic-gate 	printf("#define\tNSYSCALL 0x%x\n", NSYSCALL);
1457c478bd9Sstevel@tonic-gate 
1467c478bd9Sstevel@tonic-gate 	printf("#define\tSE_32RVAL1 0x%x\n", SE_32RVAL1);
1477c478bd9Sstevel@tonic-gate 	printf("#define\tSE_32RVAL2 0x%x\n", SE_32RVAL2);
1487c478bd9Sstevel@tonic-gate 	printf("#define\tSE_64RVAL 0x%x\n", SE_64RVAL);
1497c478bd9Sstevel@tonic-gate 
1507c478bd9Sstevel@tonic-gate 	printf("#define\tMAXSYSARGS 0x%x\n", MAXSYSARGS);
1517c478bd9Sstevel@tonic-gate 
1527c478bd9Sstevel@tonic-gate 	/* Hack value just to allow clock to be kicked */
153*7f11fd00SRichard Lowe 	printf("#define\tNSEC_PER_CLOCK_TICK 0x%llx\n", NANOSEC / 100);
1547c478bd9Sstevel@tonic-gate 
155*7f11fd00SRichard Lowe 	printf("#define\tNSEC_PER_COUNTER_TICK 0x%llx\n", NANOSEC / PIT_HZ);
1567c478bd9Sstevel@tonic-gate 
1577c478bd9Sstevel@tonic-gate 	printf("#define\tPITCTR0_PORT 0x%x\n", PITCTR0_PORT);
1587c478bd9Sstevel@tonic-gate 	printf("#define\tPITCTL_PORT 0x%x\n", PITCTL_PORT);
1597c478bd9Sstevel@tonic-gate 	printf("#define\tPIT_COUNTDOWN 0x%x\n",
1607c478bd9Sstevel@tonic-gate 	    PIT_C0 | PIT_LOADMODE | PIT_NDIVMODE);
1617c478bd9Sstevel@tonic-gate 
1627c478bd9Sstevel@tonic-gate 	printf("#define\tNBPW 0x%x\n", NBPW);
1637c478bd9Sstevel@tonic-gate 
1647c478bd9Sstevel@tonic-gate 	printf("#define\tDDI_ACCATTR_IO_SPACE 0x%x\n", DDI_ACCATTR_IO_SPACE);
1657c478bd9Sstevel@tonic-gate 	printf("#define\tDDI_ACCATTR_DIRECT 0x%x\n", DDI_ACCATTR_DIRECT);
1667c478bd9Sstevel@tonic-gate 	printf("#define\tDDI_ACCATTR_CPU_VADDR 0x%x\n", DDI_ACCATTR_CPU_VADDR);
1677c478bd9Sstevel@tonic-gate 	printf("#define\tDDI_DEV_AUTOINCR 0x%x\n", DDI_DEV_AUTOINCR);
1687c478bd9Sstevel@tonic-gate 
1697c478bd9Sstevel@tonic-gate 	printf("#define\tMMU_STD_PAGESIZE 0x%x\n", (uint_t)MMU_STD_PAGESIZE);
1707c478bd9Sstevel@tonic-gate 	printf("#define\tMMU_STD_PAGEMASK 0x%x\n", (uint_t)MMU_STD_PAGEMASK);
171ae115bc7Smrj 	printf("#define\tFOUR_MEG 0x%x\n", (uint_t)FOUR_MEG);
1727c478bd9Sstevel@tonic-gate 
1737c478bd9Sstevel@tonic-gate 	printf("#define\tTRAPTR_NENT 0x%x\n", TRAPTR_NENT);
1747c478bd9Sstevel@tonic-gate 
1757c478bd9Sstevel@tonic-gate 	printf("#define\tCPU_DTRACE_NOFAULT 0x%x\n", CPU_DTRACE_NOFAULT);
1767c478bd9Sstevel@tonic-gate 	printf("#define\tCPU_DTRACE_BADADDR 0x%x\n", CPU_DTRACE_BADADDR);
1777c478bd9Sstevel@tonic-gate 	printf("#define\tCPU_DTRACE_ILLOP 0x%x\n", CPU_DTRACE_ILLOP);
1787c478bd9Sstevel@tonic-gate 
1797c478bd9Sstevel@tonic-gate 	printf("#define\tMODS_NOUNLOAD 0x%x\n", MODS_NOUNLOAD);
1807c478bd9Sstevel@tonic-gate 	printf("#define\tMODS_WEAK 0x%x\n", MODS_WEAK);
1817c478bd9Sstevel@tonic-gate 	printf("#define\tMODS_INSTALLED 0x%x\n", MODS_INSTALLED);
1827c478bd9Sstevel@tonic-gate 
183ae115bc7Smrj 	printf("#define\tKPREEMPT_SYNC 0x%x\n", KPREEMPT_SYNC);
184ae115bc7Smrj 
185843e1988Sjohnlev #if defined(__xpv)
186843e1988Sjohnlev 	printf("#define\tSHUTDOWN_reboot 0x%x\n", SHUTDOWN_reboot);
187843e1988Sjohnlev 	printf("#define\tSCHEDOP_block 0x%x\n", SCHEDOP_block);
1889a4611f4SStuart Maybee 	printf("#define\tVGCF_IN_KERNEL 0x%x\n", VGCF_IN_KERNEL);
189843e1988Sjohnlev #endif
1907c478bd9Sstevel@tonic-gate 	return (0);
1917c478bd9Sstevel@tonic-gate }
192