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