From owner-p4-projects@FreeBSD.ORG Mon Jun 14 22:45:02 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4534916A4D7; Mon, 14 Jun 2004 22:45:02 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0EFAD16A4F9 for ; Mon, 14 Jun 2004 22:45:02 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 075EE43D49 for ; Mon, 14 Jun 2004 22:45:02 +0000 (GMT) (envelope-from jmallett@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i5EMiga5042392 for ; Mon, 14 Jun 2004 22:44:42 GMT (envelope-from jmallett@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i5EMigpg042389 for perforce@freebsd.org; Mon, 14 Jun 2004 22:44:42 GMT (envelope-from jmallett@freebsd.org) Date: Mon, 14 Jun 2004 22:44:42 GMT Message-Id: <200406142244.i5EMigpg042389@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jmallett@freebsd.org using -f From: Juli Mallett To: Perforce Change Reviews Subject: PERFORCE change 54963 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jun 2004 22:45:02 -0000 http://perforce.freebsd.org/chv.cgi?CH=54963 Change 54963 by jmallett@jmallett_oingo on 2004/06/14 22:44:06 Functionalize bus resetting, and further, make it the int4 handler. Affected files ... .. //depot/projects/mips/sys/mips/sgimips/imc/imc.c#8 edit Differences ... ==== //depot/projects/mips/sys/mips/sgimips/imc/imc.c#8 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $P4: //depot/projects/mips/sys/mips/sgimips/imc/imc.c#7 $ + * $P4: //depot/projects/mips/sys/mips/sgimips/imc/imc.c#8 $ */ #include @@ -38,6 +38,7 @@ #include #include #include +#include static devclass_t imc_devclass; @@ -70,6 +71,8 @@ NULL }; +static void imc_reset(void *); + #define IMC_READ_4(port, r) \ bus_space_read_4(device_space_tag, (port), (r)) @@ -123,9 +126,9 @@ device_printf(dev, "revision %d, EISA %s\n", sysid & IMC_SYSID_REVMASK, sysid & IMC_SYSID_HAVEISA ? "present" : "not present"); - /* Clear error status. */ - IMC_WRITE_4(port, IMC_CPU_ERRSTAT, 0); - IMC_WRITE_4(port, IMC_GIO_ERRSTAT, 0); + /* Clear error status and set up bus error handler. */ + imc_reset(dev); + platform_establish_hardintr(4, imc_reset, dev); /* * Enable parity reporting on GIO/main memory transactions. @@ -188,4 +191,18 @@ return (0); } +static void +imc_reset(void *arg) +{ + device_t dev; + long *scp; + long port; + + dev = (device_t)arg; + scp = device_get_softc(dev); + port = *scp; + IMC_WRITE_4(port, IMC_CPU_ERRSTAT, 0); + IMC_WRITE_4(port, IMC_GIO_ERRSTAT, 0); +} + DRIVER_MODULE(imc, root, imc_driver, imc_devclass, 0, 0);