xref: /illumos-gate/usr/src/uts/i86pc/ml/genassym.c (revision 7f7322febbcfe774b7270abc3b191c094bfcc517)
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, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #pragma ident	"%Z%%M%	%I%	%E% SMI"
28 
29 #ifndef	_GENASSYM
30 #define	_GENASSYM
31 #endif
32 
33 #define	exit	kern_exit
34 
35 #include <sys/types.h>
36 #include <sys/param.h>
37 #include <sys/systm.h>
38 #include <sys/elf_notes.h>
39 #include <sys/thread.h>
40 #include <sys/rwlock.h>
41 #include <sys/proc.h>
42 #include <sys/cpuvar.h>
43 #include <sys/clock.h>
44 #include <sys/trap.h>
45 #include <sys/modctl.h>
46 #include <sys/traptrace.h>
47 #include <vm/seg.h>
48 #include <sys/avintr.h>
49 #include <sys/pic.h>
50 #include <sys/pit.h>
51 #include <sys/fp.h>
52 #include <sys/archsystm.h>
53 #include <sys/sunddi.h>
54 
55 #undef	exit		/* unhide exit, see comment above */
56 extern void exit(int);
57 
58 /*
59  * Proactively discourage anyone from referring to structures or
60  * member offsets in this program.
61  */
62 #define	struct	struct...
63 #define	OFFSET	OFFSET...
64 
65 int
66 main(int argc, char *argv[])
67 {
68 	printf("#define\tT_AST 0x%x\n", T_AST);
69 
70 	printf("#define\tLOCK_LEVEL 0x%x\n", LOCK_LEVEL);
71 	printf("#define\tCLOCK_LEVEL 0x%x\n", CLOCK_LEVEL);
72 	printf("#define\tDISP_LEVEL 0x%x\n", DISP_LEVEL);
73 	printf("#define\tPIL_MAX 0x%x\n", PIL_MAX);
74 	printf("#define\tHIGH_LEVELS 0x%x\n", HIGH_LEVELS);
75 	printf("#define\tCPU_INTR_ACTV_HIGH_LEVEL_MASK 0x%x\n",
76 	    CPU_INTR_ACTV_HIGH_LEVEL_MASK);
77 
78 	printf("#define\tPIC_NSEOI 0x%x\n", PIC_NSEOI);
79 	printf("#define\tPIC_SEOI_LVL7 0x%x\n", PIC_SEOI_LVL7);
80 
81 	printf("#define\tNANOSEC 0x%x\n", NANOSEC);
82 	printf("#define\tADJ_SHIFT 0x%x\n", ADJ_SHIFT);
83 
84 	printf("#define\tSSLEEP 0x%x\n", SSLEEP);
85 	printf("#define\tSRUN 0x%x\n", SRUN);
86 	printf("#define\tSONPROC 0x%x\n", SONPROC);
87 
88 	printf("#define\tT_INTR_THREAD 0x%x\n", T_INTR_THREAD);
89 	printf("#define\tFREE_THREAD 0x%x\n", TS_FREE);
90 	printf("#define\tTS_FREE 0x%x\n", TS_FREE);
91 	printf("#define\tTS_ZOMB 0x%x\n", TS_ZOMB);
92 	printf("#define\tTP_MSACCT 0x%x\n", TP_MSACCT);
93 	printf("#define\tTP_WATCHPT 0x%x\n", TP_WATCHPT);
94 	printf("#define\tONPROC_THREAD 0x%x\n", TS_ONPROC);
95 
96 	printf("#define\tS_READ 0x%x\n", (int)S_READ);
97 	printf("#define\tS_WRITE 0x%x\n", (int)S_WRITE);
98 	printf("#define\tS_EXEC 0x%x\n", (int)S_EXEC);
99 	printf("#define\tS_OTHER 0x%x\n", (int)S_OTHER);
100 
101 	printf("#define\tNORMALRETURN 0x%x\n", (int)NORMALRETURN);
102 	printf("#define\tLWP_USER 0x%x\n", LWP_USER);
103 	printf("#define\tLWP_SYS 0x%x\n", LWP_SYS);
104 	printf("#define\tLMS_USER 0x%x\n", LMS_USER);
105 	printf("#define\tLMS_SYSTEM 0x%x\n", LMS_SYSTEM);
106 
107 	printf("#define\tSSE_MXCSR_EFLAGS 0x%x\n", SSE_MXCSR_EFLAGS);
108 
109 	printf("#define\tFP_487 0x%x\n", FP_487);
110 	printf("#define\tFP_486 0x%x\n", FP_486);
111 	printf("#define\tFPU_CW_INIT 0x%x\n", FPU_CW_INIT);
112 	printf("#define\tFPU_EN 0x%x\n", FPU_EN);
113 	printf("#define\tFPU_VALID 0x%x\n", FPU_VALID);
114 
115 	printf("#define\tELF_NOTE_PAGESIZE_HINT 0x%x\n",
116 	    ELF_NOTE_PAGESIZE_HINT);
117 
118 	printf("#define\tFP_NO 0x%x\n", FP_NO);
119 	printf("#define\tFP_SW 0x%x\n", FP_SW);
120 	printf("#define\tFP_HW 0x%x\n", FP_HW);
121 	printf("#define\tFP_287 0x%x\n", FP_287);
122 	printf("#define\tFP_387 0x%x\n", FP_387);
123 	printf("#define\t__FP_SSE 0x%x\n", __FP_SSE);
124 
125 	printf("#define\tAV_INT_SPURIOUS 0x%x\n", AV_INT_SPURIOUS);
126 
127 	printf("#define\tCPU_READY 0x%x\n", CPU_READY);
128 	printf("#define\tCPU_QUIESCED 0x%x\n", CPU_QUIESCED);
129 
130 	printf("#define\tMCMD_PORT 0x%x\n", MCMD_PORT);
131 	printf("#define\tSCMD_PORT 0x%x\n", SCMD_PORT);
132 	printf("#define\tMIMR_PORT 0x%x\n", MIMR_PORT);
133 	printf("#define\tSIMR_PORT 0x%x\n", SIMR_PORT);
134 
135 	printf("#define\tDMP_NOSYNC 0x%x\n", DMP_NOSYNC);
136 
137 	printf("#define\tRW_WRITER\t0x%x\n", RW_WRITER);
138 	printf("#define\tRW_READER\t0x%x\n", RW_READER);
139 
140 	printf("#define\tNSYSCALL 0x%x\n", NSYSCALL);
141 
142 	printf("#define\tSE_32RVAL1 0x%x\n", SE_32RVAL1);
143 	printf("#define\tSE_32RVAL2 0x%x\n", SE_32RVAL2);
144 	printf("#define\tSE_64RVAL 0x%x\n", SE_64RVAL);
145 
146 	printf("#define\tMAXSYSARGS 0x%x\n", MAXSYSARGS);
147 
148 	/* Hack value just to allow clock to be kicked */
149 	printf("#define\tNSEC_PER_CLOCK_TICK 0x%x\n", NANOSEC / 100);
150 
151 	printf("#define\tNSEC_PER_COUNTER_TICK 0x%x\n", NANOSEC / PIT_HZ);
152 
153 	printf("#define\tPITCTR0_PORT 0x%x\n", PITCTR0_PORT);
154 	printf("#define\tPITCTL_PORT 0x%x\n", PITCTL_PORT);
155 	printf("#define\tPIT_COUNTDOWN 0x%x\n",
156 	    PIT_C0 | PIT_LOADMODE | PIT_NDIVMODE);
157 
158 	printf("#define\tNBPW 0x%x\n", NBPW);
159 
160 	printf("#define\tDDI_ACCATTR_IO_SPACE 0x%x\n", DDI_ACCATTR_IO_SPACE);
161 	printf("#define\tDDI_ACCATTR_DIRECT 0x%x\n", DDI_ACCATTR_DIRECT);
162 	printf("#define\tDDI_ACCATTR_CPU_VADDR 0x%x\n", DDI_ACCATTR_CPU_VADDR);
163 	printf("#define\tDDI_DEV_AUTOINCR 0x%x\n", DDI_DEV_AUTOINCR);
164 
165 	printf("#define\tMMU_STD_PAGESIZE 0x%x\n", (uint_t)MMU_STD_PAGESIZE);
166 	printf("#define\tMMU_STD_PAGESHIFT 0x%x\n", (uint_t)MMU_STD_PAGESHIFT);
167 	printf("#define\tMMU_STD_PAGEMASK 0x%x\n", (uint_t)MMU_STD_PAGEMASK);
168 	printf("#define\tMMU_L2_MASK 0x%x\n", (uint_t)(NPTEPERPT - 1));
169 	printf("#define\tMMU_PAGEOFFSET 0x%x\n", (uint_t)(MMU_PAGESIZE - 1));
170 	printf("#define\tNPTESHIFT 0x%x\n", (uint_t)NPTESHIFT);
171 	printf("#define\tFOURMB_PAGEOFFSET 0x%x\n", (uint_t)FOURMB_PAGEOFFSET);
172 	printf("#define\tFOURMB_PAGESIZE 0x%x\n", (uint_t)FOURMB_PAGESIZE);
173 	printf("#define\tPTE_LARGEPAGE 0x%x\n", (uint_t)PTE_LARGEPAGE);
174 	printf("#define\tPTE_VALID 0x%x\n", (uint_t)PTE_VALID);
175 	printf("#define\tPTE_SRWX 0x%x\n", (uint_t)PTE_SRWX);
176 
177 	printf("#define\tTRAPTR_NENT 0x%x\n", TRAPTR_NENT);
178 
179 	printf("#define\tNCPU 0x%x\n", NCPU);
180 
181 	printf("#define\tCPU_DTRACE_NOFAULT 0x%x\n", CPU_DTRACE_NOFAULT);
182 	printf("#define\tCPU_DTRACE_BADADDR 0x%x\n", CPU_DTRACE_BADADDR);
183 	printf("#define\tCPU_DTRACE_ILLOP 0x%x\n", CPU_DTRACE_ILLOP);
184 
185 	printf("#define\tMODS_NOUNLOAD 0x%x\n", MODS_NOUNLOAD);
186 	printf("#define\tMODS_WEAK 0x%x\n", MODS_WEAK);
187 	printf("#define\tMODS_INSTALLED 0x%x\n", MODS_INSTALLED);
188 
189 	return (0);
190 }
191