genassym.c revision 36135
1/*- 2 * Copyright (c) 1982, 1990 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * William Jolitz. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions 10 * are met: 11 * 1. Redistributions of source code must retain the above copyright 12 * notice, this list of conditions and the following disclaimer. 13 * 2. Redistributions in binary form must reproduce the above copyright 14 * notice, this list of conditions and the following disclaimer in the 15 * documentation and/or other materials provided with the distribution. 16 * 3. All advertising materials mentioning features or use of this software 17 * must display the following acknowledgement: 18 * This product includes software developed by the University of 19 * California, Berkeley and its contributors. 20 * 4. Neither the name of the University nor the names of its contributors 21 * may be used to endorse or promote products derived from this software 22 * without specific prior written permission. 23 * 24 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 25 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * 36 * from: @(#)genassym.c 5.11 (Berkeley) 5/10/91 37 * $Id: genassym.c,v 1.55 1998/05/17 18:53:11 tegge Exp $ 38 */ 39 40#include "opt_vm86.h" 41 42#include <sys/param.h> 43#include <sys/buf.h> 44#include <sys/errno.h> 45#include <sys/proc.h> 46#include <sys/mount.h> 47#include <sys/socket.h> 48#include <sys/resource.h> 49#include <sys/resourcevar.h> 50#include <machine/frame.h> 51#include <machine/bootinfo.h> 52#include <machine/tss.h> 53#include <sys/vmmeter.h> 54#include <vm/vm.h> 55#include <vm/vm_param.h> 56#include <vm/pmap.h> 57#include <vm/vm_map.h> 58#define KERNEL /* XXX avoid user headers */ 59#include <sys/user.h> 60#undef KERNEL 61#include <net/if.h> 62#include <netinet/in.h> 63#include <nfs/nfsv2.h> 64#include <nfs/rpcv2.h> 65#include <nfs/nfs.h> 66#include <nfs/nfsdiskless.h> 67#ifdef SMP 68#include <machine/apic.h> 69#endif 70#ifdef VM86 71#include <machine/segments.h> 72#endif 73#include <machine/globaldata.h> 74 75int main __P((void)); 76int printf __P((const char *, ...)); 77 78int 79main() 80{ 81 struct proc *p = (struct proc *)0; 82 struct vmmeter *vm = (struct vmmeter *)0; 83 struct user *up = (struct user *)0; 84 struct rusage *rup = (struct rusage *)0; 85 struct uprof *uprof = (struct uprof *)0; 86 struct vmspace *vms = (struct vmspace *)0; 87 struct pcb *pcb = (struct pcb *)0; 88 struct i386tss *tss = (struct i386tss *)0; 89 struct trapframe *tf = (struct trapframe *)0; 90 struct sigframe *sigf = (struct sigframe *)0; 91 struct bootinfo *bootinfo = (struct bootinfo *)0; 92 struct globaldata *globaldata = (struct globaldata *)0; 93#ifdef SMP 94 struct privatespace *privatespace = (struct privatespace *)0; 95#endif 96 97 printf("#define\tP_FORW %p\n", &p->p_procq.tqe_next); 98 printf("#define\tP_BACK %p\n", &p->p_procq.tqe_prev); 99 printf("#define\tP_VMSPACE %p\n", &p->p_vmspace); 100 printf("#define\tVM_PMAP %p\n", &vms->vm_pmap); 101 printf("#define\tP_ADDR %p\n", &p->p_addr); 102 printf("#define\tP_PRI %p\n", &p->p_priority); 103 printf("#define\tP_RTPRIO_TYPE %p\n", &p->p_rtprio.type); 104 printf("#define\tP_RTPRIO_PRIO %p\n", &p->p_rtprio.prio); 105 printf("#define\tP_STAT %p\n", &p->p_stat); 106 printf("#define\tP_WCHAN %p\n", &p->p_wchan); 107 printf("#define\tP_FLAG %p\n", &p->p_flag); 108 printf("#define\tP_PID %p\n", &p->p_pid); 109 printf("#define\tP_RUNTIME %p\n", &p->p_runtime); 110#ifdef SMP 111 printf("#define\tP_ONCPU %p\n", &p->p_oncpu); 112 printf("#define\tP_LASTCPU %p\n", &p->p_lastcpu); 113#endif 114 printf("#define\tSSLEEP %d\n", SSLEEP); 115 printf("#define\tSRUN %d\n", SRUN); 116 printf("#define\tV_TRAP %p\n", &vm->v_trap); 117 printf("#define\tV_SYSCALL %p\n", &vm->v_syscall); 118 printf("#define\tV_INTR %p\n", &vm->v_intr); 119 printf("#define\tUPAGES %d\n", UPAGES); 120 printf("#define\tPAGE_SIZE %d\n", PAGE_SIZE); 121 printf("#define\tNPTEPG %d\n", NPTEPG); 122 printf("#define\tNPDEPG %d\n", NPDEPG); 123 printf("#define\tPDESIZE %d\n", PDESIZE); 124 printf("#define\tPTESIZE %d\n", PTESIZE); 125 printf("#define\tNKPDE %d\n", NKPDE); 126 printf("#define\tNKPT %d\n", NKPT); 127 printf("#define\tPAGE_SHIFT %d\n", PAGE_SHIFT); 128 printf("#define\tPAGE_MASK %d\n", PAGE_MASK); 129 printf("#define\tPDRSHIFT %d\n", PDRSHIFT); 130 printf("#define\tUSRSTACK 0x%lx\n", USRSTACK); 131 printf("#define\tVM_MAXUSER_ADDRESS 0x%lx\n", VM_MAXUSER_ADDRESS); 132 printf("#define\tKERNBASE 0x%x\n", KERNBASE); 133 printf("#define\tMCLBYTES %d\n", MCLBYTES); 134 printf("#define\tPCB_CR3 %p\n", &pcb->pcb_cr3); 135 printf("#define\tPCB_EDI %p\n", &pcb->pcb_edi); 136 printf("#define\tPCB_ESI %p\n", &pcb->pcb_esi); 137 printf("#define\tPCB_EBP %p\n", &pcb->pcb_ebp); 138 printf("#define\tPCB_ESP %p\n", &pcb->pcb_esp); 139 printf("#define\tPCB_EBX %p\n", &pcb->pcb_ebx); 140 printf("#define\tPCB_EIP %p\n", &pcb->pcb_eip); 141 printf("#define\tTSS_ESP0 %p\n", &tss->tss_esp0); 142 printf("#define\tPCB_USERLDT %p\n", &pcb->pcb_ldt); 143 printf("#define\tPCB_FS %p\n", &pcb->pcb_fs); 144 printf("#define\tPCB_GS %p\n", &pcb->pcb_gs); 145#ifdef VM86 146 printf("#define\tPCB_EXT %p\n", &pcb->pcb_ext); 147#endif 148#ifdef SMP 149 printf("#define\tPCB_MPNEST %p\n", &pcb->pcb_mpnest); 150#endif 151 printf("#define\tU_PROF %p\n", &up->u_stats.p_prof); 152 printf("#define\tU_PROFSCALE %p\n", &up->u_stats.p_prof.pr_scale); 153 printf("#define\tPR_BASE %p\n", &uprof->pr_base); 154 printf("#define\tPR_SIZE %p\n", &uprof->pr_size); 155 printf("#define\tPR_OFF %p\n", &uprof->pr_off); 156 printf("#define\tPR_SCALE %p\n", &uprof->pr_scale); 157 printf("#define\tRU_MINFLT %p\n", &rup->ru_minflt); 158 printf("#define\tPCB_FLAGS %p\n", &pcb->pcb_flags); 159 printf("#define\tPCB_SAVEFPU %p\n", &pcb->pcb_savefpu); 160 printf("#define\tPCB_SAVEFPU_SIZE %d\n", sizeof pcb->pcb_savefpu); 161 printf("#define\tPCB_ONFAULT %p\n", &pcb->pcb_onfault); 162#ifdef SMP 163 printf("#define\tPCB_SIZE %d\n", sizeof(struct pcb)); 164#endif 165 166 printf("#define\tTF_ES %p\n", &tf->tf_es); 167 printf("#define\tTF_DS %p\n", &tf->tf_ds); 168 printf("#define\tTF_EDI %p\n", &tf->tf_edi); 169 printf("#define\tTF_ESI %p\n", &tf->tf_esi); 170 printf("#define\tTF_EBP %p\n", &tf->tf_ebp); 171 printf("#define\tTF_ISP %p\n", &tf->tf_isp); 172 printf("#define\tTF_EBX %p\n", &tf->tf_ebx); 173 printf("#define\tTF_EDX %p\n", &tf->tf_edx); 174 printf("#define\tTF_ECX %p\n", &tf->tf_ecx); 175 printf("#define\tTF_EAX %p\n", &tf->tf_eax); 176 printf("#define\tTF_TRAPNO %p\n", &tf->tf_trapno); 177 printf("#define\tTF_ERR %p\n", &tf->tf_err); 178 printf("#define\tTF_EIP %p\n", &tf->tf_eip); 179 printf("#define\tTF_CS %p\n", &tf->tf_cs); 180 printf("#define\tTF_EFLAGS %p\n", &tf->tf_eflags); 181 printf("#define\tTF_ESP %p\n", &tf->tf_esp); 182 printf("#define\tTF_SS %p\n", &tf->tf_ss); 183 184 printf("#define\tSIGF_SIGNUM %p\n", &sigf->sf_signum); 185 printf("#define\tSIGF_CODE %p\n", &sigf->sf_code); 186 printf("#define\tSIGF_SCP %p\n", &sigf->sf_scp); 187 printf("#define\tSIGF_HANDLER %p\n", &sigf->sf_handler); 188 printf("#define\tSIGF_SC %p\n", &sigf->sf_sc); 189 190 printf("#define\tB_READ %d\n", B_READ); 191 printf("#define\tENOENT %d\n", ENOENT); 192 printf("#define\tEFAULT %d\n", EFAULT); 193 printf("#define\tENAMETOOLONG %d\n", ENAMETOOLONG); 194 printf("#define\tMAXPATHLEN %d\n", MAXPATHLEN); 195 196 printf("#define\tBOOTINFO_SIZE %d\n", sizeof *bootinfo); 197 printf("#define\tBI_VERSION %p\n", &bootinfo->bi_version); 198 printf("#define\tBI_KERNELNAME %p\n", &bootinfo->bi_kernelname); 199 printf("#define\tBI_NFS_DISKLESS %p\n", &bootinfo->bi_nfs_diskless); 200 printf("#define\tBI_ENDCOMMON %p\n", &bootinfo->bi_endcommon); 201 printf("#define\tNFSDISKLESS_SIZE %d\n", sizeof(struct nfs_diskless)); 202 printf("#define\tBI_SIZE %p\n", &bootinfo->bi_size); 203 printf("#define\tBI_SYMTAB %p\n", &bootinfo->bi_symtab); 204 printf("#define\tBI_ESYMTAB %p\n", &bootinfo->bi_esymtab); 205 206 printf("#define\tGD_SIZEOF %d\n", sizeof(struct globaldata)); 207 printf("#define\tGD_CURPROC %d\n", &globaldata->curproc); 208 printf("#define\tGD_NPXPROC %d\n", &globaldata->npxproc); 209 printf("#define\tGD_CURPCB %d\n", &globaldata->curpcb); 210 printf("#define\tGD_COMMON_TSS %d\n", &globaldata->common_tss); 211#ifdef VM86 212 printf("#define\tGD_COMMON_TSSD %d\n", &globaldata->common_tssd); 213 printf("#define\tGD_PRIVATE_TSS %d\n", &globaldata->private_tss); 214 printf("#define\tGD_MY_TR %d\n", &globaldata->my_tr); 215#endif 216#ifdef SMP 217 printf("#define\tGD_CPUID %d\n", &globaldata->cpuid); 218 printf("#define\tGD_CPU_LOCKID %d\n", &globaldata->cpu_lockid); 219 printf("#define\tGD_OTHER_CPUS %d\n", &globaldata->other_cpus); 220 printf("#define\tGD_MY_IDLEPTD %d\n", &globaldata->my_idlePTD); 221 printf("#define\tGD_SS_TPR %d\n", &globaldata->ss_tpr); 222 printf("#define\tGD_PRV_CMAP1 %d\n", &globaldata->prv_CMAP1); 223 printf("#define\tGD_PRV_CMAP2 %d\n", &globaldata->prv_CMAP2); 224 printf("#define\tGD_PRV_CMAP3 %d\n", &globaldata->prv_CMAP3); 225 printf("#define\tGD_PRV_PMAP1 %d\n", &globaldata->prv_PMAP1); 226 printf("#define\tGD_INSIDE_INTR %d\n", &globaldata->inside_intr); 227 printf("#define\tPS_GLOBALDATA 0x%x\n", &privatespace->globaldata); 228 printf("#define\tPS_PRVPT 0x%x\n", &privatespace->prvpt); 229 printf("#define\tPS_LAPIC 0x%x\n", &privatespace->lapic); 230 printf("#define\tPS_IDLESTACK 0x%x\n", &privatespace->idlestack); 231 printf("#define\tPS_IDLESTACK_TOP 0x%x\n", &privatespace->CPAGE1); 232 printf("#define\tPS_CPAGE1 0x%x\n", &privatespace->CPAGE1); 233 printf("#define\tPS_CPAGE2 0x%x\n", &privatespace->CPAGE2); 234 printf("#define\tPS_CPAGE3 0x%x\n", &privatespace->CPAGE3); 235 printf("#define\tPS_PPAGE1 0x%x\n", &privatespace->PPAGE1); 236 printf("#define\tPS_IOAPICS 0x%x\n", &privatespace->ioapics); 237#endif 238 239 return (0); 240} 241