+++ /dev/null
-/* $OpenBSD: genassym.c,v 1.8 1997/02/21 08:59:01 niklas Exp $ */
-/* $NetBSD: genassym.c,v 1.29 1996/12/17 07:32:55 is 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 <stdio.h>
-#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 <amiga/amiga/cia.h>
-#include <amiga/amiga/isr.h>
-
-int main __P((void));
-
-int
-main()
-{
- 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 CIA *cia = (struct CIA *)0;
- struct isr *isr = (struct isr *)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_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\tPSL_S %d\n", PSL_S);
- printf("#define\tPSL_IPL7 %d\n", PSL_IPL7);
- printf("#define\tPSL_IPL %d\n", PSL_IPL);
- 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\tCACHE60_ON %d\n", CACHE60_ON);
- printf("#define\tCACHE60_OFF %d\n", CACHE60_OFF);
- printf("#define\tIC60_CUBC %d\n", IC60_CUBC);
- printf("#define\tIC60_CABC %d\n", IC60_CABC);
- 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\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\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\tCIAICR %p\n", (void *)&cia->icr);
- printf("#define\tAMIGA_68020 %ld\n", AMIGA_68020);
- printf("#define\tAMIGA_68030 %ld\n", AMIGA_68030);
- printf("#define\tAMIGA_68040 %ld\n", AMIGA_68040);
- printf("#define\tAMIGA_68060 %ld\n", AMIGA_68060);
- printf("#define\tISR_FORW %p\n", (void *)&isr->isr_forw);
- printf("#define\tISR_INTR %p\n", (void *)&isr->isr_intr);
- printf("#define\tISR_ARG %p\n", (void *)&isr->isr_arg);
- printf("#define\tMMU_68030 %d\n", MMU_68030);
- printf("#define\tMMU_68040 %d\n", MMU_68040);
- printf("#define\tMMU_68060 %d\n", MMU_68060);
- printf("#define\tMMU_68851 %d\n", MMU_68851);
- printf("#define\tCPU_68020 %d\n", CPU_68020);
- printf("#define\tCPU_68030 %d\n", CPU_68030);
- printf("#define\tCPU_68040 %d\n", CPU_68040);
- printf("#define\tCPU_68060 %d\n", CPU_68060);
-#ifdef DRACO
- printf("#define\tDRACO %d\n", DRACO);
-#endif
-
- exit(0);
-}
--- /dev/null
+# $OpenBSD: genassym.cf,v 1.1 1997/03/27 11:52:07 niklas 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 <amiga/amiga/cia.h>
+include <amiga/amiga/isr.h>
+
+# values for mmutype
+define MMU_68060 MMU_68060
+define MMU_68040 MMU_68040
+define MMU_68030 MMU_68030
+define MMU_68851 MMU_68851
+
+# values for cputype
+define CPU_68020 CPU_68020
+define CPU_68030 CPU_68030
+define CPU_68040 CPU_68040
+define CPU_68060 CPU_68060
+
+# values for machineid
+define AMIGA_68020 AMIGA_68020
+define AMIGA_68030 AMIGA_68030
+define AMIGA_68040 AMIGA_68040
+define AMIGA_68060 AMIGA_68060
+
+# 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_PID offsetof(struct proc, p_pid)
+define P_MD_REGS offsetof(struct proc, p_md.md_regs)
+
+define SRUN SRUN
+
+# VM structure fields
+define VM_PMAP offsetof(struct vmspace, vm_pmap)
+define PM_STCHG offsetof(struct pmap, pm_stchanged)
+
+# interrupt/fault metering
+define V_INTR offsetof(struct vmmeter, v_intr)
+
+# PSL values (should just include psl.h?)
+define PSL_S PSL_S
+define PSL_IPL7 PSL_IPL7
+define PSL_IPL PSL_IPL
+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
+
+# magic
+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
+define CACHE60_ON CACHE60_ON
+define CACHE60_OFF CACHE60_OFF
+define IC60_CUBC IC60_CUBC
+define IC60_CABC IC60_CABC
+
+# 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
+
+# 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)
+
+# system calls
+define SYS_exit SYS_exit
+define SYS_execve SYS_execve
+define SYS_sigreturn SYS_sigreturn
+
+# Various constants
+define UPAGES UPAGES
+define USPACE USPACE
+define NBPG NBPG
+define PGSHIFT PGSHIFT
+define USRSTACK USRSTACK
+#ifdef DRACO
+define DRACO DRACO
+#endif
+
+# user fields
+define U_PROF offsetof(struct user, u_stats.p_prof)
+define U_PROFSCALE offsetof(struct user, u_stats.p_prof.pr_scale)
+
+# Traps
+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_FMTERR T_FMTERR
+define T_COPERR T_COPERR
+define T_FPERR T_FPERR
+define T_ASTFLT T_ASTFLT
+define T_TRAP15 T_TRAP15
+
+# Custom chip registers
+define CIAICR offsetof(struct CIA, icr)
+
+# Interrupt service routine entry fields
+define ISR_FORW offsetof(struct isr, isr_forw)
+define ISR_INTR offsetof(struct isr, isr_intr)
+define ISR_ARG offsetof(struct isr, isr_arg)
-# $OpenBSD: Makefile.amiga,v 1.18 1997/02/21 11:17:38 niklas Exp $
+# $OpenBSD: Makefile.amiga,v 1.19 1997/03/27 11:52:07 niklas Exp $
# $NetBSD: Makefile.amiga,v 1.52 1996/12/01 12:10:07 veego Exp $
# Makefile for OpenBSD
INCLUDES= -nostdinc -I. -I$S/arch -I$S
CPPFLAGS= ${INCLUDES} ${IDENT} -D_KERNEL -Dmc68020 -Damiga
-CWARNFLAGS= -Werror -Wall -Wstrict-prototypes -Wno-uninitialized \
- -Wno-format
+CWARNFLAGS= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \
+ -Wno-uninitialized -Wno-format
.if empty(IDENT:M-DM68060)
CMACHFLAGS= -m68020
NORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
NORMAL_C_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} ${PARAM} -c $<
-HOSTED_C= ${HOSTCC} ${HOSTED_CFLAGS} ${HOSTED_CPPFLAGS} ${PARAM} -c $<
-
DRIVER_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
DRIVER_C_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} ${PARAM} -c $<
%LOAD
-assym.h: genassym
- ./genassym >assym.h
-
-genassym: genassym.o
- ${HOSTCC} -o $@ genassym.o
-
-genassym.o: ${AMIGA}/amiga/genassym.c
- ${HOSTED_C}
+assym.h: $S/kern/genassym.sh ${AMIGA}/amiga/genassym.cf
+ sh $S/kern/genassym.sh ${HOSTCC} ${HOSTED_CFLAGS} ${HOSTED_CPPFLAGS} \
+ ${PARAM} < ${AMIGA}/amiga/genassym.cf > assym.h.tmp && \
+ mv -f assym.h.tmp assym.h
param.c: $S/conf/param.c
rm -f param.c
links:
egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
- sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
+ sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
- sort -u | comm -23 - dontlink | \
- sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks
+ sort -u | comm -23 - dontlink | \
+ sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' \
+ > makelinks
sh makelinks && rm -f dontlink
SRCS= ${AMIGA}/amiga/locore.s \
param.c ioconf.c ${CFILES} ${SFILES}
+
depend:: .depend
.depend: ${SRCS} assym.h param.c
${MKDEP} ${AFLAGS} ${CPPFLAGS} ${AMIGA}/amiga/locore.s
${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
- ${MKDEP} -a ${HOSTED_CFLAGS} ${HOSTED_CPPFLAGS} \
- ${AMIGA}/amiga/genassym.c
-
# depend on root or device configuration
autoconf.o conf.o: Makefile
uipc_proto.o vfs_conf.o: Makefile
# depend on maxusers
-genassym.o machdep.o: Makefile
+assym.h machdep.o: Makefile
# depend on CPU configuration
amiga_init.o locore.o pmap.o sys_machdep.o bzsc.o flsc.o sbic.o sfas.o: Makefile