Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x68k/dev Bus error occurred on such machines withou...



details:   https://anonhg.NetBSD.org/src/rev/a5c4dfac6f98
branches:  trunk
changeset: 472136:a5c4dfac6f98
user:      minoura <minoura%NetBSD.org@localhost>
date:      Thu Apr 22 12:55:53 1999 +0000

description:
Bus error occurred on such machines without the SCSI ROM.
Insert badaddr() check before read the ROM.

diffstat:

 sys/arch/x68k/dev/scsirom.c |  13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diffs (31 lines):

diff -r 55f5683a2882 -r a5c4dfac6f98 sys/arch/x68k/dev/scsirom.c
--- a/sys/arch/x68k/dev/scsirom.c       Thu Apr 22 10:27:16 1999 +0000
+++ b/sys/arch/x68k/dev/scsirom.c       Thu Apr 22 12:55:53 1999 +0000
@@ -1,10 +1,12 @@
-/*     $NetBSD: scsirom.c,v 1.3 1999/03/24 14:07:39 minoura Exp $      */
+/*     $NetBSD: scsirom.c,v 1.4 1999/04/22 12:55:53 minoura Exp $      */
 
-/*
- *
+/*-
  * Copyright (c) 1999 NetBSD Foundation, Inc.
  * All rights reserved.
  *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Minoura Makoto.
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
@@ -93,7 +95,10 @@
 
        if (bus_space_map (ia->ia_bst, ia->ia_addr, ia->ia_size, 0, &ioh) < 0)
                return -1;
-       bus_space_read_region_1 (ia->ia_bst, ioh, SCSIROM_ID, buf, 6);
+       if (badaddr ((caddr_t)INTIO_ADDR(ia->ia_addr+SCSIROM_ID))) {
+               bus_space_unmap (ia->ia_bst, ioh, ia->ia_size);
+               return -1;
+       }
        if (memcmp(buf, scsirom_descr[which].id, 6) == 0)
                r = which;
        bus_space_unmap (ia->ia_bst, ioh, ia->ia_size);



Home | Main Index | Thread Index | Old Index