Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sgimips/gio use bus_space_map() instead of fudging ...
details: https://anonhg.NetBSD.org/src/rev/f9149f233a6f
branches: trunk
changeset: 346593:f9149f233a6f
user: macallan <macallan%NetBSD.org@localhost>
date: Wed Jul 20 22:16:37 2016 +0000
description:
use bus_space_map() instead of fudging our own bus_space_handle_t
diffstat:
sys/arch/sgimips/gio/gio.c | 37 +++++++++++++++++++++++--------------
1 files changed, 23 insertions(+), 14 deletions(-)
diffs (83 lines):
diff -r 0b57225be8e9 -r f9149f233a6f sys/arch/sgimips/gio/gio.c
--- a/sys/arch/sgimips/gio/gio.c Wed Jul 20 21:02:04 2016 +0000
+++ b/sys/arch/sgimips/gio/gio.c Wed Jul 20 22:16:37 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gio.c,v 1.34 2015/02/18 16:47:58 macallan Exp $ */
+/* $NetBSD: gio.c,v 1.35 2016/07/20 22:16:37 macallan Exp $ */
/*
* Copyright (c) 2000 Soren S. Jorvang
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gio.c,v 1.34 2015/02/18 16:47:58 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gio.c,v 1.35 2016/07/20 22:16:37 macallan Exp $");
#include "opt_ddb.h"
@@ -207,14 +207,17 @@
ga.ga_slot = -1;
ga.ga_addr = gfx_bases[i].base;
+ /* XXX */
+ if (platform.badaddr((void *)MIPS_PHYS_TO_KSEG1(ga.ga_addr),
+ sizeof(uint32_t)))
+ continue;
ga.ga_iot = normal_memt;
- /* XXX bus_space_map() */
- ga.ga_ioh = MIPS_PHYS_TO_KSEG1(ga.ga_addr);
+ if (bus_space_map(normal_memt, ga.ga_addr, 0,
+ BUS_SPACE_MAP_LINEAR, &ga.ga_ioh) != 0)
+ continue;
ga.ga_dmat = &sgimips_default_bus_dma_tag;
ga.ga_product = -1;
- if (platform.badaddr((void *)ga.ga_ioh, sizeof(uint32_t)))
- continue;
if (config_found_sm_loc(self, "gio", NULL, &ga, gio_print,
gio_submatch)) {
@@ -252,13 +255,16 @@
ga.ga_slot = slot_bases[i].slot;
ga.ga_addr = slot_bases[i].base;
+ /* XXX */
+ if (platform.badaddr((void *)MIPS_PHYS_TO_KSEG1(ga.ga_addr),
+ sizeof(uint32_t)))
+ continue;
ga.ga_iot = normal_memt;
- ga.ga_ioh = MIPS_PHYS_TO_KSEG1(ga.ga_addr);
+ if (bus_space_map(normal_memt, ga.ga_addr, 0,
+ BUS_SPACE_MAP_LINEAR, &ga.ga_ioh) != 0)
+ continue;
ga.ga_dmat = &sgimips_default_bus_dma_tag;
- if (platform.badaddr((void *)ga.ga_ioh, sizeof(uint32_t)))
- continue;
-
ga.ga_product = bus_space_read_4(ga.ga_iot, ga.ga_ioh, 0);
config_found_sm_loc(self, "gio", NULL, &ga, gio_print,
@@ -366,14 +372,17 @@
ga.ga_slot = -1;
ga.ga_addr = gfx_bases[i].base;
+ /* XXX */
+ if (platform.badaddr((void *)MIPS_PHYS_TO_KSEG1(ga.ga_addr),
+ sizeof(uint32_t)))
+ continue;
ga.ga_iot = normal_memt;
- ga.ga_ioh = MIPS_PHYS_TO_KSEG1(ga.ga_addr);
+ if (bus_space_map(normal_memt, ga.ga_addr, 0,
+ BUS_SPACE_MAP_LINEAR, &ga.ga_ioh) != 0)
+ continue;
ga.ga_dmat = &sgimips_default_bus_dma_tag;
ga.ga_product = -1;
- if (platform.badaddr((void *)ga.ga_ioh,sizeof(uint32_t)))
- continue;
-
#if (NGRTWO > 0)
if (grtwo_cnattach(&ga) == 0)
return 0;
Home |
Main Index |
Thread Index |
Old Index