[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openbsd-tech
Subject:    Re: kill unused macppc system_type
From:       Tobias Ulmer <tobiasu () tmux ! org>
Date:       2014-06-30 0:24:19
Message-ID: 20140630002419.GB17207 () tin ! tmux ! org
[Download RAW message or body]

While I'm at it...

Index: arch/macppc/include/autoconf.h
===================================================================
RCS file: /home/vcs/cvs/openbsd/src/sys/arch/macppc/include/autoconf.h,v
retrieving revision 1.9
diff -u -p -r1.9 autoconf.h
--- arch/macppc/include/autoconf.h	22 Aug 2009 02:54:50 -0000	1.9
+++ arch/macppc/include/autoconf.h	30 Jun 2014 00:21:01 -0000
@@ -34,49 +34,9 @@
 
 #include <machine/bus.h>
 
-/*
- *   System types.
- */
-#define OFWMACH         0       /* Openfirmware drivers */
-#define	POWER4e		1	/* V.I Power.4e board */
-#define	PWRSTK		2	/* Motorola Powerstack series */
-#define	APPL		3	/* Apple PowerMac machines (OFW?) */
-
-extern int system_type;
-
-/**/
-struct confargs;
-
-typedef int (*intr_handler_t)(void *);
-
-typedef struct bushook {
-	struct	device *bh_dv;
-	int	bh_type;
-	void	(*bh_intr_establish)(struct confargs *, intr_handler_t, void *);
-	void	(*bh_intr_disestablish)(struct confargs *);
-	int	(*bh_matchname)(struct confargs *, char *);
-} bushook_t;
-
-#define	BUS_MAIN	1		/* mainbus */
-#define	BUS_ISABR	2		/* ISA Bridge Bus */
-#define	BUS_PCIBR	3		/* PCI bridge */
-#define	BUS_VMEBR	4		/* VME bridge */
-
-#define	BUS_INTR_ESTABLISH(ca, handler, val)				\
-	    (*(ca)->ca_bus->bh_intr_establish)((ca), (handler), (val))
-#define	BUS_INTR_DISESTABLISH(ca)					\
-	    (*(ca)->ca_bus->bh_intr_establish)(ca)
-#define	BUS_CVTADDR(ca)							\
-	    (*(ca)->ca_bus->bh_cvtaddr)(ca)
-#define	BUS_MATCHNAME(ca, name)						\
-	    (*(ca)->ca_bus->bh_matchname)((ca), (name))
-
 struct confargs {
-	char	*ca_name;		/* Device name. */
-	bushook_t *ca_bus;		/* bus device resides on. */
-	/* macobio hooks ?? */
+	char	*ca_name;
 	bus_space_tag_t ca_iot;
-	bus_space_tag_t ca_memt; /* XXX */
 	bus_dma_tag_t ca_dmat;
 	u_int32_t ca_node;
 	int ca_nreg;
Index: arch/macppc/macppc/mainbus.c
===================================================================
RCS file: /home/vcs/cvs/openbsd/src/sys/arch/macppc/macppc/mainbus.c,v
retrieving revision 1.21
diff -u -p -r1.21 mainbus.c
--- arch/macppc/macppc/mainbus.c	19 Apr 2009 17:53:39 -0000	1.21
+++ arch/macppc/macppc/mainbus.c	30 Jun 2014 00:21:01 -0000
@@ -38,7 +38,6 @@
 
 struct mainbus_softc {
 	struct	device sc_dv;
-	struct	bushook sc_bus;
 };
 
 /* Definition of the mainbus driver. */
@@ -58,11 +57,6 @@ extern char *hw_prod, *hw_ver, *hw_vendo
 
 #define HH_REG_CONF 	0x90
 
-void	mb_intr_establish(struct confargs *, int (*)(void *), void *);
-void	mb_intr_disestablish(struct confargs *);
-caddr_t	mb_cvtaddr(struct confargs *);
-int	mb_matchname(struct confargs *, char *);
-
 /*ARGSUSED*/
 static int
 mbmatch(struct device *parent, void *cfdata, void *aux)
@@ -77,7 +71,7 @@ mbmatch(struct device *parent, void *cfd
 static void
 mbattach(struct device *parent, struct device *self, void *aux)
 {
-	struct mainbus_softc *sc = (struct mainbus_softc *)self;
+	/* struct mainbus_softc *sc = (struct mainbus_softc *)self; */
 	struct confargs nca;
 	char name[64], *t = NULL;
 	int reg[4], cpucnt;
@@ -112,12 +106,6 @@ mbattach(struct device *parent, struct d
 	}
 	printf(": model %s\n", hw_prod);
 
-	sc->sc_bus.bh_dv = (struct device *)sc;
-	sc->sc_bus.bh_type = BUS_MAIN;
-	sc->sc_bus.bh_intr_establish = mb_intr_establish;
-	sc->sc_bus.bh_intr_disestablish = mb_intr_disestablish;
-	sc->sc_bus.bh_matchname = mb_matchname;
-
 	/*
 	 * Try to find and attach all of the CPUs in the machine.
 	 */
@@ -132,7 +120,6 @@ mbattach(struct device *parent, struct d
 			len = OF_getprop(node, "reg", &cpunum, sizeof cpunum);
 			if (len == 4 && cpucnt == cpunum) {
 				nca.ca_name = "cpu";
-				nca.ca_bus = &sc->sc_bus;
 				nca.ca_reg = reg;
 				reg[0] = cpucnt;
 				config_found(self, &nca, mbprint);
@@ -143,7 +130,6 @@ mbattach(struct device *parent, struct d
 	}
 	if (cpucnt == 0) {
 		nca.ca_name = "cpu";
-		nca.ca_bus = &sc->sc_bus;
 		nca.ca_reg = reg;
 		reg[0] = 0;
 		ncpusfound++;
@@ -167,7 +153,6 @@ mbattach(struct device *parent, struct d
 			}
 			if (twoway) {
 				nca.ca_name = "cpu";
-				nca.ca_bus = &sc->sc_bus;
 				nca.ca_reg = reg;
 				reg[0] = 1;
 				ncpusfound++;
@@ -189,31 +174,26 @@ mbattach(struct device *parent, struct d
 		if (strcmp(name, "memory") == 0) {
 			nca.ca_name = "mem";
 			nca.ca_node = node;
-			nca.ca_bus = &sc->sc_bus;
 			config_found(self, &nca, mbprint);
 		}
 		if (strcmp(name, "memory-controller") == 0) {
 			nca.ca_name = "memc";
 			nca.ca_node = node;
-			nca.ca_bus = &sc->sc_bus;
 			config_found(self, &nca, mbprint);
 		}
 		if (strcmp(name, "pci") == 0) {
 			nca.ca_name = "mpcpcibr";
 			nca.ca_node = node;
-			nca.ca_bus = &sc->sc_bus;
 			config_found(self, &nca, mbprint);
 		}
 		if (strcmp(name, "ht") == 0) {
 			nca.ca_name = "ht";
 			nca.ca_node = node;
-			nca.ca_bus = &sc->sc_bus;
 			config_found(self, &nca, mbprint);
 		}
 		if (strcmp(name, "smu") == 0) {
 			nca.ca_name = "smu";
 			nca.ca_node = node;
-			nca.ca_bus = &sc->sc_bus;
 			config_found(self, &nca, mbprint);
 		}
 	}
@@ -227,28 +207,4 @@ mbprint(void *aux, const char *pnp)
 		printf("%s at %s", ca->ca_name, pnp);
 
 	return (UNCONF);
-}
-
-void
-mb_intr_establish(struct confargs *ca, int (*handler)(void *), void *val)
-{
-	panic("can never mb_intr_establish");
-}
-
-void
-mb_intr_disestablish(struct confargs *ca)
-{
-	panic("can never mb_intr_disestablish");
-}
-
-caddr_t
-mb_cvtaddr(struct confargs *ca)
-{
-	return (NULL);
-}
-
-int
-mb_matchname(struct confargs *ca, char *name)
-{
-	return (strcmp(name, ca->ca_name) == 0);
 }

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic