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.
This commit is contained in:
Peter Grehan 2005-10-31 03:09:38 +00:00
parent 1ffe41c1ec
commit a3624af7d8

View File

@ -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;