Date: Mon, 14 Jun 2004 22:44:42 GMT From: Juli Mallett <jmallett@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 54963 for review Message-ID: <200406142244.i5EMigpg042389@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 <sys/cdefs.h> @@ -38,6 +38,7 @@ #include <machine/bus.h> #include <platform/models.h> #include <platform/imc/imcreg.h> +#include <platform/intr.h> 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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200406142244.i5EMigpg042389>