diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2003-04-30 23:03:56 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2003-04-30 23:03:56 +0000 |
commit | 8f04a387eff8f9fd5d05c4864f4035b4cb15fe66 (patch) | |
tree | 1f027764fb0ecc525b2b108f8875eca2d1e0ff5a /sys/arch | |
parent | 7d574f0a3d1f4b26821a0e7425e118287467c3fb (diff) |
do not be hungry for buffers and allocate lower than a max (for iodc io)
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/hppa/include/pdc.h | 3 | ||||
-rw-r--r-- | sys/arch/hppa/stand/libsa/dev_hppa.h | 5 | ||||
-rw-r--r-- | sys/arch/hppa/stand/libsa/pdc.c | 14 |
3 files changed, 10 insertions, 12 deletions
diff --git a/sys/arch/hppa/include/pdc.h b/sys/arch/hppa/include/pdc.h index 9990bc27113..d8b1a3c9626 100644 --- a/sys/arch/hppa/include/pdc.h +++ b/sys/arch/hppa/include/pdc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pdc.h,v 1.23 2003/03/29 01:00:49 mickey Exp $ */ +/* $OpenBSD: pdc.h,v 1.24 2003/04/30 23:03:55 mickey Exp $ */ /* * Copyright (c) 1990 mt Xinu, Inc. All rights reserved. @@ -91,6 +91,7 @@ #define IODC_MAXSIZE (16 * 4 * 1024) /* maximum size of IODC */ #define IODC_MINIOSIZ 64 /* minimum buffer size for IODC call */ #define IODC_MAXIOSIZ (64 * 1024) /* maximum buffer size for IODC call */ +#define IODC_IOSIZ (16 * 1024) #define PDC_ALIGNMENT __attribute__ ((__aligned__(64))) #define PDC_STACKSIZE (4*NBPG) diff --git a/sys/arch/hppa/stand/libsa/dev_hppa.h b/sys/arch/hppa/stand/libsa/dev_hppa.h index 2f9c87b7ebc..e302f01d6ab 100644 --- a/sys/arch/hppa/stand/libsa/dev_hppa.h +++ b/sys/arch/hppa/stand/libsa/dev_hppa.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dev_hppa.h,v 1.6 2003/04/29 22:38:50 mickey Exp $ */ +/* $OpenBSD: dev_hppa.h,v 1.7 2003/04/30 23:03:55 mickey Exp $ */ #define IOPGSHIFT 11 @@ -15,8 +15,7 @@ struct hppa_dev { struct disklabel *label; /* buffer to cache data (aligned properly) */ char *buf; - char ua_buf[IODC_MAXIOSIZ + IODC_MINIOSIZ]; - + char ua_buf[IODC_IOSIZ + IODC_MINIOSIZ]; }; #ifdef PDCDEBUG diff --git a/sys/arch/hppa/stand/libsa/pdc.c b/sys/arch/hppa/stand/libsa/pdc.c index 16e4e57d33a..77d258b7100 100644 --- a/sys/arch/hppa/stand/libsa/pdc.c +++ b/sys/arch/hppa/stand/libsa/pdc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pdc.c,v 1.15 2003/04/30 04:09:38 mickey Exp $ */ +/* $OpenBSD: pdc.c,v 1.16 2003/04/30 23:03:55 mickey Exp $ */ /* * Copyright (c) 1998 Michael Shalayeff @@ -144,7 +144,7 @@ iodcstrategy(devdata, rw, blk, size, buf, rsize) #ifdef PDCDEBUG if (debug) printf("iodcstrategy(%p, %s, %u, %u, %p, %p)\n", devdata, - rw==F_READ?"READ":"WRITE", blk, size, buf, rsize); + rw==F_READ? "READ" : "WRITE", blk, size, buf, rsize); if (debug > 1) PZDEV_PRINT(pzdev); @@ -159,7 +159,6 @@ iodcstrategy(devdata, rw, blk, size, buf, rsize) if (debug) printf("iodc: rewind "); #endif - twiddle(); if ((ret = (pzdev->pz_iodc_io)(pzdev->pz_hpa, IODC_IO_READ, pzdev->pz_spa, pzdev->pz_layers, pdcbuf, 0, dp->buf, 0, 0)) < 0) { @@ -184,8 +183,8 @@ iodcstrategy(devdata, rw, blk, size, buf, rsize) dp->last_blk += dp->last_read; if ((ret = (pzdev->pz_iodc_io)(pzdev->pz_hpa, IODC_IO_READ, pzdev->pz_spa, pzdev->pz_layers, - pdcbuf, dp->last_blk, dp->buf, IODC_MAXIOSIZ, - IODC_MAXIOSIZ)) < 0) { + pdcbuf, dp->last_blk, dp->buf, IODC_IOSIZ, + IODC_IOSIZ)) < 0) { #ifdef DEBUG if (debug) printf("IODC_IO: %d\n", ret); @@ -230,12 +229,11 @@ iodcstrategy(devdata, rw, blk, size, buf, rsize) if ((ret = (pzdev->pz_iodc_io)(pzdev->pz_hpa, (rw == F_READ? IODC_IO_READ: IODC_IO_WRITE), pzdev->pz_spa, pzdev->pz_layers, pdcbuf, - blk - offset, dp->buf, IODC_MAXIOSIZ, - IODC_MAXIOSIZ)) < 0) { + blk - offset, dp->buf, IODC_IOSIZ, IODC_IOSIZ)) < 0) { #ifdef DEBUG if (debug) printf("iodc_read(%d,%d): %d\n", - blk - offset, IODC_MAXIOSIZ, ret); + blk - offset, IODC_IOSIZ, ret); #endif if (xfer) break; |