summaryrefslogtreecommitdiff
path: root/sys/arch/hppa/stand/libsa/ct.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/hppa/stand/libsa/ct.c')
-rw-r--r--sys/arch/hppa/stand/libsa/ct.c56
1 files changed, 6 insertions, 50 deletions
diff --git a/sys/arch/hppa/stand/libsa/ct.c b/sys/arch/hppa/stand/libsa/ct.c
index 21751ec8943..8556c36b1dd 100644
--- a/sys/arch/hppa/stand/libsa/ct.c
+++ b/sys/arch/hppa/stand/libsa/ct.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ct.c,v 1.2 1998/07/08 21:34:33 mickey Exp $ */
+/* $OpenBSD: ct.c,v 1.3 1998/09/29 07:20:44 mickey Exp $ */
/* $NOWHERE: ct.c,v 2.2 1998/06/22 18:41:34 mickey Exp $ */
/*
@@ -30,7 +30,6 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-
/*
* Copyright 1996 1995 by Open Software Foundation, Inc.
* All Rights Reserved
@@ -59,13 +58,14 @@
#include <sys/disklabel.h>
#include <sys/reboot.h>
#include <machine/pdc.h>
-#include <machine/iodc.h>
#include <machine/iomod.h>
#include "dev_hppa.h"
+struct pz_device ctdev;
iodcio_t ctiodc; /* cartridge tape IODC entry point */
int ctcode[IODC_MAXSIZE/sizeof(int)];
+char ctbuf[IODC_MAXSIZE] __attribute__ ((aligned(MINIOSIZ)));
/* hp800-specific comments:
*
@@ -91,8 +91,7 @@ ctopen(f)
struct open_file *f;
#endif
{
- struct hppa_dev *dp = f->f_devdata;
- int i, ret, part = B_PARTITION(dp->bootdev);
+ int ret;
if (ctiodc == 0) {
@@ -105,29 +104,10 @@ ctopen(f)
}
if (ctiodc != NULL)
- if ((ret = (*ctiodc)(ctdev.pz_hpa, IODC_IO_BOOTIN, ctdev.pz_spa,
- ctdev.pz_layers, pdcbuf,0, btbuf,0,0)) < 0)
+ if ((ret = (*ctiodc)(ctdev.pz_hpa, IODC_IO_READ, ctdev.pz_spa,
+ ctdev.pz_layers, pdcbuf,0, ctbuf,0,0)) < 0)
printf("ct: device rewind ret'd %d\n", ret);
- ctbyteno = 0;
- for (i = part; --i >= 0; ) {
- ctworking = 0;
- for (;;) {
- ret = iodc_rw(btbuf, ctbyteno, IONBPG, F_READ, &ctdev);
- ctbyteno += IONBPG;
- if (ret <= 0)
- break;
- ctworking = 1;
- }
- if (ret < 0 && (ret != -4 || !ctworking)) {
- printf("ct: error %d after %d %d-byte records\n",
- ret, ctbyteno >> IOPGSHIFT, IONBPG);
- ctbyteno = 0;
- ctworking = 0;
- return (EIO);
- }
- }
- ctworking = 0;
return (0);
}
@@ -141,27 +121,3 @@ ctclose(f)
return 0;
}
-
-int
-ctstrategy(devdata, rw, dblk, size, buf, rsize)
- void *devdata;
- int rw;
- daddr_t dblk;
- size_t size;
- void *buf;
- size_t *rsize;
-{
- int ret;
-
- if ((ret = iodc_rw(buf, ctbyteno, size, rw, &ctdev)) < 0) {
- if (ret == -4 && ctworking)
- ret = 0;
-
- ctworking = 0;
- } else {
- ctworking = 1;
- ctbyteno += ret;
- }
-
- return (ret);
-}