summaryrefslogtreecommitdiffstats
path: root/sys/dev/ofw
diff options
context:
space:
mode:
authorgrehan <grehan@FreeBSD.org>2005-10-31 03:09:38 +0000
committergrehan <grehan@FreeBSD.org>2005-10-31 03:09:38 +0000
commit29214ebf275512793df4d761340d9842504e726d (patch)
treeabf80d4e6208cabdbf8c3ea049e16c1063871ed1 /sys/dev/ofw
parent0dd5d190ee9d04b14383687e8026a83961f177ee (diff)
downloadFreeBSD-src-29214ebf275512793df4d761340d9842504e726d.zip
FreeBSD-src-29214ebf275512793df4d761340d9842504e726d.tar.gz
The mediasize shouldn't be multipled by the sector size when it was
in bytes to start off with. This caused the GPT geom sniffer to attempt a seek just back from the end of the 'disk', which resulted in a > 4G seek, causing gdb psim to exit since it only supports 32-bit seeks. The size of the disk should really be specified in the psim device tree, but for now do the minimal amount of work to get psim to run again.
Diffstat (limited to 'sys/dev/ofw')
-rw-r--r--sys/dev/ofw/ofw_disk.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/ofw/ofw_disk.c b/sys/dev/ofw/ofw_disk.c
index 5c759d1..130c869 100644
--- a/sys/dev/ofw/ofw_disk.c
+++ b/sys/dev/ofw/ofw_disk.c
@@ -82,6 +82,7 @@ ofwd_startio(struct ofwd_softc *sc, struct bio *bp)
u_int r;
r = OF_seek(sc->ofwd_instance, bp->bio_offset);
+
switch (bp->bio_cmd) {
case BIO_READ:
r = OF_read(sc->ofwd_instance, (void *)bp->bio_data,
@@ -164,7 +165,7 @@ g_ofwd_init(struct g_class *mp __unused)
bioq_init(&sc->ofwd_bio_queue);
mtx_init(&sc->ofwd_queue_mtx, "ofwd bio queue", NULL, MTX_DEF);
sc->ofwd_instance = ifd;
- sc->ofwd_mediasize = (off_t)2*33554432 * OFWD_BLOCKSIZE;
+ sc->ofwd_mediasize = (off_t)2*33554432;
sc->ofwd_sectorsize = OFWD_BLOCKSIZE;
sc->ofwd_fwsectors = 0;
sc->ofwd_fwheads = 0;
OpenPOWER on IntegriCloud