[Simh] [PATCH 13 of 14] sim_printf_log() changes for HP2100

Peter Lund firefly at vax64.dk
Mon Sep 10 17:09:47 EDT 2007


2 files changed, 8 insertions(+), 17 deletions(-)
HP2100/hp2100_cpu.c |   14 +++++---------
HP2100/hp2100_ipl.c |   11 +++--------


# HG changeset patch
# User Peter Lund <firefly at vax64.dk>
# Date 1189306645 -7200
# Node ID 1784e41ec49b9c5c1572050a11a2be76e3204fd2
# Parent  da3e9cdc2db2b9882d1eeef558e38732ec62f5ca
sim_printf_log() changes for HP2100

diff -r da3e9cdc2db2 -r 1784e41ec49b HP2100/hp2100_cpu.c
--- a/HP2100/hp2100_cpu.c	Sun Sep 09 04:57:08 2007 +0200
+++ b/HP2100/hp2100_cpu.c	Sun Sep 09 04:57:25 2007 +0200
@@ -370,6 +370,7 @@
 #include "hp2100_defs.h"
 #include <setjmp.h>
 #include "hp2100_cpu.h"
+#include "sim_console.h"
 
 /* Memory protect constants */
 
@@ -486,7 +487,6 @@ extern int32 sim_brk_char;
 extern int32 sim_brk_char;
 extern int32 sim_del_char;
 extern uint32 sim_brk_types, sim_brk_dflt, sim_brk_summ; /* breakpoint info */
-extern FILE *sim_log;
 extern DEVICE *sim_devices[];
 extern int32 sim_switches;
 extern char halt_msg[];
@@ -2326,21 +2326,17 @@ if (is_conflict) {
     for (i = 0; i <= I_DEVMASK; i++) {
         if (conflicts[i] > 1) {
             k = conflicts[i];
-            printf ("Select code %o conflict:", i);
-            if (sim_log) fprintf (sim_log, "Select code %o conflict:", i);
+            sim_printf_log ("Select code %o conflict:", i);
             for (j = 0; dptr = sim_devices[j]; j++) {
                 dibp = (DIB *) dptr->ctxt;
                 if (dibp && !(dptr->flags & DEV_DIS) && (i == dibp->devno)) {
                     if (k < conflicts[i]) {
-                        printf (" and");
-                        if (sim_log) fputs (" and", sim_log);
+                        sim_printf_log (" and");
                         }
-                    printf (" %s", sim_dname (dptr));
-                    if (sim_log) fprintf (sim_log, " %s", sim_dname (dptr));
+                    sim_printf_log (" %s", sim_dname (dptr));
                     k = k - 1;
                     if (k == 0) {
-                        putchar ('\n');
-                        if (sim_log) fputc ('\n', sim_log);
+                        sim_printf_log("\n");
                         break;
                         }
                     }
diff -r da3e9cdc2db2 -r 1784e41ec49b HP2100/hp2100_ipl.c
--- a/HP2100/hp2100_ipl.c	Sun Sep 09 04:57:08 2007 +0200
+++ b/HP2100/hp2100_ipl.c	Sun Sep 09 04:57:25 2007 +0200
@@ -54,6 +54,7 @@
 #include "hp2100_defs.h"
 #include "sim_sock.h"
 #include "sim_tmxr.h"
+#include "sim_console.h"
 
 #define UNIT_V_DIAG     (UNIT_V_UF + 0)                 /* diagnostic mode */
 #define UNIT_V_ACTV     (UNIT_V_UF + 1)                 /* making connection */
@@ -76,7 +77,6 @@
 
 extern uint32 PC;
 extern uint32 dev_cmd[2], dev_ctl[2], dev_flg[2], dev_fbf[2], dev_srq[2];
-extern FILE *sim_log;
 extern FILE *sim_deb;
 int32 ipl_edtdelay = 1;                                 /* EDT delay (msec) */
 int32 ipl_ptime = 31;                                   /* polling interval */
@@ -463,11 +463,7 @@ if ((sim_switches & SWMASK ('C')) ||
         if (ipa == 0) ipa = 0x7F000001;
         newsock = sim_connect_sock (ipa, ipp);
         if (newsock == INVALID_SOCKET) return SCPE_IOERR;
-        printf ("Connecting to IP address %d.%d.%d.%d, port %d\n",
-            (ipa >> 24) & 0xff, (ipa >> 16) & 0xff,
-            (ipa >> 8) & 0xff, ipa & 0xff, ipp);
-        if (sim_log) fprintf (sim_log,
-            "Connecting to IP address %d.%d.%d.%d, port %d\n",
+        sim_printf_log ("Connecting to IP address %d.%d.%d.%d, port %d\n",
             (ipa >> 24) & 0xff, (ipa >> 16) & 0xff,
             (ipa >> 8) & 0xff, ipa & 0xff, ipp);
         uptr->flags = uptr->flags | UNIT_ACTV;
@@ -478,8 +474,7 @@ else {
     if (ipa != 0) return SCPE_ARG;
     newsock = sim_master_sock (ipp);
     if (newsock == INVALID_SOCKET) return SCPE_IOERR;
-    printf ("Listening on port %d\n", ipp);
-    if (sim_log) fprintf (sim_log, "Listening on port %d\n", ipp);
+    sim_printf_log ("Listening on port %d\n", ipp);
     uptr->flags = uptr->flags & ~UNIT_ACTV;
     uptr->LSOCKET = newsock;
     uptr->DSOCKET = 0;



More information about the Simh mailing list