summaryrefslogtreecommitdiff
path: root/emulators/hercules/patches/patch-ac
blob: e45ea816b428c70a1ac6808b27eac887bd26c3ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
$NetBSD: patch-ac,v 1.2 2004/06/13 14:03:28 agc Exp $

Linux tape handling.

--- hercules.h	2004-06-13 14:44:50.000000000 +0100
+++ hercules.h	2004-06-13 14:47:06.000000000 +0100
@@ -34,6 +34,7 @@
  #include <byteswap.h>
 #endif
 #include <sys/types.h>
+#include <sys/param.h>
 #include <sys/resource.h>
 #include <sys/stat.h>
 #include <sys/socket.h>
@@ -110,6 +111,7 @@
 #define HAVE_STRUCT_TIMESPEC
 #endif
 #include <pthread.h>
+#include <sched.h>
 #ifdef WIN32
 #undef DWORD
 #endif
@@ -935,6 +937,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 			     */
 /*-------------------------------------------------------------------*/