PERFORCE change 151806 for review
Nathan Whitehorn
nwhitehorn at FreeBSD.org
Thu Oct 23 14:23:53 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=151806
Change 151806 by nwhitehorn at nwhitehorn_trantor on 2008/10/23 14:23:37
Mambodisk supports 4K transfers -- let it use them.
Affected files ...
.. //depot/projects/ppc-g5/sys/powerpc/mambo/mambodisk.c#2 edit
Differences ...
==== //depot/projects/ppc-g5/sys/powerpc/mambo/mambodisk.c#2 (text+ko) ====
@@ -49,6 +49,7 @@
struct proc *p;
struct bio_queue_head bio_queue;
int running;
+ int maxblocks;
};
#define MAMBO_DISK_READ 116
@@ -116,8 +117,10 @@
d->d_drv1 = sc;
d->d_maxsize = MAXPHYS; /* Maybe ask bridge? */
- d->d_sectorsize = mambocall(MAMBO_DISK_INFO,MAMBO_INFO_BLKSZ,d->d_unit)
- / 8; /* Mambo gives an answer 8 times too large, for fun */
+ d->d_sectorsize = 512;
+ sc->maxblocks = mambocall(MAMBO_DISK_INFO,MAMBO_INFO_BLKSZ,d->d_unit)
+ / 512;
+
d->d_unit = device_get_unit(dev);
d->d_mediasize = mambocall(MAMBO_DISK_INFO,MAMBO_INFO_DEVSZ,d->d_unit)
* 1024; /* Mambo gives size in KB */
@@ -221,7 +224,10 @@
char *vaddr = bp->bio_data +
(block - bp->bio_pblkno) * sz;
- numblocks = 1;
+ numblocks = end - block;
+ if (numblocks > sc->maxblocks)
+ numblocks = sc->maxblocks;
+
if (bp->bio_cmd == BIO_READ) {
result = mambocall(MAMBO_DISK_READ, vaddr,
(uint32_t)block, (numblocks << 16) | unit);
More information about the p4-projects
mailing list