summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2014-04-01 20:27:15 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2014-04-01 20:27:15 +0000
commitc23355c3c24bd2208ba93faf001f65b227fdfb41 (patch)
tree19fbb15a9578a596b8bb019de9107c4a332c3814 /sys
parentcf4a40c005a627642634be9c51716043952e6017 (diff)
Remove the almost unused abstraction around "struct firmware" and use
instead a single function ppc_mem_regions() required by the ppc pmap. ok kettenis@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/macppc/dev/macintr.c3
-rw-r--r--sys/arch/macppc/dev/openpic.c6
-rw-r--r--sys/arch/macppc/include/intr.h5
-rw-r--r--sys/arch/macppc/include/powerpc.h92
-rw-r--r--sys/arch/macppc/macppc/autoconf.c8
-rw-r--r--sys/arch/macppc/macppc/clock.c3
-rw-r--r--sys/arch/macppc/macppc/machdep.c10
-rw-r--r--sys/arch/macppc/macppc/ofw_machdep.c28
8 files changed, 17 insertions, 138 deletions
diff --git a/sys/arch/macppc/dev/macintr.c b/sys/arch/macppc/dev/macintr.c
index 264b18a59ae..1e8b3048aa9 100644
--- a/sys/arch/macppc/dev/macintr.c
+++ b/sys/arch/macppc/dev/macintr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: macintr.c,v 1.45 2014/03/31 18:58:41 mpi Exp $ */
+/* $OpenBSD: macintr.c,v 1.46 2014/04/01 20:27:14 mpi Exp $ */
/*-
* Copyright (c) 2008 Dale Rahn <drahn@openbsd.org>
@@ -50,7 +50,6 @@
#include <machine/intr.h>
#include <machine/psl.h>
#include <machine/pio.h>
-#include <machine/powerpc.h>
#include <dev/ofw/openfirm.h>
diff --git a/sys/arch/macppc/dev/openpic.c b/sys/arch/macppc/dev/openpic.c
index 39cbe9a2d9d..e2a4b01ae92 100644
--- a/sys/arch/macppc/dev/openpic.c
+++ b/sys/arch/macppc/dev/openpic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: openpic.c,v 1.70 2014/03/31 18:58:41 mpi Exp $ */
+/* $OpenBSD: openpic.c,v 1.71 2014/04/01 20:27:14 mpi Exp $ */
/*-
* Copyright (c) 2008 Dale Rahn <drahn@openbsd.org>
@@ -50,10 +50,10 @@
#include <machine/intr.h>
#include <machine/psl.h>
#include <machine/pio.h>
-#include <machine/powerpc.h>
-#include <macppc/dev/openpicreg.h>
#include <dev/ofw/openfirm.h>
+#include <macppc/dev/openpicreg.h>
+
#define ICU_LEN 128
int openpic_numirq = ICU_LEN;
#define LEGAL_IRQ(x) ((x >= 0) && (x < ICU_LEN))
diff --git a/sys/arch/macppc/include/intr.h b/sys/arch/macppc/include/intr.h
index 7d8a024bb28..76015f6de79 100644
--- a/sys/arch/macppc/include/intr.h
+++ b/sys/arch/macppc/include/intr.h
@@ -1,9 +1,10 @@
-/* $OpenBSD: intr.h,v 1.8 2009/06/09 01:12:38 deraadt Exp $ */
+/* $OpenBSD: intr.h,v 1.9 2014/04/01 20:27:14 mpi Exp $ */
#include <powerpc/intr.h>
#ifndef _LOCORE
-void softtty(void);
+extern int intr_shared_edge;
+void install_extint(void (*handler)(void));
void openpic_set_priority(int, int);
#endif
diff --git a/sys/arch/macppc/include/powerpc.h b/sys/arch/macppc/include/powerpc.h
deleted file mode 100644
index 16a369187e3..00000000000
--- a/sys/arch/macppc/include/powerpc.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/* $OpenBSD: powerpc.h,v 1.10 2013/08/17 08:33:11 mpi Exp $ */
-/* $NetBSD: powerpc.h,v 1.1 1996/09/30 16:34:30 ws Exp $ */
-
-/*
- * Copyright (C) 1996 Wolfgang Solfrank.
- * Copyright (C) 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.
- */
-#ifndef _MACHINE_POWERPC_H_
-#define _MACHINE_POWERPC_H_
-
-struct mem_region {
- vaddr_t start;
- vsize_t size;
-};
-
-void mem_regions(struct mem_region **, struct mem_region **);
-
-/*
- * These two functions get used solely in boot() in machdep.c.
- *
- * Not sure whether boot itself should be implementation dependent instead. XXX
- */
-typedef void (exit_f)(void) /*__attribute__((__noreturn__))*/ ;
-typedef void (boot_f)(char *bootspec) /* __attribute__((__noreturn__))*/ ;
-typedef void (vmon_f)(void);
-
-/* firmware interface.
- * regardless of type of firmware used several items
- * are need from firmware to boot up.
- * these include:
- * memory information
- * vmsetup for firmware calls.
- * default character print mechanism ???
- * firmware exit (return)
- * firmware boot (reset)
- * vmon - tell firmware the bsd vm is active.
- */
-
-typedef void (mem_regions_f)(struct mem_region **memp,
- struct mem_region **availp);
-
-struct firmware {
- mem_regions_f *mem_regions;
- exit_f *exit;
- boot_f *boot;
- vmon_f *vmon;
-
-#ifdef FW_HAS_PUTC
- boot_f *putc;
-#endif
-};
-extern struct firmware *fw;
-void install_extint(void (*handler) (void));
-void ppc_intr_enable(int enable);
-int ppc_intr_disable(void);
-
-extern int intr_shared_edge;
-
-struct dumpmem {
- vaddr_t start;
- vsize_t end;
-};
-extern struct dumpmem dumpmem[VM_PHYSSEG_MAX];
-extern u_int ndumpmem;
-extern vaddr_t dumpspace;
-#endif /* _MACHINE_POWERPC_H_ */
diff --git a/sys/arch/macppc/macppc/autoconf.c b/sys/arch/macppc/macppc/autoconf.c
index 879ce4f8d8a..43e94685116 100644
--- a/sys/arch/macppc/macppc/autoconf.c
+++ b/sys/arch/macppc/macppc/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.41 2013/09/13 07:29:01 mpi Exp $ */
+/* $OpenBSD: autoconf.c,v 1.42 2014/04/01 20:27:14 mpi Exp $ */
/*
* Copyright (c) 1996, 1997 Per Fogelstrom
* Copyright (c) 1995 Theo de Raadt
@@ -37,7 +37,7 @@
* from: Utah Hdr: autoconf.c 1.31 91/01/21
*
* from: @(#)autoconf.c 8.1 (Berkeley) 6/10/93
- * $Id: autoconf.c,v 1.41 2013/09/13 07:29:01 mpi Exp $
+ * $Id: autoconf.c,v 1.42 2014/04/01 20:27:14 mpi Exp $
*/
/*
@@ -58,7 +58,6 @@
#include <dev/cons.h>
#include <uvm/uvm_extern.h>
#include <machine/autoconf.h>
-#include <machine/powerpc.h>
#include <sys/disk.h>
#include <scsi/scsi_all.h>
@@ -82,9 +81,6 @@ enum devclass bootdev_class = DV_DULL;
int bootdev_type = 0;
int bootdev_unit = 0;
-struct dumpmem dumpmem[VM_PHYSSEG_MAX];
-u_int ndumpmem;
-
/*
* Configure all devices found that we know about.
* This is done at boot time.
diff --git a/sys/arch/macppc/macppc/clock.c b/sys/arch/macppc/macppc/clock.c
index 3068c010579..bec1d950a16 100644
--- a/sys/arch/macppc/macppc/clock.c
+++ b/sys/arch/macppc/macppc/clock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clock.c,v 1.35 2013/10/09 17:43:50 mpi Exp $ */
+/* $OpenBSD: clock.c,v 1.36 2014/04/01 20:27:14 mpi Exp $ */
/* $NetBSD: clock.c,v 1.1 1996/09/30 16:34:40 ws Exp $ */
/*
@@ -42,7 +42,6 @@
#include <machine/pio.h>
#include <machine/intr.h>
#include <machine/vmparam.h>
-#include <machine/powerpc.h>
#include <dev/ofw/openfirm.h>
void decr_intr(struct clockframe *frame);
diff --git a/sys/arch/macppc/macppc/machdep.c b/sys/arch/macppc/macppc/machdep.c
index 02145be1364..85f3aeaae3e 100644
--- a/sys/arch/macppc/macppc/machdep.c
+++ b/sys/arch/macppc/macppc/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.148 2014/03/31 18:58:41 mpi Exp $ */
+/* $OpenBSD: machdep.c,v 1.149 2014/04/01 20:27:14 mpi Exp $ */
/* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */
/*
@@ -59,7 +59,7 @@
#include <machine/bat.h>
#include <machine/pmap.h>
-#include <machine/powerpc.h>
+#include <powerpc/powerpc.h>
#include <machine/trap.h>
#include <machine/autoconf.h>
#include <machine/bus.h>
@@ -309,8 +309,6 @@ initppc(startkernel, endkernel, args)
/*
* Now enable translation (and machine checks/recoverable interrupts).
*/
- (fw->vmon)();
-
__asm__ volatile ("eieio; mfmsr %0; ori %0,%0,%1; mtmsr %0; sync;isync"
: "=r"(scratch) : "K"(PSL_IR|PSL_DR|PSL_ME|PSL_RI));
@@ -677,7 +675,7 @@ dumpconf(void)
}
#define BYTES_PER_DUMP (PAGE_SIZE) /* must be a multiple of pagesize */
-vaddr_t dumpspace;
+static vaddr_t dumpspace;
int
reserve_dumppages(caddr_t p)
@@ -858,7 +856,7 @@ haltsys:
}
printf("halted\n\n");
- (fw->exit)();
+ OF_exit();
}
printf("rebooting\n\n");
diff --git a/sys/arch/macppc/macppc/ofw_machdep.c b/sys/arch/macppc/macppc/ofw_machdep.c
index b91478ebd26..1c342e88e29 100644
--- a/sys/arch/macppc/macppc/ofw_machdep.c
+++ b/sys/arch/macppc/macppc/ofw_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ofw_machdep.c,v 1.45 2014/02/08 13:17:38 miod Exp $ */
+/* $OpenBSD: ofw_machdep.c,v 1.46 2014/04/01 20:27:14 mpi Exp $ */
/* $NetBSD: ofw_machdep.c,v 1.1 1996/09/30 16:34:50 ws Exp $ */
/*
@@ -44,7 +44,7 @@
#include <uvm/uvm_extern.h>
-#include <machine/powerpc.h>
+#include <powerpc/powerpc.h>
#include <machine/autoconf.h>
#include <dev/ofw/openfirm.h>
@@ -68,23 +68,8 @@
/* XXX, called from asm */
int save_ofw_mapping(void);
-void OF_exit(void) __attribute__((__noreturn__));
-void OF_boot(char *bootspec) __attribute__((__noreturn__));
-void ofw_mem_regions(struct mem_region **memp, struct mem_region **availp);
-void ofw_vmon(void);
-
extern char *hw_prod;
-struct firmware ofw_firmware = {
- ofw_mem_regions,
- OF_exit,
- OF_boot,
- ofw_vmon
-#ifdef FW_HAS_PUTC
- ofwcnputc;
-#endif
-};
-
#define OFMEM_REGIONS 32
static struct mem_region OFmem[OFMEM_REGIONS + 1], OFavail[OFMEM_REGIONS + 3];
@@ -113,7 +98,7 @@ static struct ofwfb ofwfb;
* to provide space for two additional entry beyond the terminating one.
*/
void
-ofw_mem_regions(struct mem_region **memp, struct mem_region **availp)
+ppc_mem_regions(struct mem_region **memp, struct mem_region **availp)
{
int phandle, rhandle;
int nreg, navail;
@@ -205,12 +190,6 @@ extern fwcall_f *fwcall;
fwcall_f fwentry;
extern u_int32_t ofmsr;
-void
-ofw_vmon()
-{
- fwcall = &fwentry;
-}
-
int OF_stdout;
int OF_stdin;
@@ -244,7 +223,6 @@ save_ofw_mapping()
}
OF_stdout = stdout;
- fw = &ofw_firmware;
fwcall = &fwentry;
return 0;
}