From 0c9fbce1f6bdd94939230deb612f0cc86f311c10 Mon Sep 17 00:00:00 2001 From: rahnds Date: Fri, 18 Apr 1997 20:33:08 +0000 Subject: [PATCH] Use the new genassym.cf method of generating the assym.h file. --- sys/arch/powerpc/conf/Makefile.powerpc | 12 ++-- sys/arch/powerpc/powerpc/genassym.c | 82 -------------------------- sys/arch/powerpc/powerpc/genassym.cf | 77 ++++++++++++++++++++++++ 3 files changed, 81 insertions(+), 90 deletions(-) delete mode 100644 sys/arch/powerpc/powerpc/genassym.c create mode 100644 sys/arch/powerpc/powerpc/genassym.cf diff --git a/sys/arch/powerpc/conf/Makefile.powerpc b/sys/arch/powerpc/conf/Makefile.powerpc index aa1bfd47bee..8b0f21e5488 100644 --- a/sys/arch/powerpc/conf/Makefile.powerpc +++ b/sys/arch/powerpc/conf/Makefile.powerpc @@ -111,14 +111,10 @@ LINKFLAGS+= -S %LOAD -assym.h: genassym - ./genassym > assym.h - -genassym: genassym.o - ${HOSTCC} -o $@ genassym.o - -genassym.o: ${PPC}/powerpc/genassym.c - ${HOSTED_C} +assym.h: $S/kern/genassym.sh ${PPC}/powerpc/genassym.cf + sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} \ + < ${PPC}/powerpc/genassym.cf > assym.h.tmp && \ + mv -f assym.h.tmp assym.h param.c: $S/conf/param.c rm -f param.c diff --git a/sys/arch/powerpc/powerpc/genassym.c b/sys/arch/powerpc/powerpc/genassym.c deleted file mode 100644 index 0478d8d00ab..00000000000 --- a/sys/arch/powerpc/powerpc/genassym.c +++ /dev/null @@ -1,82 +0,0 @@ -/* $OpenBSD: genassym.c,v 1.3 1997/01/09 03:07:15 rahnds Exp $ */ -/* $NetBSD: genassym.c,v 1.1 1996/09/30 16:34:46 ws Exp $ */ - -/* - * Copyright (C) 1995, 1996 Wolfgang Solfrank. - * Copyright (C) 1995, 1996 TooLs GmbH. - * 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 TooLs GmbH. - * 4. The name of TooLs GmbH may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``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 TOOLS GMBH 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 - -#include -#include -#include - #include - #include - - -#include -#include - -int -main() -{ -#define def(N,V) printf("#define\t%s\t%d\n", #N, (V)) -#define offsetof(s,f) (&(((s *)0)->f)) - - def(FRAMELEN, FRAMELEN); - def(FRAME_0, offsetof(struct trapframe, fixreg[0])); - def(FRAME_1, offsetof(struct trapframe, fixreg[1])); - def(FRAME_2, offsetof(struct trapframe, fixreg[2])); - def(FRAME_3, offsetof(struct trapframe, fixreg[3])); - def(FRAME_LR, offsetof(struct trapframe, lr)); - def(FRAME_CR, offsetof(struct trapframe, cr)); - def(FRAME_CTR, offsetof(struct trapframe, ctr)); - def(FRAME_XER, offsetof(struct trapframe, xer)); - def(FRAME_SRR0, offsetof(struct trapframe, srr0)); - def(FRAME_SRR1, offsetof(struct trapframe, srr1)); - def(FRAME_DAR, offsetof(struct trapframe, dar)); - def(FRAME_DSISR, offsetof(struct trapframe, dsisr)); - def(FRAME_EXC, offsetof(struct trapframe, exc)); - - def(SFRAMELEN, roundup(sizeof(struct switchframe), 16)); - - def(PCB_PMR, offsetof(struct pcb, pcb_pmreal)); - def(PCB_SP, offsetof(struct pcb, pcb_sp)); - def(PCB_SPL, offsetof(struct pcb, pcb_spl)); - def(PCB_FAULT, offsetof(struct pcb, pcb_onfault)); - - def(PM_USRSR, offsetof(struct pmap, pm_sr[USER_SR])); - def(PM_KERNELSR, offsetof(struct pmap, pm_sr[KERNEL_SR])); - - def(P_FORW, offsetof(struct proc, p_forw)); - def(P_BACK, offsetof(struct proc, p_back)); - def(P_ADDR, offsetof(struct proc, p_addr)); - - return 0; -} diff --git a/sys/arch/powerpc/powerpc/genassym.cf b/sys/arch/powerpc/powerpc/genassym.cf new file mode 100644 index 00000000000..ed4e44e7b7e --- /dev/null +++ b/sys/arch/powerpc/powerpc/genassym.cf @@ -0,0 +1,77 @@ +# $OpenBSD: genassym.cf,v 1.1 1997/04/18 20:33:11 rahnds 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 +include +include +include +include + + +include +include + + + +define FRAMELEN FRAMELEN +define FRAME_0 offsetof(struct trapframe, fixreg[0]) +define FRAME_1 offsetof(struct trapframe, fixreg[1]) +define FRAME_2 offsetof(struct trapframe, fixreg[2]) +define FRAME_3 offsetof(struct trapframe, fixreg[3]) +define FRAME_LR offsetof(struct trapframe, lr) +define FRAME_CR offsetof(struct trapframe, cr) +define FRAME_CTR offsetof(struct trapframe, ctr) +define FRAME_XER offsetof(struct trapframe, xer) +define FRAME_SRR0 offsetof(struct trapframe, srr0) +define FRAME_SRR1 offsetof(struct trapframe, srr1) +define FRAME_DAR offsetof(struct trapframe, dar) +define FRAME_DSISR offsetof(struct trapframe, dsisr) +define FRAME_EXC offsetof(struct trapframe, exc) +define FRAME_EXC offsetof(struct trapframe, exc) + +define SFRAMELEN roundup(sizeof(struct switchframe), 16) + +define PCB_PMR offsetof(struct pcb, pcb_pmreal) +define PCB_SP offsetof(struct pcb, pcb_sp) +define PCB_SPL offsetof(struct pcb, pcb_spl) +define PCB_FAULT offsetof(struct pcb, pcb_onfault) + +define PM_USRSR offsetof(struct pmap, pm_sr[USER_SR]) +define PM_KERNELSR offsetof(struct pmap, pm_sr[KERNEL_SR]) + +define P_FORW offsetof(struct proc, p_forw) +define P_BACK offsetof(struct proc, p_back) +define P_ADDR offsetof(struct proc, p_addr) -- 2.20.1