Check scode range for DIO-II based framebuffers correctly

in cnattach() functions.
Fixes boot failure problem on HP400t with fb console
reported by Stephan "doomwarrior" on port-hp300.
This commit is contained in:
tsutsui 2006-05-31 09:25:44 +00:00
parent f11583fa19
commit 35a0a35342
5 changed files with 20 additions and 15 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: grf_dv.c,v 1.30 2005/12/11 12:17:13 christos Exp $ */
/* $NetBSD: grf_dv.c,v 1.31 2006/05/31 09:25:44 tsutsui Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@ -117,7 +117,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: grf_dv.c,v 1.30 2005/12/11 12:17:13 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: grf_dv.c,v 1.31 2006/05/31 09:25:44 tsutsui Exp $");
#include "opt_compat_hpux.h"
@ -137,6 +137,7 @@ __KERNEL_RCSID(0, "$NetBSD: grf_dv.c,v 1.30 2005/12/11 12:17:13 christos Exp $")
#include <dev/cons.h>
#include <hp300/dev/dioreg.h>
#include <hp300/dev/diovar.h>
#include <hp300/dev/diodevs.h>
#include <hp300/dev/intiovar.h>
@ -681,7 +682,7 @@ dvboxcnattach(bus_space_tag_t bst, bus_addr_t addr, int scode)
return (1);
}
if (scode > 132) {
if (DIO_ISDIOII(scode)) {
dioiidev = (uint8_t *)va;
size = ((dioiidev[0x101] + 1) * 0x100000);
} else

View File

@ -1,4 +1,4 @@
/* $NetBSD: grf_gb.c,v 1.29 2005/12/11 12:17:13 christos Exp $ */
/* $NetBSD: grf_gb.c,v 1.30 2006/05/31 09:25:44 tsutsui Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@ -121,7 +121,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: grf_gb.c,v 1.29 2005/12/11 12:17:13 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: grf_gb.c,v 1.30 2006/05/31 09:25:44 tsutsui Exp $");
#include "opt_compat_hpux.h"
@ -141,6 +141,7 @@ __KERNEL_RCSID(0, "$NetBSD: grf_gb.c,v 1.29 2005/12/11 12:17:13 christos Exp $")
#include <dev/cons.h>
#include <hp300/dev/dioreg.h>
#include <hp300/dev/diovar.h>
#include <hp300/dev/diodevs.h>
#include <hp300/dev/intiovar.h>
@ -629,7 +630,7 @@ gboxcnattach(bus_space_tag_t bst, bus_addr_t addr, int scode)
return (1);
}
if (scode > 132) {
if (DIO_ISDIOII(scode)) {
dioiidev = (uint8_t *)va;
size = ((dioiidev[0x101] + 1) * 0x100000);
} else

View File

@ -1,4 +1,4 @@
/* $NetBSD: grf_hy.c,v 1.27 2006/03/19 06:50:13 tsutsui Exp $ */
/* $NetBSD: grf_hy.c,v 1.28 2006/05/31 09:25:44 tsutsui Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@ -120,7 +120,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: grf_hy.c,v 1.27 2006/03/19 06:50:13 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: grf_hy.c,v 1.28 2006/05/31 09:25:44 tsutsui Exp $");
#include "opt_compat_hpux.h"
@ -141,6 +141,7 @@ __KERNEL_RCSID(0, "$NetBSD: grf_hy.c,v 1.27 2006/03/19 06:50:13 tsutsui Exp $");
#include <dev/cons.h>
#include <hp300/dev/dioreg.h>
#include <hp300/dev/diovar.h>
#include <hp300/dev/diodevs.h>
#include <hp300/dev/intiovar.h>
@ -771,7 +772,7 @@ hypercnattach(bus_space_tag_t bst, bus_addr_t addr, int scode)
return (1);
}
if (scode > 132) {
if (DIO_ISDIOII(scode)) {
dioiidev = (uint8_t *)va;
size = ((dioiidev[0x101] + 1) * 0x100000);
} else

View File

@ -1,4 +1,4 @@
/* $NetBSD: grf_rb.c,v 1.30 2005/12/11 12:17:14 christos Exp $ */
/* $NetBSD: grf_rb.c,v 1.31 2006/05/31 09:25:44 tsutsui Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@ -117,7 +117,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: grf_rb.c,v 1.30 2005/12/11 12:17:14 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: grf_rb.c,v 1.31 2006/05/31 09:25:44 tsutsui Exp $");
#include "opt_compat_hpux.h"
@ -137,6 +137,7 @@ __KERNEL_RCSID(0, "$NetBSD: grf_rb.c,v 1.30 2005/12/11 12:17:14 christos Exp $")
#include <dev/cons.h>
#include <hp300/dev/dioreg.h>
#include <hp300/dev/diovar.h>
#include <hp300/dev/diodevs.h>
#include <hp300/dev/intiovar.h>
@ -628,7 +629,7 @@ rboxcnattach(bus_space_tag_t bst, bus_addr_t addr, int scode)
return (1);
}
if (scode > 132) {
if (DIO_ISDIOII(scode)) {
dioiidev = (uint8_t *)va;
size = ((dioiidev[0x101] + 1) * 0x100000);
} else

View File

@ -1,4 +1,4 @@
/* $NetBSD: grf_tc.c,v 1.32 2005/12/11 12:17:14 christos Exp $ */
/* $NetBSD: grf_tc.c,v 1.33 2006/05/31 09:25:44 tsutsui Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@ -117,7 +117,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: grf_tc.c,v 1.32 2005/12/11 12:17:14 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: grf_tc.c,v 1.33 2006/05/31 09:25:44 tsutsui Exp $");
#include "opt_compat_hpux.h"
@ -137,6 +137,7 @@ __KERNEL_RCSID(0, "$NetBSD: grf_tc.c,v 1.32 2005/12/11 12:17:14 christos Exp $")
#include <dev/cons.h>
#include <hp300/dev/dioreg.h>
#include <hp300/dev/diovar.h>
#include <hp300/dev/diodevs.h>
#include <hp300/dev/intiovar.h>
@ -752,7 +753,7 @@ topcatcnattach(bus_space_tag_t bst, bus_addr_t addr, int scode)
return (1);
}
if (scode > 132) {
if (DIO_ISDIOII(scode)) {
dioiidev = (uint8_t *)va;
size = ((dioiidev[0x101] + 1) * 0x100000);
} else