genassym.c revision 25648
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.45 1997/04/26 11:45:06 peter Exp $ 38 */ 39 40#include <stdio.h> 41#include <sys/param.h> 42#include <sys/buf.h> 43#include <sys/errno.h> 44#include <sys/proc.h> 45#include <sys/mount.h> 46#include <sys/socket.h> 47#include <sys/resource.h> 48#include <sys/resourcevar.h> 49#include <machine/frame.h> 50#include <machine/bootinfo.h> 51#include <machine/tss.h> 52#include <sys/vmmeter.h> 53#include <vm/vm.h> 54#include <vm/vm_param.h> 55#include <sys/lock.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 68extern int main __P((void)); 69 70int 71main() 72{ 73 struct proc *p = (struct proc *)0; 74 struct vmmeter *vm = (struct vmmeter *)0; 75 struct user *up = (struct user *)0; 76 struct rusage *rup = (struct rusage *)0; 77 struct uprof *uprof = (struct uprof *)0; 78 struct vmspace *vms = (struct vmspace *)0; 79 struct pcb *pcb = (struct pcb *)0; 80 struct i386tss *tss = (struct i386tss *)0; 81 struct trapframe *tf = (struct trapframe *)0; 82 struct sigframe *sigf = (struct sigframe *)0; 83 struct bootinfo *bootinfo = (struct bootinfo *)0; 84 85 printf("#define\tP_FORW %p\n", &p->p_procq.tqe_next); 86 printf("#define\tP_BACK %p\n", &p->p_procq.tqe_prev); 87 printf("#define\tP_VMSPACE %p\n", &p->p_vmspace); 88 printf("#define\tVM_PMAP %p\n", &vms->vm_pmap); 89 printf("#define\tP_ADDR %p\n", &p->p_addr); 90 printf("#define\tP_PRI %p\n", &p->p_priority); 91 printf("#define\tP_RTPRIO_TYPE %p\n", &p->p_rtprio.type); 92 printf("#define\tP_RTPRIO_PRIO %p\n", &p->p_rtprio.prio); 93 printf("#define\tP_STAT %p\n", &p->p_stat); 94 printf("#define\tP_WCHAN %p\n", &p->p_wchan); 95 printf("#define\tP_FLAG %p\n", &p->p_flag); 96 printf("#define\tP_PID %p\n", &p->p_pid); 97#ifdef SMP 98 printf("#define\tP_ONCPU %p\n", &p->p_oncpu); 99 printf("#define\tP_LASTCPU %p\n", &p->p_lastcpu); 100#endif 101 printf("#define\tSSLEEP %d\n", SSLEEP); 102 printf("#define\tSRUN %d\n", SRUN); 103 printf("#define\tV_TRAP %p\n", &vm->v_trap); 104 printf("#define\tV_SYSCALL %p\n", &vm->v_syscall); 105 printf("#define\tV_INTR %p\n", &vm->v_intr); 106 printf("#define\tUPAGES %d\n", UPAGES); 107 printf("#define\tPAGE_SIZE %d\n", PAGE_SIZE); 108 printf("#define\tNPTEPG %d\n", NPTEPG); 109 printf("#define\tNPDEPG %d\n", NPDEPG); 110 printf("#define\tPDESIZE %d\n", PDESIZE); 111 printf("#define\tPTESIZE %d\n", PTESIZE); 112 printf("#define\tNKPDE %d\n", NKPDE); 113 printf("#define\tNKPT %d\n", NKPT); 114 printf("#define\tPAGE_SHIFT %d\n", PAGE_SHIFT); 115 printf("#define\tPAGE_MASK %d\n", PAGE_MASK); 116 printf("#define\tPDRSHIFT %d\n", PDRSHIFT); 117 printf("#define\tUSRSTACK 0x%lx\n", USRSTACK); 118 printf("#define\tVM_MAXUSER_ADDRESS 0x%lx\n", VM_MAXUSER_ADDRESS); 119 printf("#define\tKERNBASE 0x%x\n", KERNBASE); 120 printf("#define\tMCLBYTES %d\n", MCLBYTES); 121 printf("#define\tPCB_CR3 %p\n", &pcb->pcb_cr3); 122 printf("#define\tPCB_EDI %p\n", &pcb->pcb_edi); 123 printf("#define\tPCB_ESI %p\n", &pcb->pcb_esi); 124 printf("#define\tPCB_EBP %p\n", &pcb->pcb_ebp); 125 printf("#define\tPCB_ESP %p\n", &pcb->pcb_esp); 126 printf("#define\tPCB_EBX %p\n", &pcb->pcb_ebx); 127 printf("#define\tPCB_EIP %p\n", &pcb->pcb_eip); 128 printf("#define\tTSS_ESP0 %p\n", &tss->tss_esp0); 129 printf("#define\tPCB_USERLDT %p\n", &pcb->pcb_ldt); 130#ifdef SMP 131 printf("#define\tPCB_MPNEST %p\n", &pcb->pcb_mpnest); 132#endif 133 printf("#define\tU_PROF %p\n", &up->u_stats.p_prof); 134 printf("#define\tU_PROFSCALE %p\n", &up->u_stats.p_prof.pr_scale); 135 printf("#define\tPR_BASE %p\n", &uprof->pr_base); 136 printf("#define\tPR_SIZE %p\n", &uprof->pr_size); 137 printf("#define\tPR_OFF %p\n", &uprof->pr_off); 138 printf("#define\tPR_SCALE %p\n", &uprof->pr_scale); 139 printf("#define\tRU_MINFLT %p\n", &rup->ru_minflt); 140 printf("#define\tPCB_FLAGS %p\n", &pcb->pcb_flags); 141 printf("#define\tPCB_SAVEFPU %p\n", &pcb->pcb_savefpu); 142 printf("#define\tPCB_SAVEFPU_SIZE %d\n", sizeof pcb->pcb_savefpu); 143 printf("#define\tPCB_ONFAULT %p\n", &pcb->pcb_onfault); 144 145 printf("#define\tTF_ES %p\n", &tf->tf_es); 146 printf("#define\tTF_DS %p\n", &tf->tf_ds); 147 printf("#define\tTF_EDI %p\n", &tf->tf_edi); 148 printf("#define\tTF_ESI %p\n", &tf->tf_esi); 149 printf("#define\tTF_EBP %p\n", &tf->tf_ebp); 150 printf("#define\tTF_ISP %p\n", &tf->tf_isp); 151 printf("#define\tTF_EBX %p\n", &tf->tf_ebx); 152 printf("#define\tTF_EDX %p\n", &tf->tf_edx); 153 printf("#define\tTF_ECX %p\n", &tf->tf_ecx); 154 printf("#define\tTF_EAX %p\n", &tf->tf_eax); 155 printf("#define\tTF_TRAPNO %p\n", &tf->tf_trapno); 156 printf("#define\tTF_ERR %p\n", &tf->tf_err); 157 printf("#define\tTF_EIP %p\n", &tf->tf_eip); 158 printf("#define\tTF_CS %p\n", &tf->tf_cs); 159 printf("#define\tTF_EFLAGS %p\n", &tf->tf_eflags); 160 printf("#define\tTF_ESP %p\n", &tf->tf_esp); 161 printf("#define\tTF_SS %p\n", &tf->tf_ss); 162 163 printf("#define\tSIGF_SIGNUM %p\n", &sigf->sf_signum); 164 printf("#define\tSIGF_CODE %p\n", &sigf->sf_code); 165 printf("#define\tSIGF_SCP %p\n", &sigf->sf_scp); 166 printf("#define\tSIGF_HANDLER %p\n", &sigf->sf_handler); 167 printf("#define\tSIGF_SC %p\n", &sigf->sf_sc); 168 169 printf("#define\tB_READ %d\n", B_READ); 170 printf("#define\tENOENT %d\n", ENOENT); 171 printf("#define\tEFAULT %d\n", EFAULT); 172 printf("#define\tENAMETOOLONG %d\n", ENAMETOOLONG); 173 printf("#define\tMAXPATHLEN %d\n", MAXPATHLEN); 174 175 printf("#define\tBOOTINFO_SIZE %d\n", sizeof *bootinfo); 176 printf("#define\tBI_VERSION %p\n", &bootinfo->bi_version); 177 printf("#define\tBI_KERNELNAME %p\n", &bootinfo->bi_kernelname); 178 printf("#define\tBI_NFS_DISKLESS %p\n", &bootinfo->bi_nfs_diskless); 179 printf("#define\tBI_ENDCOMMON %p\n", &bootinfo->bi_endcommon); 180 printf("#define\tNFSDISKLESS_SIZE %d\n", sizeof(struct nfs_diskless)); 181 printf("#define\tBI_SIZE %p\n", &bootinfo->bi_size); 182 printf("#define\tBI_SYMTAB %p\n", &bootinfo->bi_symtab); 183 printf("#define\tBI_ESYMTAB %p\n", &bootinfo->bi_esymtab); 184 185 return (0); 186} 187