Module Name: src
Committed By: tsutsui
Date: Wed Aug 12 14:06:13 UTC 2009
Modified Files:
src/sys/arch/pmax/tc: asc_ioasic.c
Log Message:
Fix a botch in the previous rev 1.21:
We have to mask higher bits on NCR register access via bus_space_read_4(9),
as the previous NCR_READ_REG() does.
Problem reported by Erik Bertelsen on port-p...@.
I tested a different version on 3MIN and I also tested committed version
on gxemul, but 3MAX doesn't have asc_ioasic but asc_tc..
To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/pmax/tc/asc_ioasic.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/pmax/tc/asc_ioasic.c
diff -u src/sys/arch/pmax/tc/asc_ioasic.c:1.21 src/sys/arch/pmax/tc/asc_ioasic.c:1.22
--- src/sys/arch/pmax/tc/asc_ioasic.c:1.21 Sat Aug 1 08:20:36 2009
+++ src/sys/arch/pmax/tc/asc_ioasic.c Wed Aug 12 14:06:13 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: asc_ioasic.c,v 1.21 2009/08/01 08:20:36 tsutsui Exp $ */
+/* $NetBSD: asc_ioasic.c,v 1.22 2009/08/12 14:06:13 tsutsui Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: asc_ioasic.c,v 1.21 2009/08/01 08:20:36 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: asc_ioasic.c,v 1.22 2009/08/12 14:06:13 tsutsui Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -71,11 +71,11 @@
};
#define ASC_READ_REG(asc, reg) \
- bus_space_read_4((asc)->sc_bst, (asc)->sc_scsi_bsh, \
- (reg) * sizeof(uint32_t))
+ ((uint8_t)bus_space_read_4((asc)->sc_bst, (asc)->sc_scsi_bsh, \
+ (reg) * sizeof(uint32_t)))
#define ASC_WRITE_REG(asc, reg, val) \
bus_space_write_4((asc)->sc_bst, (asc)->sc_scsi_bsh, \
- (reg) * sizeof(uint32_t), (val))
+ (reg) * sizeof(uint32_t), (uint8_t)(val))
static int asc_ioasic_match(device_t, cfdata_t, void *);
static void asc_ioasic_attach(device_t, device_t, void *);
@@ -421,11 +421,8 @@
asc_read_reg(struct ncr53c9x_softc *sc, int reg)
{
struct asc_softc *asc = (struct asc_softc *)sc;
- uint32_t v;
- v = ASC_READ_REG(asc, reg);
-
- return v & 0xff;
+ return ASC_READ_REG(asc, reg);
}
static void