summaryrefslogtreecommitdiff
path: root/emulators/hercules/patches
diff options
context:
space:
mode:
authoragc <agc>2001-02-26 14:49:34 +0000
committeragc <agc>2001-02-26 14:49:34 +0000
commit28abe02359021ee17700ab77005e3716c1febdc2 (patch)
tree82227cc0648a026a25508d96d91b504f9e4f3356 /emulators/hercules/patches
parent6b858148513a3883887000e97425588141071dd0 (diff)
downloadpkgsrc-28abe02359021ee17700ab77005e3716c1febdc2.tar.gz
Add a patch to stop the Hercules emulator dumping core when exitting, from
Wolfgang Solfrank (ws@tools.de)
Diffstat (limited to 'emulators/hercules/patches')
-rw-r--r--emulators/hercules/patches/patch-ag35
-rw-r--r--emulators/hercules/patches/patch-ah14
-rw-r--r--emulators/hercules/patches/patch-ai20
3 files changed, 69 insertions, 0 deletions
diff --git a/emulators/hercules/patches/patch-ag b/emulators/hercules/patches/patch-ag
new file mode 100644
index 00000000000..52562cb2625
--- /dev/null
+++ b/emulators/hercules/patches/patch-ag
@@ -0,0 +1,35 @@
+$NetBSD: patch-ag,v 1.1 2001/02/26 14:49:35 agc Exp $
+
+Fix for coredump on exit on NetBSD from Wolfgang Solfrank
+
+--- cpu.c 2001/02/26 14:35:56 1.1
++++ cpu.c 2001/02/26 14:40:26
+@@ -741,19 +741,22 @@
+
+ void *cpu_thread (REGS *regs)
+ {
+-#define CPU_PRIORITY 15 /* CPU thread priority */
+
+ #ifndef WIN32
+- /* Set CPU thread priority */
+- if (setpriority(PRIO_PROCESS, 0, CPU_PRIORITY))
+- logmsg ("HHC621I CPU thread set priority failed: %s\n",
+- strerror(errno));
++ struct sched_param sp;
++ int p;
++
++ if (pthread_getschedparam(pthread_self(), &p, &sp)
++ || (sp.sched_priority = sched_get_priority_min(p),
++ pthread_setschedparam(pthread_self(), p, &sp)))
++ logmsg ("HHC621I CPU thread set priority failed: %s\n",
++ strerror(errno));
+
+ /* Display thread started message on control panel */
+ logmsg ("HHC620I CPU%4.4X thread started: tid=%8.8lX, pid=%d, "
+ "priority=%d\n",
+ regs->cpuad, thread_id(), getpid(),
+- getpriority(PRIO_PROCESS,0));
++ sp.sched_priority);
+ #endif
+
+ logmsg ("HHC630I CPU%4.4X Architecture Mode %s\n",regs->cpuad,
diff --git a/emulators/hercules/patches/patch-ah b/emulators/hercules/patches/patch-ah
new file mode 100644
index 00000000000..e8b2d65a1c2
--- /dev/null
+++ b/emulators/hercules/patches/patch-ah
@@ -0,0 +1,14 @@
+$NetBSD: patch-ah,v 1.1 2001/02/26 14:49:35 agc Exp $
+
+Fix for coredump on exit on NetBSD from Wolfgang Solfrank
+
+--- hercules.h 2001/02/26 14:36:15 1.1
++++ hercules.h 2001/02/26 14:40:28
+@@ -110,6 +110,7 @@
+ #define HAVE_STRUCT_TIMESPEC
+ #endif
+ #include <pthread.h>
++#include <sched.h>
+ #ifdef WIN32
+ #undef DWORD
+ #endif
diff --git a/emulators/hercules/patches/patch-ai b/emulators/hercules/patches/patch-ai
new file mode 100644
index 00000000000..465b44512cb
--- /dev/null
+++ b/emulators/hercules/patches/patch-ai
@@ -0,0 +1,20 @@
+$NetBSD: patch-ai,v 1.1 2001/02/26 14:49:35 agc Exp $
+
+Fix for coredump on exit on NetBSD from Wolfgang Solfrank
+
+--- panel.c 2001/02/26 14:36:27 1.1
++++ panel.c 2001/02/26 14:40:30
+@@ -1798,6 +1798,13 @@
+ /* quit or exit command - terminate the emulator */
+ if (strcmp(cmd,"quit") == 0 || strcmp(cmd,"exit") == 0)
+ {
++ struct sched_param sp;
++ int p;
++
++ pthread_getschedparam(pthread_self(), &p, &sp);
++ sp.sched_priority = sched_get_priority_max(p);
++ pthread_setschedparam(pthread_self(), p, &sp);
++
+ sysblk.msgpipew = stderr;
+ devascii = strtok(cmd+4," \t");
+ if (devascii == NULL || strcmp("now",devascii))