PERFORCE change 54808 for review

Juli Mallett jmallett at FreeBSD.org
Sun Jun 13 10:19:42 GMT 2004


http://perforce.freebsd.org/chv.cgi?CH=54808

Change 54808 by jmallett at jmallett_oingo on 2004/06/13 10:17:48

	Use check_address when checking the GIO slots.

Affected files ...

.. //depot/projects/mips/sys/mips/sgimips/gio/gio.c#3 edit

Differences ...

==== //depot/projects/mips/sys/mips/sgimips/gio/gio.c#3 (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/gio/gio.c#2 $
+ * $P4: //depot/projects/mips/sys/mips/sgimips/gio/gio.c#3 $
  */
 
 #include <sys/cdefs.h>
@@ -36,6 +36,7 @@
 #include <sys/bus.h>
 #include <sys/rman.h>
 
+#include <machine/trap.h>
 #include <platform/models.h>
 #include <platform/gio/gioreg.h>
 #include <platform/gio/giovar.h>
@@ -85,8 +86,13 @@
 	struct gio_device *gd;
 	uint32_t product;
 	device_t dev;
+	int error;
 
 	product = bus_space_read_4(iv->gi_tag, iv->gi_handle, 0);
+	/* XXX subverts bus space */
+	error = check_address((char *)MIPS_PHYS_TO_KSEG1(iv->gi_handle));
+	if (error != 0)
+		return (ENODEV);
 	for (gd = gio_devices; gd->gd_name != NULL; gd++) {
 		if (gd->gd_product == product) {
 			dev = device_add_child(gio, gd->gd_name, -1);


More information about the p4-projects mailing list