Revert to new method of generating assym.h.

This commit is contained in:
leo 1997-03-17 13:23:14 +00:00
parent b315c448dc
commit 2f50159652
3 changed files with 211 additions and 193 deletions

View File

@ -1,180 +0,0 @@
/* $NetBSD: genassym.c,v 1.12 1997/01/03 22:54:25 leo Exp $ */
/*
* Copyright (c) 1982, 1990 The Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)genassym.c 7.8 (Berkeley) 5/7/91
*/
#include <sys/param.h>
#include <sys/buf.h>
#include <sys/proc.h>
#include <sys/mbuf.h>
#include <sys/msgbuf.h>
#include <sys/syscall.h>
#include <sys/user.h>
#include <vm/vm.h>
#include <machine/cpu.h>
#include <machine/trap.h>
#include <machine/psl.h>
#include <machine/reg.h>
#include <machine/vmparam.h>
#include <machine/pte.h>
#include <machine/iomap.h>
#include <machine/scu.h>
#include <stdio.h>
int
main(void)
{
register struct proc *p = (struct proc *)0;
register struct vmmeter *vm = (struct vmmeter *)0;
register struct user *up = (struct user *)0;
struct frame *frame = NULL;
struct vmspace *vms = (struct vmspace *)0;
pmap_t pmap = (pmap_t)0;
struct pcb *pcb = (struct pcb *)0;
struct mdproc *mdproc = (struct mdproc *)0;
printf("#define\tP_FORW %p\n", (void *)&p->p_forw);
printf("#define\tP_BACK %p\n", (void *)&p->p_back);
printf("#define\tP_VMSPACE %p\n", (void *)&p->p_vmspace);
printf("#define\tP_ADDR %p\n", (void *)&p->p_addr);
printf("#define\tP_PRIORITY %p\n", (void *)&p->p_priority);
printf("#define\tP_STAT %p\n", (void *)&p->p_stat);
printf("#define\tP_WCHAN %p\n", (void *)&p->p_wchan);
printf("#define\tP_MD %p\n", (void *)&p->p_md);
printf("#define\tP_PID %p\n", (void *)&p->p_pid);
printf("#define\tMD_REGS %p\n", (void *)&mdproc->md_regs);
printf("#define\tSRUN %d\n", SRUN);
printf("#define\tPM_STCHG %p\n", (void *)&pmap->pm_stchanged);
printf("#define\tVM_PMAP %p\n", (void *)&vms->vm_pmap);
printf("#define\tV_INTR %p\n", (void *)&vm->v_intr);
printf("#define\tUPAGES %d\n", UPAGES);
printf("#define\tUSPACE %d\n", USPACE);
printf("#define\tNBPG %d\n", NBPG);
printf("#define\tPGSHIFT %d\n", PGSHIFT);
printf("#define\tUSRSTACK %d\n", USRSTACK);
printf("#define\tU_PROF %p\n", (void *)&up->u_stats.p_prof);
printf("#define\tU_PROFSCALE %p\n",
(void *)&up->u_stats.p_prof.pr_scale);
printf("#define\tT_BUSERR %d\n", T_BUSERR);
printf("#define\tT_ADDRERR %d\n", T_ADDRERR);
printf("#define\tT_ILLINST %d\n", T_ILLINST);
printf("#define\tT_ZERODIV %d\n", T_ZERODIV);
printf("#define\tT_CHKINST %d\n", T_CHKINST);
printf("#define\tT_TRAPVINST %d\n", T_TRAPVINST);
printf("#define\tT_PRIVINST %d\n", T_PRIVINST);
printf("#define\tT_TRACE %d\n", T_TRACE);
printf("#define\tT_MMUFLT %d\n", T_MMUFLT);
printf("#define\tT_SSIR %d\n", T_SSIR);
printf("#define\tT_FMTERR %d\n", T_FMTERR);
printf("#define\tT_COPERR %d\n", T_COPERR);
printf("#define\tT_FPERR %d\n", T_FPERR);
printf("#define\tT_ASTFLT %d\n", T_ASTFLT);
printf("#define\tT_TRAP15 %d\n", T_TRAP15);
printf("#define\tT_FPEMULI %d\n", T_FPEMULI);
printf("#define\tT_FPEMULD %d\n", T_FPEMULD);
printf("#define\tPSL_S %d\n", PSL_S);
printf("#define\tPSL_IPL7 %d\n", PSL_IPL7);
printf("#define\tPSL_LOWIPL %d\n", PSL_LOWIPL);
printf("#define\tPSL_HIGHIPL %d\n", PSL_HIGHIPL);
printf("#define\tPSL_USER %d\n", PSL_USER);
printf("#define\tSPL1 %d\n", PSL_S | PSL_IPL1);
printf("#define\tSPL2 %d\n", PSL_S | PSL_IPL2);
printf("#define\tSPL3 %d\n", PSL_S | PSL_IPL3);
printf("#define\tSPL4 %d\n", PSL_S | PSL_IPL4);
printf("#define\tSPL5 %d\n", PSL_S | PSL_IPL5);
printf("#define\tSPL6 %d\n", PSL_S | PSL_IPL6);
printf("#define\tFC_USERD %d\n", FC_USERD);
printf("#define\tFC_SUPERD %d\n", FC_SUPERD);
printf("#define\tCACHE_ON %d\n", CACHE_ON);
printf("#define\tCACHE_OFF %d\n", CACHE_OFF);
printf("#define\tCACHE_CLR %d\n", CACHE_CLR);
printf("#define\tIC_CLEAR %d\n", IC_CLEAR);
printf("#define\tDC_CLEAR %d\n", DC_CLEAR);
printf("#define\tCACHE40_ON %d\n", CACHE40_ON);
printf("#define\tCACHE40_OFF %d\n", CACHE40_OFF);
printf("#define\tPG_V %d\n", PG_V);
printf("#define\tPG_NV %d\n", PG_NV);
printf("#define\tPG_RO %d\n", PG_RO);
printf("#define\tPG_RW %d\n", PG_RW);
printf("#define\tPG_CI %d\n", PG_CI);
printf("#define\tPG_PROT %d\n", PG_PROT);
printf("#define\tPG_FRAME %d\n", PG_FRAME);
printf("#define\tSG_V %d\n", SG_V);
printf("#define\tSG_NV %d\n", SG_NV);
printf("#define\tSG_RW %d\n", SG_RW);
printf("#define\tSG_FRAME %d\n", SG_FRAME);
printf("#define\tPCB_FLAGS %p\n", (void *)&pcb->pcb_flags);
printf("#define\tPCB_PS %p\n", (void *)&pcb->pcb_ps);
printf("#define\tPCB_USTP %p\n", (void *)&pcb->pcb_ustp);
printf("#define\tPCB_USP %p\n", (void *)&pcb->pcb_usp);
printf("#define\tPCB_REGS %p\n", (void *)pcb->pcb_regs);
printf("#define\tPCB_CMAP2 %p\n", (void *)&pcb->pcb_cmap2);
printf("#define\tPCB_ONFAULT %p\n", (void *)&pcb->pcb_onfault);
printf("#define\tPCB_FPCTX %p\n", (void *)&pcb->pcb_fpregs);
printf("#define\tSIZEOF_PCB %d\n", sizeof(struct pcb));
printf("#define\tFR_SP %p\n", (void *)&frame->f_regs[15]);
printf("#define\tFR_HW %p\n", (void *)&frame->f_sr);
printf("#define\tFR_ADJ %p\n", (void *)&frame->f_stackadj);
printf("#define\tFR_SIZE %d\n", sizeof(struct trapframe));
printf("#define\tSP %d\n", SP);
printf("#define\tSYS_exit %d\n", SYS_exit);
printf("#define\tSYS_execve %d\n", SYS_execve);
printf("#define\tSYS_sigreturn %d\n", SYS_sigreturn);
printf("#define\tATARI_68020 %ld\n", ATARI_68020);
printf("#define\tATARI_68030 %ld\n", ATARI_68030);
printf("#define\tATARI_68040 %ld\n", ATARI_68040);
printf("#define\tMMU_68030 %d\n", MMU_68030);
printf("#define\tMMU_68851 %d\n", MMU_68851);
printf("#define\tMMU_68040 %d\n", MMU_68040);
printf("#define\tCPU_68020 %d\n", CPU_68020);
printf("#define\tCPU_68030 %d\n", CPU_68030);
printf("#define\tCPU_68040 %d\n", CPU_68040);
stio_addr = 0;
printf("#define\tSCU_SOFTINT %p\n", (void *)&SCU->sys_int);
printf("#define\tSCU_SYSMASK %p\n", (void *)&SCU->sys_mask);
exit(0);
}

View File

@ -0,0 +1,205 @@
# $NetBSD: genassym.cf,v 1.1 1997/03/17 13:23:15 leo Exp $
#-
# Copyright (c) 1997 The NetBSD Foundation, Inc.
# All rights reserved.
#
# This code is derived from software contributed to The NetBSD Foundation
# by Leo Weppelman.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. All advertising materials mentioning features or use of this software
# must display the following acknowledgement:
# This product includes software developed by the NetBSD
# Foundation, Inc. and its contributors.
# 4. Neither the name of The NetBSD Foundation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
include <sys/param.h>
include <sys/buf.h>
include <sys/proc.h>
include <sys/mbuf.h>
include <sys/msgbuf.h>
include <sys/syscall.h>
include <sys/user.h>
include <vm/vm.h>
include <machine/cpu.h>
include <machine/trap.h>
include <machine/psl.h>
include <machine/reg.h>
include <machine/vmparam.h>
include <machine/pte.h>
include <machine/iomap.h>
include <machine/scu.h>
define _XXX_CIRCUMVENT_BUG 1
# CPU options
ifdef M68020
define M68020 1
endif
ifdef M68030
define M68030 1
endif
ifdef M68040
define M68040 1
endif
ifdef M68060
define M68060 1
endif
# proc fields and values
define P_FORW offsetof(struct proc, p_forw)
define P_BACK offsetof(struct proc, p_back)
define P_VMSPACE offsetof(struct proc, p_vmspace)
define P_ADDR offsetof(struct proc, p_addr)
define P_PRIORITY offsetof(struct proc, p_priority)
define P_STAT offsetof(struct proc, p_stat)
define P_WCHAN offsetof(struct proc, p_wchan)
define P_MD offsetof(struct proc, p_md)
define P_PID offsetof(struct proc, p_pid)
define MD_REGS offsetof(struct mdproc, md_regs)
define SRUN SRUN
# pmap defines
define PM_STCHG offsetof(struct pmap, pm_stchanged)
# VM structure fields
define VM_PMAP offsetof(struct vmspace, vm_pmap)
# interrupt/fault metering
define V_INTR offsetof(struct vmmeter, v_intr)
# general constants
define UPAGES UPAGES
define USPACE USPACE
define NBPG NBPG
define PGSHIFT PGSHIFT
define USRSTACK USRSTACK
# profiling
define U_PROF offsetof(struct user, u_stats.p_prof)
define U_PROFSCALE offsetof(struct user, u_stats.p_prof.pr_scale)
define T_BUSERR T_BUSERR
define T_ADDRERR T_ADDRERR
define T_ILLINST T_ILLINST
define T_ZERODIV T_ZERODIV
define T_CHKINST T_CHKINST
define T_TRAPVINST T_TRAPVINST
define T_PRIVINST T_PRIVINST
define T_TRACE T_TRACE
define T_MMUFLT T_MMUFLT
define T_SSIR T_SSIR
define T_FMTERR T_FMTERR
define T_COPERR T_COPERR
define T_FPERR T_FPERR
define T_ASTFLT T_ASTFLT
define T_TRAP15 T_TRAP15
define T_FPEMULI T_FPEMULI
define T_FPEMULD T_FPEMULD
# PSL values
define PSL_S PSL_S
define PSL_IPL7 PSL_IPL7
define PSL_LOWIPL PSL_LOWIPL
define PSL_HIGHIPL PSL_HIGHIPL
define PSL_USER PSL_USER
define SPL1 PSL_S | PSL_IPL1
define SPL2 PSL_S | PSL_IPL2
define SPL3 PSL_S | PSL_IPL3
define SPL4 PSL_S | PSL_IPL4
define SPL5 PSL_S | PSL_IPL5
define SPL6 PSL_S | PSL_IPL6
# Various MMU/cache related constants
define FC_USERD FC_USERD
define FC_SUPERD FC_SUPERD
define CACHE_ON CACHE_ON
define CACHE_OFF CACHE_OFF
define CACHE_CLR CACHE_CLR
define IC_CLEAR IC_CLEAR
define DC_CLEAR DC_CLEAR
define CACHE40_ON CACHE40_ON
define CACHE40_OFF CACHE40_OFF
# pte/ste bits
define PG_V PG_V
define PG_NV PG_NV
define PG_RO PG_RO
define PG_RW PG_RW
define PG_CI PG_CI
define PG_PROT PG_PROT
define PG_FRAME PG_FRAME
define SG_V SG_V
define SG_NV SG_NV
define SG_RW SG_RW
define SG_FRAME SG_FRAME
# pcb fields
define PCB_FLAGS offsetof(struct pcb, pcb_flags)
define PCB_PS offsetof(struct pcb, pcb_ps)
define PCB_USTP offsetof(struct pcb, pcb_ustp)
define PCB_USP offsetof(struct pcb, pcb_usp)
define PCB_REGS offsetof(struct pcb, pcb_regs)
define PCB_CMAP2 offsetof(struct pcb, pcb_cmap2)
define PCB_ONFAULT offsetof(struct pcb, pcb_onfault)
define PCB_FPCTX offsetof(struct pcb, pcb_fpregs)
define SIZEOF_PCB sizeof(struct pcb)
# exception frame offset/sizes
define FR_SP offsetof(struct frame, f_regs[15])
define FR_HW offsetof(struct frame, f_sr)
define FR_ADJ offsetof(struct frame, f_stackadj)
define FR_SIZE sizeof(struct trapframe)
define SP SP
# system calls
define SYS_exit SYS_exit
define SYS_execve SYS_execve
define SYS_sigreturn SYS_sigreturn
# processor type from loader
define ATARI_68020 ATARI_68020
define ATARI_68030 ATARI_68030
define ATARI_68040 ATARI_68040
# values for mmutype
define MMU_68030 MMU_68030
define MMU_68851 MMU_68851
define MMU_68040 MMU_68040
# values for cputype
define CPU_68020 CPU_68020
define CPU_68030 CPU_68030
define CPU_68040 CPU_68040
define CPU_68060 CPU_68060
# AD_SCU definition needs this...
quote #define stio_addr 0
define SCU_SOFTINT AD_SCU + offsetof(struct scu, sys_int)
define SCU_SYSMASK AD_SCU + offsetof(struct scu, sys_mask)

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.atari,v 1.30 1997/03/14 23:27:29 mycroft Exp $
# $NetBSD: Makefile.atari,v 1.31 1997/03/17 13:24:37 leo Exp $
# Makefile for NetBSD
#
@ -104,14 +104,9 @@ LINKFLAGS+= -S
%LOAD
assym.h: genassym
./genassym >assym.h
genassym: genassym.o
${CC} -o $@ genassym.o
genassym.o: ${ATARI}/atari/genassym.c
${HOSTED_C}
assym.h: ${ATARI}/atari/genassym.cf $S/kern/genassym.sh
sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} \
< ${ATARI}/atari/genassym.cf >assym.h || rm assym.h
param.c: $S/conf/param.c
rm -f param.c
@ -131,7 +126,7 @@ newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
clean: cleankernel
cleankernel:
rm -f eddep *netbsd netbsd.gdb tags *.[io] [a-z]*.s \
[Ee]rrs linterrs makelinks genassym genassym.o assym.h
[Ee]rrs linterrs makelinks assym.h
lint:
@lint -hbxncez -Dvolatile= ${CPPFLAGS} -UKGDB \
@ -157,8 +152,6 @@ depend: .depend
${MKDEP} ${AFLAGS} ${CPPFLAGS} ${ATARI}/atari/locore.s
${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
${MKDEP} -a ${HOSTED_CFLAGS} ${HOSTED_CPPFLAGS} \
${ATARI}/atari/genassym.c
# depend on root or device configuration
@ -168,7 +161,7 @@ autoconf.o conf.o: Makefile
uipc_proto.o vfs_conf.o: Makefile
# depend on maxusers
genassym.o machdep.o: Makefile
machdep.o: Makefile
# depend on CPU configuration
locore.o pmap.o sys_machdep.o: Makefile