summaryrefslogtreecommitdiff
path: root/emulators/hercules
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2002-12-17 09:20:34 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2002-12-17 09:20:34 +0000
commit853ef658e801e96e1f55a47a3aa6ddf1ac93e426 (patch)
tree8933694a4cc4e97349ebafde6c75a8c070ca14bb /emulators/hercules
parentMark this ONLY_FOR_ARCHS=i386. (diff)
Add patch to make it build under current: missing <sys/time.h> include.
Add patch to maek it work on current: a magic () fix from kan@. Add Serguei Tzukanov's "Hard Console" hack while we use it for FreeBSD/s390 bootstrapping.
Notes
Notes: svn path=/head/; revision=71687
Diffstat (limited to 'emulators/hercules')
-rw-r--r--emulators/hercules/files/patch-hc-hack141
-rw-r--r--emulators/hercules/files/patch-hc.c54
-rw-r--r--emulators/hercules/files/patch-hercules.h222
-rw-r--r--emulators/hercules/files/patch-opcode.h12
4 files changed, 229 insertions, 0 deletions
diff --git a/emulators/hercules/files/patch-hc-hack b/emulators/hercules/files/patch-hc-hack
new file mode 100644
index 000000000000..207a0959697d
--- /dev/null
+++ b/emulators/hercules/files/patch-hc-hack
@@ -0,0 +1,141 @@
+diff -ur ./Makefile.in ../../work/hercules-2.16.5/Makefile.in
+--- ./Makefile.in Mon Jul 8 14:55:57 2002
++++ ../../work/hercules-2.16.5/Makefile.in Mon Dec 16 17:17:45 2002
+@@ -116,7 +116,7 @@
+ ipl.c assist.c dat.c \
+ stack.c cpu.c vstore.c \
+ general1.c general2.c plo.c \
+- control.c io.c \
++ control.c io.c hc.c \
+ decimal.c service.c opcode.c \
+ diagnose.c diagmssf.c vm.c \
+ channel.c ckddasd.c fbadasd.c \
+@@ -327,7 +327,7 @@
+ version.$(OBJEXT) ipl.$(OBJEXT) assist.$(OBJEXT) dat.$(OBJEXT) \
+ stack.$(OBJEXT) cpu.$(OBJEXT) vstore.$(OBJEXT) \
+ general1.$(OBJEXT) general2.$(OBJEXT) plo.$(OBJEXT) \
+- control.$(OBJEXT) io.$(OBJEXT) decimal.$(OBJEXT) \
++ control.$(OBJEXT) io.$(OBJEXT) hc.$(OBJEXT) decimal.$(OBJEXT) \
+ service.$(OBJEXT) opcode.$(OBJEXT) diagnose.$(OBJEXT) \
+ diagmssf.$(OBJEXT) vm.$(OBJEXT) channel.$(OBJEXT) \
+ ckddasd.$(OBJEXT) fbadasd.$(OBJEXT) tapedev.$(OBJEXT) \
+@@ -402,6 +402,7 @@
+ @AMDEP_TRUE@ ./$(DEPDIR)/channel.Po ./$(DEPDIR)/ckd2cckd.Po \
+ @AMDEP_TRUE@ ./$(DEPDIR)/ckddasd.Po ./$(DEPDIR)/cmpsc.Po \
+ @AMDEP_TRUE@ ./$(DEPDIR)/config.Po ./$(DEPDIR)/console.Po \
++@AMDEP_TRUE@ ./$(DEPDIR)/hc.Po \
+ @AMDEP_TRUE@ ./$(DEPDIR)/control.Po ./$(DEPDIR)/cpu.Po \
+ @AMDEP_TRUE@ ./$(DEPDIR)/ctcadpt.Po ./$(DEPDIR)/dasdcat.Po \
+ @AMDEP_TRUE@ ./$(DEPDIR)/dasdinit.Po ./$(DEPDIR)/dasdisup.Po \
+@@ -608,6 +609,7 @@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/config.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/console.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/control.Po@am__quote@
++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hc.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctcadpt.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dasdcat.Po@am__quote@
+Only in ../../work/hercules-2.16.5: Makefile.in.orig
+diff -ur ./configure.ac ../../work/hercules-2.16.5/configure.ac
+--- ./configure.ac Mon Jul 8 14:55:42 2002
++++ ../../work/hercules-2.16.5/configure.ac Mon Dec 16 17:17:45 2002
+@@ -153,6 +153,16 @@
+ [AC_DEFINE([HAVE_U_INT])],
+ [AC_MSG_ERROR([Unable to find fixed-size data types])] )] )
+
++dnl AC_MSG_NOTICE([Checking for SCSI tape support and what type])
++AC_CHECK_HEADER(sys/mtio.h,
++ [AC_DEFINE([HAVE_MTIO_H])])
++
++AC_TRY_COMPILE([#include mtio.h],
++ [mtget test;
++ int result;
++ result = test.mt_gstat; ],
++ [AC_DEFINE([GNU_MTIO_SUPPORT])])
++
+ # Compiler characteristics
+
+ AC_C_BIGENDIAN
+@@ -375,5 +385,9 @@
+ [Define to debug correct fthreads LOCK handling (requires fthreads)])
+ AH_TEMPLATE([PKGDATADIR],
+ [Directory where the HTTP server will find documents])
++AH_TEMPLATE([HAVE_MTIO_H],
++ Define if your system has sys/mtio.h])
++AH_TEMPLATE([GNU_MTIO_SUPPORT],
++ [Define if you have the GNU version of mtio.h (Linux)])
+
+ AC_OUTPUT(Makefile util/Makefile html/Makefile)
+Only in ../../work/hercules-2.16.5: configure.ac.orig
+Only in ../../work/hercules-2.16.5: hc.c
+Only in ../../work/hercules-2.16.5: hc.c.orig
+diff -ur ./opcode.c ../../work/hercules-2.16.5/opcode.c
+--- ./opcode.c Wed Jul 3 04:04:41 2002
++++ ../../work/hercules-2.16.5/opcode.c Mon Dec 16 17:17:45 2002
+@@ -1276,8 +1276,8 @@
+ /*0100*/ GENx___x___x___ ,
+ /*0101*/ GENx___x390x900 (program_return,E,"PR"),
+ /*0102*/ GENx___x390x900 (update_tree,E,"UPT"),
+- /*0103*/ GENx___x___x___ ,
+- /*0104*/ GENx___x___x___ ,
++ /*0103*/ GENx370x390x900 (hconsole_get_char,E,"HCGC"),
++ /*0104*/ GENx370x390x900 (hconsole_put_char,E,"HCPC"),
+ /*0105*/ GENx___x___x___ , /* CMSG */
+ /*0106*/ GENx___x___x___ , /* TMSG */
+ /*0107*/ GENx___x390x900 (set_clock_programmable_field,E,"SCKPF"),
+Only in ../../work/hercules-2.16.5: opcode.c.orig
+diff -ur ./opcode.h ../../work/hercules-2.16.5/opcode.h
+--- ./opcode.h Mon Mar 11 18:40:40 2002
++++ ../../work/hercules-2.16.5/opcode.h Mon Dec 16 17:17:45 2002
+@@ -1599,6 +1599,11 @@
+ DEF_INST(dummy_instruction);
+
+
++/* Instructions in hc.c */
++DEF_INST(hconsole_get_char);
++DEF_INST(hconsole_put_char);
++
++
+ /* Instructions in assist.c */
+ DEF_INST(svc_assist);
+ DEF_INST(obtain_local_lock);
+Only in ../../work/hercules-2.16.5: opcode.h.orig
+Only in ../../work/hercules-2.16.5: tapecopy.c.rej
+Only in ../../work/hercules-2.16.5: tapedev.c.rej
+diff -ur ./version.c ../../work/hercules-2.16.5/version.c
+--- ./version.c Mon Dec 16 17:15:30 2002
++++ ../../work/hercules-2.16.5/version.c Mon Dec 16 17:17:48 2002
+@@ -20,6 +20,14 @@
+
+ static const char *build_info[] = {
+
++#if defined(GNU_MTIO_SUPPORT)
++ "Using GNU tape handling",
++#elif defined(HAVE_MTIO_H)
++ "Using generic UNIX tape handling",
++#else
++ "No SCSI tape support",
++#endif
++
+ #if defined(CUSTOM_BUILD_STRING)
+ CUSTOM_BUILD_STRING,
+ #endif
+diff -ur ./version.c.orig ../../work/hercules-2.16.5/version.c.orig
+--- ./version.c.orig Mon May 20 23:02:41 2002
++++ ../../work/hercules-2.16.5/version.c.orig Mon Dec 16 17:17:29 2002
+@@ -106,6 +106,14 @@
+ "No HET BZIP2 support",
+ #endif
+
++#if defined(GNU_MTIO_SUPPORT)
++ "Using GNU tape handling",
++#elif defined(HAVE_MTIO_H)
++ "Using generic Unix tape handling",
++#else
++ "No SCSI tape support",
++#endif
++
+ " "
+
+ };
+Only in .: version.c.orig.rej
diff --git a/emulators/hercules/files/patch-hc.c b/emulators/hercules/files/patch-hc.c
new file mode 100644
index 000000000000..23359f5ced93
--- /dev/null
+++ b/emulators/hercules/files/patch-hc.c
@@ -0,0 +1,54 @@
+--- /dev/null Mon Dec 16 17:18:27 2002
++++ hc.c Mon Dec 16 17:21:15 2002
+@@ -0,0 +1,51 @@
++#include "hercules.h"
++
++#include "opcode.h"
++
++#include "inline.h"
++
++static int hcd;
++
++DEF_INST(hconsole_get_char)
++{
++ char ch;
++
++ E(inst, execflag, regs);
++
++ if (hcd == 0)
++ hcd = open("/home/tzukanov/hercules/hc",
++ O_RDWR | O_NONBLOCK | O_CREAT, 0);
++ if (read(hcd, &ch, 1) == 1)
++ regs->GR_LHLCL(1) = ch;
++ else
++ regs->GR_L(1) = -1;
++}
++
++DEF_INST(hconsole_put_char)
++{
++ char ch;
++
++ E(inst, execflag, regs);
++
++
++ if (hcd == 0)
++ hcd = open("/home/tzukanov/hercules/hc",
++ O_RDWR | O_NONBLOCK | O_CREAT, 0);
++ ch = regs->GR_LHLCL(1);
++ write(hcd, &ch, 1);
++}
++
++#if !defined(_GEN_ARCH)
++
++#if defined(_ARCHMODE2)
++ #define _GEN_ARCH _ARCHMODE2
++ #include "hc.c"
++#endif
++
++#if defined(_ARCHMODE3)
++ #undef _GEN_ARCH
++ #define _GEN_ARCH _ARCHMODE3
++ #include "hc.c"
++#endif
++
++#endif /*!defined(_GEN_ARCH)*/
diff --git a/emulators/hercules/files/patch-hercules.h2 b/emulators/hercules/files/patch-hercules.h2
new file mode 100644
index 000000000000..524288cf1b8d
--- /dev/null
+++ b/emulators/hercules/files/patch-hercules.h2
@@ -0,0 +1,22 @@
+diff -ur hercules.h.orig hercules.h
+--- hercules.h.orig Wed Dec 4 16:53:55 2002
++++ hercules.h Wed Dec 4 10:09:08 2002
+@@ -49,6 +49,7 @@
+ #include "hbyteswp.h"
+ #endif
+ #include <sys/types.h>
++#include <sys/time.h>
+ #include <sys/resource.h>
+ #include <sys/stat.h>
+ #include <sys/socket.h>
+@@ -289,8 +290,10 @@
+ #endif // !defined(WIN32)
+ #define thread_id() \
+ pthread_self()
++#if 0
+ #define exit_thread(exitvar_ptr) \
+ pthread_exit((exitvar_ptr))
++#endif
+ #endif // defined(OPTION_FTHREADS)
+ #else
+ typedef int TID;
diff --git a/emulators/hercules/files/patch-opcode.h b/emulators/hercules/files/patch-opcode.h
new file mode 100644
index 000000000000..5681b94ca395
--- /dev/null
+++ b/emulators/hercules/files/patch-opcode.h
@@ -0,0 +1,12 @@
+diff -ur ./opcode.h ../../work__/hercules-2.16.5/opcode.h
+--- ./opcode.h Tue Dec 17 07:39:27 2002
++++ ../../work__/hercules-2.16.5/opcode.h Tue Dec 17 07:33:01 2002
+@@ -104,7 +104,7 @@
+ }
+
+
+-typedef ATTR_REGPARM(3) void (*zz_func) (BYTE inst[], int execflag, REGS *regs);
++typedef void (ATTR_REGPARM(3) *zz_func) (BYTE inst[], int execflag, REGS *regs);
+
+ /* Gabor Hoffer (performance option) */
+ extern zz_func s370_opcode_table[];