summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authortron <tron@NetBSD.org>2006-06-27 10:34:25 +0000
committertron <tron@NetBSD.org>2006-06-27 10:34:25 +0000
commit9021894476d2fb128e002ed7fad08afbf060cd3d (patch)
treefcc42556f0e42c6c87b87333768f1b4ca371de1b /sys/dev
parentc4a04b7ba4e0ce2e9badd5c36043c590a6967d42 (diff)
Make this build with GCC 4.x.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/agp.c10
-rw-r--r--sys/dev/pci/agp_i810.c11
-rw-r--r--sys/dev/scsipi/atapi_wdc.c12
3 files changed, 20 insertions, 13 deletions
diff --git a/sys/dev/pci/agp.c b/sys/dev/pci/agp.c
index ef48307d0a4..ebf3bf60197 100644
--- a/sys/dev/pci/agp.c
+++ b/sys/dev/pci/agp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: agp.c,v 1.37 2006/01/16 22:59:36 christos Exp $ */
+/* $NetBSD: agp.c,v 1.38 2006/06/27 10:34:25 tron Exp $ */
/*-
* Copyright (c) 2000 Doug Rabson
@@ -65,7 +65,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: agp.c,v 1.37 2006/01/16 22:59:36 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: agp.c,v 1.38 2006/06/27 10:34:25 tron Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -313,6 +313,7 @@ agp_alloc_gatt(struct agp_softc *sc)
u_int32_t apsize = AGP_GET_APERTURE(sc);
u_int32_t entries = apsize >> AGP_PAGE_SHIFT;
struct agp_gatt *gatt;
+ caddr_t virtual;
int dummyseg;
gatt = malloc(sizeof(struct agp_gatt), M_AGP, M_NOWAIT);
@@ -321,9 +322,10 @@ agp_alloc_gatt(struct agp_softc *sc)
gatt->ag_entries = entries;
if (agp_alloc_dmamem(sc->as_dmat, entries * sizeof(u_int32_t),
- 0, &gatt->ag_dmamap, (caddr_t *)&gatt->ag_virtual,
- &gatt->ag_physical, &gatt->ag_dmaseg, 1, &dummyseg) != 0)
+ 0, &gatt->ag_dmamap, &virtual, &gatt->ag_physical,
+ &gatt->ag_dmaseg, 1, &dummyseg) != 0)
return NULL;
+ gatt->ag_virtual = (uint32_t *)virtual;
gatt->ag_size = entries * sizeof(u_int32_t);
memset(gatt->ag_virtual, 0, gatt->ag_size);
diff --git a/sys/dev/pci/agp_i810.c b/sys/dev/pci/agp_i810.c
index 13d0fdf9305..805b73d02bc 100644
--- a/sys/dev/pci/agp_i810.c
+++ b/sys/dev/pci/agp_i810.c
@@ -1,4 +1,4 @@
-/* $NetBSD: agp_i810.c,v 1.30 2006/05/14 21:45:00 elad Exp $ */
+/* $NetBSD: agp_i810.c,v 1.31 2006/06/27 10:34:25 tron Exp $ */
/*-
* Copyright (c) 2000 Doug Rabson
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: agp_i810.c,v 1.30 2006/05/14 21:45:00 elad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: agp_i810.c,v 1.31 2006/06/27 10:34:25 tron Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -249,7 +249,9 @@ agp_i810_attach(struct device *parent, struct device *self, void *aux)
gatt->ag_entries = AGP_GET_APERTURE(sc) >> AGP_PAGE_SHIFT;
if (isc->chiptype == CHIP_I810) {
+ caddr_t virtual;
int dummyseg;
+
/* Some i810s have on-chip memory called dcache */
if (READ1(AGP_I810_DRT) & AGP_I810_DRT_POPULATED)
isc->dcache_size = 4 * 1024 * 1024;
@@ -258,12 +260,13 @@ agp_i810_attach(struct device *parent, struct device *self, void *aux)
/* According to the specs the gatt on the i810 must be 64k */
if (agp_alloc_dmamem(sc->as_dmat, 64 * 1024,
- 0, &gatt->ag_dmamap, (caddr_t *)&gatt->ag_virtual,
- &gatt->ag_physical, &gatt->ag_dmaseg, 1, &dummyseg) != 0) {
+ 0, &gatt->ag_dmamap, &virtual, &gatt->ag_physical,
+ &gatt->ag_dmaseg, 1, &dummyseg) != 0) {
free(gatt, M_AGP);
agp_generic_detach(sc);
return ENOMEM;
}
+ gatt->ag_virtual = (uint32_t *)virtual;
gatt->ag_size = gatt->ag_entries * sizeof(u_int32_t);
memset(gatt->ag_virtual, 0, gatt->ag_size);
diff --git a/sys/dev/scsipi/atapi_wdc.c b/sys/dev/scsipi/atapi_wdc.c
index 1e5f20377d2..1e07cef2bfa 100644
--- a/sys/dev/scsipi/atapi_wdc.c
+++ b/sys/dev/scsipi/atapi_wdc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: atapi_wdc.c,v 1.99 2006/05/21 23:56:09 christos Exp $ */
+/* $NetBSD: atapi_wdc.c,v 1.100 2006/06/27 10:39:51 tron Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: atapi_wdc.c,v 1.99 2006/05/21 23:56:09 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: atapi_wdc.c,v 1.100 2006/06/27 10:39:51 tron Exp $");
#ifndef ATADEBUG
#define ATADEBUG
@@ -300,9 +300,11 @@ wdc_atapi_probe_device(struct atapibus_softc *sc, int target)
sa.sa_inqbuf.type = ATAPI_CFG_TYPE(id->atap_config);
sa.sa_inqbuf.removable = id->atap_config & ATAPI_CFG_REMOV ?
T_REMOV : T_FIXED;
- scsipi_strvis(model, 40, id->atap_model, 40);
- scsipi_strvis(serial_number, 20, id->atap_serial, 20);
- scsipi_strvis(firmware_revision, 8, id->atap_revision, 8);
+ scsipi_strvis((u_char *)model, 40, id->atap_model, 40);
+ scsipi_strvis((u_char *)serial_number, 20, id->atap_serial,
+ 20);
+ scsipi_strvis((u_char *)firmware_revision, 8,
+ id->atap_revision, 8);
sa.sa_inqbuf.vendor = model;
sa.sa_inqbuf.product = serial_number;
sa.sa_inqbuf.revision = firmware_revision;