summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2001-05-20 05:51:23 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2001-05-20 05:51:23 +0000
commit602b44e1d5329ac5abc3e84f2998f33e76f87e6f (patch)
treeb0c67b5c2356a66f404c81be91f917bf975f7bd0 /sys/arch
parent27df6c36898d66192955d6b3aa4dc8c801b8cd2b (diff)
Replace genassym.c with a .cf one; also remove unused defines.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/mvme88k/mvme88k/genassym.c170
-rw-r--r--sys/arch/mvme88k/mvme88k/genassym.cf138
2 files changed, 138 insertions, 170 deletions
diff --git a/sys/arch/mvme88k/mvme88k/genassym.c b/sys/arch/mvme88k/mvme88k/genassym.c
deleted file mode 100644
index 03424bd3615..00000000000
--- a/sys/arch/mvme88k/mvme88k/genassym.c
+++ /dev/null
@@ -1,170 +0,0 @@
-/* $OpenBSD: genassym.c,v 1.8 2001/04/10 01:12:39 miod 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
- * $Id: genassym.c,v 1.8 2001/04/10 01:12:39 miod Exp $
- */
-
-#include <sys/param.h>
-#include <sys/buf.h>
-#include <sys/time.h>
-#include <sys/proc.h>
-#include <sys/mbuf.h>
-#include <sys/msgbuf.h>
-#include <machine/cpu.h>
-#include <machine/trap.h>
-#include <machine/psl.h>
-#include <machine/vmparam.h>
-#include <sys/syscall.h>
-#include <sys/user.h>
-
-#define pair(TOKEN, ELEMENT) \
- printf("#define " TOKEN " %u\n", (unsigned)(ELEMENT))
-
-#define int_offset_of_element(ELEMENT) (((unsigned)&(ELEMENT))/sizeof(int))
-
-main()
-{
- register struct proc *p = (struct proc *)0;
- struct m88100_saved_state *ss = (struct m88100_saved_state *) 0;
- struct pcb *pcb = (struct pcb *)0;
- struct m88100_pcb *ks = (struct m88100_pcb *)0;
-
- printf("#ifndef __GENASSYM_INCLUDED\n");
- printf("#define __GENASSYM_INCLUDED 1\n\n");
-
- printf("#define\tP_FORW %d\n", &p->p_forw);
- printf("#define\tP_BACK %d\n", &p->p_back);
- printf("#define\tP_ADDR %d\n", &p->p_addr);
- printf("#define\tP_STAT %d\n", &p->p_stat);
- printf("#define\tP_WCHAN %d\n", &p->p_wchan);
- printf("#define\tSRUN %d\n", SRUN);
- printf("#define\tUPAGES %d\n", UPAGES);
- printf("#define\tUSIZE %d\n", USPACE);
- printf("#define\tNBPG %d\n", NBPG);
-
- printf("#define\tPCB_ONFAULT %d\n", &pcb->pcb_onfault);
-
- printf("#define\tPCB_USER_STATE %d\n", &pcb->user_state);
-
- printf("#define\tSYS_exit %d\n", SYS_exit);
- printf("#define\tSYS_sigreturn %d\n", SYS_sigreturn);
-
- pair("EF_R0", int_offset_of_element(ss->r[0]));
- pair("EF_R31", int_offset_of_element(ss->r[31]));
- pair("EF_FPSR", int_offset_of_element(ss->fpsr));
- pair("EF_FPCR", int_offset_of_element(ss->fpcr));
- pair("EF_EPSR", int_offset_of_element(ss->epsr));
- pair("EF_SXIP", int_offset_of_element(ss->sxip));
- pair("EF_SFIP", int_offset_of_element(ss->sfip));
- pair("EF_EXIP", int_offset_of_element(ss->sxip)); /* MVME197 */
- pair("EF_EFIP", int_offset_of_element(ss->sfip)); /* MVME197 */
- pair("EF_SNIP", int_offset_of_element(ss->snip));
- pair("EF_SSBR", int_offset_of_element(ss->ssbr));
- pair("EF_DMT0", int_offset_of_element(ss->dmt0));
- pair("EF_DMD0", int_offset_of_element(ss->dmd0));
- pair("EF_DMA0", int_offset_of_element(ss->dma0));
- pair("EF_DMT1", int_offset_of_element(ss->dmt1));
- pair("EF_DMD1", int_offset_of_element(ss->dmd1));
- pair("EF_DMA1", int_offset_of_element(ss->dma1));
- pair("EF_DMT2", int_offset_of_element(ss->dmt2));
- pair("EF_DMD2", int_offset_of_element(ss->dmd2));
- pair("EF_DMA2", int_offset_of_element(ss->dma2));
- pair("EF_FPECR",int_offset_of_element(ss->fpecr));
- pair("EF_FPCR", int_offset_of_element(ss->fpcr)); /* MVME197 */
- pair("EF_FPSR", int_offset_of_element(ss->fpsr)); /* MVME197 */
- pair("EF_FPHS1",int_offset_of_element(ss->fphs1));
- pair("EF_FPLS1",int_offset_of_element(ss->fpls1));
- pair("EF_FPHS2",int_offset_of_element(ss->fphs2));
- pair("EF_FPLS2",int_offset_of_element(ss->fpls2));
- pair("EF_FPPT", int_offset_of_element(ss->fppt));
- pair("EF_FPRH", int_offset_of_element(ss->fprh));
- pair("EF_FPRL", int_offset_of_element(ss->fprl));
- pair("EF_FPIT", int_offset_of_element(ss->fpit));
- pair("EF_VECTOR",int_offset_of_element(ss->vector));
- pair("EF_MASK", int_offset_of_element(ss->mask));
- pair("EF_MODE", int_offset_of_element(ss->mode));
-
- pair("EF_RET", int_offset_of_element(ss->scratch1));
- pair("EF_IPFSR",int_offset_of_element(ss->ipfsr));
- pair("EF_DPFSR",int_offset_of_element(ss->dpfsr));
- pair("EF_DSR", int_offset_of_element(ss->dsr)); /* MVME197 */
- pair("EF_DLAR", int_offset_of_element(ss->dlar)); /* MVME197 */
- pair("EF_DPAR", int_offset_of_element(ss->dpar)); /* MVME197 */
- pair("EF_ISR", int_offset_of_element(ss->dsr)); /* MVME197 */
- pair("EF_ILAR", int_offset_of_element(ss->ilar)); /* MVME197 */
- pair("EF_IPAR", int_offset_of_element(ss->ipar)); /* MVME197 */
- pair("EF_SRX", int_offset_of_element(ss->dpfsr));
- pair("EF_CPU", int_offset_of_element(ss->cpu)); /* cpu number */
- pair("EF_NREGS",sizeof(*ss)/sizeof(int));
-
-/* end MVME197 only */
-
- /* make a sanity check */
- if (sizeof(*ss) & 7)
- {
- /*
- * This contortion using write instead of fputs(stderr)
- * is necessary because we can't include stdio.h in here.
- */
- static char buf[] =
- "Exception frame not a multiple of double words\n";
- write(2 /* stderr */,buf,sizeof(buf));
- exit(1);
- }
- pair("SIZEOF_EF", sizeof(*ss));
-
- pair("PCB_PC", int_offset_of_element(ks->pcb_pc) * 4);
- pair("PCB_IPL", int_offset_of_element(ks->pcb_ipl) * 4);
- pair("PCB_R14", int_offset_of_element(ks->pcb_r14) * 4);
- pair("PCB_R15", int_offset_of_element(ks->pcb_r15) * 4);
- pair("PCB_R16", int_offset_of_element(ks->pcb_r16) * 4);
- pair("PCB_R17", int_offset_of_element(ks->pcb_r17) * 4);
- pair("PCB_R18", int_offset_of_element(ks->pcb_r18) * 4);
- pair("PCB_R19", int_offset_of_element(ks->pcb_r19) * 4);
- pair("PCB_R20", int_offset_of_element(ks->pcb_r20) * 4);
- pair("PCB_R21", int_offset_of_element(ks->pcb_r21) * 4);
- pair("PCB_R22", int_offset_of_element(ks->pcb_r22) * 4);
- pair("PCB_R23", int_offset_of_element(ks->pcb_r23) * 4);
- pair("PCB_R24", int_offset_of_element(ks->pcb_r24) * 4);
- pair("PCB_R25", int_offset_of_element(ks->pcb_r25) * 4);
- pair("PCB_R26", int_offset_of_element(ks->pcb_r26) * 4);
- pair("PCB_R27", int_offset_of_element(ks->pcb_r27) * 4);
- pair("PCB_R28", int_offset_of_element(ks->pcb_r28) * 4);
- pair("PCB_R29", int_offset_of_element(ks->pcb_r29) * 4);
- pair("PCB_R30", int_offset_of_element(ks->pcb_r30) * 4);
- pair("PCB_SP", int_offset_of_element(ks->pcb_sp) * 4);
-
- printf("\n#endif /* __GENASSYM_INCLUDED */\n");
- exit(0);
-}
diff --git a/sys/arch/mvme88k/mvme88k/genassym.cf b/sys/arch/mvme88k/mvme88k/genassym.cf
new file mode 100644
index 00000000000..938cd561c9e
--- /dev/null
+++ b/sys/arch/mvme88k/mvme88k/genassym.cf
@@ -0,0 +1,138 @@
+# $OpenBSD: genassym.cf,v 1.1 2001/05/20 05:51:22 miod 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
+# $Id: genassym.cf,v 1.1 2001/05/20 05:51:22 miod Exp $
+#
+
+include <sys/param.h>
+include <sys/buf.h>
+include <sys/time.h>
+include <sys/proc.h>
+include <sys/mbuf.h>
+include <sys/msgbuf.h>
+include <machine/cpu.h>
+include <machine/trap.h>
+include <machine/psl.h>
+include <machine/vmparam.h>
+include <sys/syscall.h>
+include <sys/user.h>
+
+# proc fields and values
+define P_FORW offsetof(struct proc, p_forw)
+define P_BACK offsetof(struct proc, p_back)
+define P_ADDR offsetof(struct proc, p_addr)
+define P_STAT offsetof(struct proc, p_stat)
+define P_WCHAN offsetof(struct proc, p_wchan)
+
+define SRUN SRUN
+
+# general constants
+define UPAGES UPAGES
+define USIZE USPACE
+define NBPG NBPG
+
+# pcb fields
+define PCB_ONFAULT offsetof(struct pcb, pcb_onfault)
+define PCB_USER_STATE offsetof(struct pcb, user_state)
+
+# system calls
+define SYS_exit SYS_exit
+define SYS_sigreturn SYS_sigreturn
+
+# m88100_saved_state element indexes
+define EF_R0 offsetof(struct m88100_saved_state, r[0]) / sizeof(int)
+define EF_FPSR offsetof(struct m88100_saved_state, fpsr) / sizeof(int)
+define EF_FPCR offsetof(struct m88100_saved_state, fpcr) / sizeof(int)
+define EF_EPSR offsetof(struct m88100_saved_state, epsr) / sizeof(int)
+define EF_SXIP offsetof(struct m88100_saved_state, sxip) / sizeof(int)
+define EF_SFIP offsetof(struct m88100_saved_state, sfip) / sizeof(int)
+define EF_SNIP offsetof(struct m88100_saved_state, snip) / sizeof(int)
+define EF_SSBR offsetof(struct m88100_saved_state, ssbr) / sizeof(int)
+define EF_DMT0 offsetof(struct m88100_saved_state, dmt0) / sizeof(int)
+define EF_DMD0 offsetof(struct m88100_saved_state, dmd0) / sizeof(int)
+define EF_DMA0 offsetof(struct m88100_saved_state, dma0) / sizeof(int)
+define EF_DMT1 offsetof(struct m88100_saved_state, dmt1) / sizeof(int)
+define EF_DMD1 offsetof(struct m88100_saved_state, dmd1) / sizeof(int)
+define EF_DMA1 offsetof(struct m88100_saved_state, dma1) / sizeof(int)
+define EF_DMT2 offsetof(struct m88100_saved_state, dmt2) / sizeof(int)
+define EF_DMD2 offsetof(struct m88100_saved_state, dmd2) / sizeof(int)
+define EF_DMA2 offsetof(struct m88100_saved_state, dma2) / sizeof(int)
+define EF_FPECR offsetof(struct m88100_saved_state, fpecr) / sizeof(int)
+define EF_FPCR offsetof(struct m88100_saved_state, fpcr) / sizeof(int)
+define EF_FPSR offsetof(struct m88100_saved_state, fpsr) / sizeof(int)
+define EF_FPHS1 offsetof(struct m88100_saved_state, fphs1) / sizeof(int)
+define EF_FPLS1 offsetof(struct m88100_saved_state, fpls1) / sizeof(int)
+define EF_FPHS2 offsetof(struct m88100_saved_state, fphs2) / sizeof(int)
+define EF_FPLS2 offsetof(struct m88100_saved_state, fpls2) / sizeof(int)
+define EF_FPPT offsetof(struct m88100_saved_state, fppt) / sizeof(int)
+define EF_FPRH offsetof(struct m88100_saved_state, fprh) / sizeof(int)
+define EF_FPRL offsetof(struct m88100_saved_state, fprl) / sizeof(int)
+define EF_FPIT offsetof(struct m88100_saved_state, fpit) / sizeof(int)
+define EF_VECTOR offsetof(struct m88100_saved_state, vector) / sizeof(int)
+define EF_MASK offsetof(struct m88100_saved_state, mask) / sizeof(int)
+define EF_MODE offsetof(struct m88100_saved_state, mode) / sizeof(int)
+define EF_RET offsetof(struct m88100_saved_state, scratch1) / sizeof(int)
+define EF_IPFSR offsetof(struct m88100_saved_state, ipfsr) / sizeof(int)
+define EF_DPFSR offsetof(struct m88100_saved_state, dpfsr) / sizeof(int)
+define EF_DSR offsetof(struct m88100_saved_state, dsr) / sizeof(int)
+define EF_DLAR offsetof(struct m88100_saved_state, dlar) / sizeof(int)
+define EF_DPAR offsetof(struct m88100_saved_state, dpar) / sizeof(int)
+define EF_ISR offsetof(struct m88100_saved_state, dsr) / sizeof(int)
+define EF_ILAR offsetof(struct m88100_saved_state, ilar) / sizeof(int)
+define EF_IPAR offsetof(struct m88100_saved_state, ipar) / sizeof(int)
+define EF_CPU offsetof(struct m88100_saved_state, cpu) / sizeof(int)
+
+define SIZEOF_EF sizeof(struct m88100_saved_state)
+
+# more (machine-dependent) pcb fields
+define PCB_PC offsetof(struct m88100_pcb, pcb_pc)
+define PCB_IPL offsetof(struct m88100_pcb, pcb_ipl)
+define PCB_R14 offsetof(struct m88100_pcb, pcb_r14)
+define PCB_R15 offsetof(struct m88100_pcb, pcb_r15)
+define PCB_R16 offsetof(struct m88100_pcb, pcb_r16)
+define PCB_R17 offsetof(struct m88100_pcb, pcb_r17)
+define PCB_R18 offsetof(struct m88100_pcb, pcb_r18)
+define PCB_R19 offsetof(struct m88100_pcb, pcb_r19)
+define PCB_R20 offsetof(struct m88100_pcb, pcb_r20)
+define PCB_R21 offsetof(struct m88100_pcb, pcb_r21)
+define PCB_R22 offsetof(struct m88100_pcb, pcb_r22)
+define PCB_R23 offsetof(struct m88100_pcb, pcb_r23)
+define PCB_R24 offsetof(struct m88100_pcb, pcb_r24)
+define PCB_R25 offsetof(struct m88100_pcb, pcb_r25)
+define PCB_R26 offsetof(struct m88100_pcb, pcb_r26)
+define PCB_R27 offsetof(struct m88100_pcb, pcb_r27)
+define PCB_R28 offsetof(struct m88100_pcb, pcb_r28)
+define PCB_R29 offsetof(struct m88100_pcb, pcb_r29)
+define PCB_R30 offsetof(struct m88100_pcb, pcb_r30)
+define PCB_SP offsetof(struct m88100_pcb, pcb_sp)