From 206e2832c39d0417ab7e5b669eedb26105de4e45 Mon Sep 17 00:00:00 2001 From: agc Date: Mon, 19 Feb 2001 12:35:21 +0000 Subject: Initial import of hercules, an S/390 emulator, into the packages collection. Hercules is an open source software implementation of the mainframe System/370 and ESA/390 architectures, in addition to the new 64-bit z/Architecure. Hercules runs under Linux, Windows 98, Windows NT, Windows 2000, and NetBSD. Hercules was created by Roger Bowler and is maintained by Jay Maynard. Jan Jaeger designed and implemented many of the advanced features of Hercules, including dynamic reconfiguration, integrated console, interpretive execution, and z/Architecture support. --- emulators/hercules/patches/patch-aa | 19 +++++++++++ emulators/hercules/patches/patch-ab | 30 ++++++++++++++++++ emulators/hercules/patches/patch-ac | 63 +++++++++++++++++++++++++++++++++++++ emulators/hercules/patches/patch-ad | 18 +++++++++++ emulators/hercules/patches/patch-ae | 58 ++++++++++++++++++++++++++++++++++ 5 files changed, 188 insertions(+) create mode 100644 emulators/hercules/patches/patch-aa create mode 100644 emulators/hercules/patches/patch-ab create mode 100644 emulators/hercules/patches/patch-ac create mode 100644 emulators/hercules/patches/patch-ad create mode 100644 emulators/hercules/patches/patch-ae (limited to 'emulators/hercules/patches') diff --git a/emulators/hercules/patches/patch-aa b/emulators/hercules/patches/patch-aa new file mode 100644 index 00000000000..a677a1a69fe --- /dev/null +++ b/emulators/hercules/patches/patch-aa @@ -0,0 +1,19 @@ +$NetBSD: patch-aa,v 1.1.1.1 2001/02/19 12:35:21 agc Exp $ + +Set up compilation flags for NetBSD + +--- makefile 2001/02/19 09:39:42 1.1 ++++ makefile 2001/02/19 09:40:37 +@@ -38,9 +38,9 @@ + + # Uncomment these lines for NetBSD, with either the unproven-pthreads + # or pth packages +-#CFLAGS += -I/usr/pkg/pthreads/include -I/usr/pkg/include +-#LFLAGS += -L/usr/pkg/pthreads/lib -R/usr/pkg/pthreads +-#LFLAGS += -L/usr/pkg/lib -R/usr/pkg/pthreads/lib ++CFLAGS += -I${PREFIX}/pthreads/include -I${PREFIX}/include ++LFLAGS += -L${PREFIX}/pthreads/lib -R${PREFIX}/pthreads ++LFLAGS += -L${PREFIX}/lib -R${PREFIX}/pthreads/lib + + # Reverse the comments below to disable Compressed CKD Dasd support + #CFLAGS += -DNO_CCKD diff --git a/emulators/hercules/patches/patch-ab b/emulators/hercules/patches/patch-ab new file mode 100644 index 00000000000..9619d8ed0e7 --- /dev/null +++ b/emulators/hercules/patches/patch-ab @@ -0,0 +1,30 @@ +$NetBSD: patch-ab,v 1.1.1.1 2001/02/19 12:35:21 agc Exp $ + +Linux tape handling. + +--- tapedev.c 2001/02/19 11:50:37 1.1 ++++ tapedev.c 2001/02/19 11:57:16 +@@ -1149,7 +1149,11 @@ + dev->filename, strerror(errno)); + return 0; + } ++#if (defined(BSD) && BSD >= 199306) ++ stat = (stblk.mt_dsreg << 16) | stblk.mt_erreg; ++#else + stat = stblk.mt_gstat; ++#endif + + /* Display tape status */ + if (dev->ccwtrace || dev->ccwstep) +@@ -1240,7 +1244,11 @@ + } + + /* Intervention required if no tape is mounted */ ++#if (defined(BSD) && BSD >= 199306) ++ if (GMT_DR_OPEN(((stblk.mt_dsreg << 16) | stblk.mt_erreg))) ++#else + if (GMT_DR_OPEN(stblk.mt_gstat)) ++#endif + { + dev->sense[0] = SENSE_IR; + dev->sense[1] = SENSE1_TAPE_TUB; diff --git a/emulators/hercules/patches/patch-ac b/emulators/hercules/patches/patch-ac new file mode 100644 index 00000000000..ba36a14ef90 --- /dev/null +++ b/emulators/hercules/patches/patch-ac @@ -0,0 +1,63 @@ +$NetBSD: patch-ac,v 1.1.1.1 2001/02/19 12:35:21 agc Exp $ + +Linux tape handling. + +--- hercules.h 2001/02/19 11:13:51 1.1 ++++ hercules.h 2001/02/19 11:52:42 +@@ -935,6 +935,56 @@ + #define CCKD_OPEN_RD 2 + #define CCKD_OPEN_RW 3 + ++#if defined(BSD) && BSD >= 199306 ++struct mt_tape_info { ++ BYTE t_type; ++ const char *t_name; ++}; ++ ++#define MT_TAPE_INFO \ ++{ \ ++ {MT_ISUNKNOWN, "Unknown type of tape device"}, \ ++ {MT_ISQIC02, "Generic QIC-02 tape streamer"} \ ++} ++ ++/* Generic Mag Tape (device independent) status macros for examining ++ * mt_gstat -- HP-UX compatible. ++ * There is room for more generic status bits here, but I don't ++ * know which of them are reserved. At least three or so should ++ * be added to make this really useful. ++ */ ++#define GMT_EOF(x) ((x) & 0x80000000) ++#define GMT_BOT(x) ((x) & 0x40000000) ++#define GMT_EOT(x) ((x) & 0x20000000) ++#define GMT_SM(x) ((x) & 0x10000000) /* DDS setmark */ ++#define GMT_EOD(x) ((x) & 0x08000000) /* DDS EOD */ ++#define GMT_WR_PROT(x) ((x) & 0x04000000) ++/* #define GMT_ ? ((x) & 0x02000000) */ ++#define GMT_ONLINE(x) ((x) & 0x01000000) ++#define GMT_D_6250(x) ((x) & 0x00800000) ++#define GMT_D_1600(x) ((x) & 0x00400000) ++#define GMT_D_800(x) ((x) & 0x00200000) ++/* #define GMT_ ? ((x) & 0x00100000) */ ++/* #define GMT_ ? ((x) & 0x00080000) */ ++#define GMT_DR_OPEN(x) ((x) & 0x00040000) /* door open (no tape) */ ++/* #define GMT_ ? ((x) & 0x00020000) */ ++#define GMT_IM_REP_EN(x) ((x) & 0x00010000) /* immediate report mode */ ++/* 16 generic status bits unused */ ++/* SCSI-tape specific definitions */ ++ ++/* Bitfield shifts in the status */ ++#define MT_ST_BLKSIZE_SHIFT 0 ++#define MT_ST_BLKSIZE_MASK 0xffffff ++#define MT_ST_DENSITY_SHIFT 24 ++#define MT_ST_DENSITY_MASK 0xff000000 ++ ++#define MTSETBLK 20 /* set block length (SCSI) */ ++ ++#define MT_ISUNKNOWN 0x01 ++#define MT_ISQIC02 0x02 ++ ++#endif ++ + /*-------------------------------------------------------------------*/ + /* Global data areas in module config.c */ + /*-------------------------------------------------------------------*/ diff --git a/emulators/hercules/patches/patch-ad b/emulators/hercules/patches/patch-ad new file mode 100644 index 00000000000..f2ecc9ddd9b --- /dev/null +++ b/emulators/hercules/patches/patch-ad @@ -0,0 +1,18 @@ +$NetBSD: patch-ad,v 1.1.1.1 2001/02/19 12:35:21 agc Exp $ + +Linux tape handling. + +--- hercifc.c 2001/02/19 12:08:31 1.1 ++++ hercifc.c 2001/02/19 12:08:42 +@@ -64,7 +64,11 @@ + sin = (struct sockaddr_in*) + (oper == SIOCSIFADDR ? &ifreq.ifr_addr + :oper == SIOCSIFDSTADDR ? &ifreq.ifr_dstaddr ++#ifdef __NetBSD__ ++ :oper == SIOCSIFNETMASK ? &ifreq.ifr_broadaddr ++#else + :oper == SIOCSIFNETMASK ? &ifreq.ifr_netmask ++#endif + :NULL); + + /* Store the IP address into the structure */ diff --git a/emulators/hercules/patches/patch-ae b/emulators/hercules/patches/patch-ae new file mode 100644 index 00000000000..d1b98f85d49 --- /dev/null +++ b/emulators/hercules/patches/patch-ae @@ -0,0 +1,58 @@ +$NetBSD: patch-ae,v 1.1.1.1 2001/02/19 12:35:21 agc Exp $ + +Linux tape handling. + +--- tapecopy.c 2001/02/19 12:10:13 1.1 ++++ tapecopy.c 2001/02/19 12:14:00 +@@ -113,6 +113,7 @@ + { + int rc; /* Return code */ + struct mtget stblk; /* Area for MTIOCGET ioctl */ ++long gstat; + + rc = ioctl (devfd, MTIOCGET, (char*)&stblk); + if (rc < 0) +@@ -122,10 +123,15 @@ + return -1; + } + +- print_status (devname, stblk.mt_gstat); ++#if (defined(BSD) && BSD >= 199306) ++ gstat = (stblk.mt_dsreg << 16) | stblk.mt_erreg; ++#else ++ gstat = stblk.mt_gstat; ++#endif ++ print_status (devname, gstat); + +- if (GMT_EOD(stblk.mt_gstat)) return 1; +- if (GMT_EOT(stblk.mt_gstat)) return 1; ++ if (GMT_EOD(gstat)) return 1; ++ if (GMT_EOT(gstat)) return 1; + + return 0; + } /* end function print_status */ +@@ -152,6 +158,7 @@ + long density; /* Tape density code */ + BYTE labelrec[81]; /* Standard label (ASCIIZ) */ + AWSTAPE_BLKHDR awshdr; /* AWSTAPE block header */ ++long gstat; + + /* The first argument is the tape device name */ + if (argc > 1 && argv[1] != NULL && strlen(argv[1]) > 5 +@@ -209,9 +216,14 @@ + else + printf ("%s tape density code: 0x%lX\n", devname, density); + +- if (stblk.mt_gstat != 0) ++#if (defined(BSD) && BSD >= 199306) ++ gstat = (stblk.mt_dsreg << 16) | stblk.mt_erreg; ++#else ++ gstat = stblk.mt_gstat; ++#endif ++ if (gstat != 0) + { +- print_status (devname, stblk.mt_gstat); ++ print_status (devname, gstat); + } + + /* Set the tape device to process variable length blocks */ -- cgit v1.2.3