[Simh] [PATCH 03 of 14] sim_printf_log() changes for VAX

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


5 files changed, 14 insertions(+), 34 deletions(-)
VAX/vax780_mba.c |    7 ++-----
VAX/vax780_sbi.c |   10 +++-------
VAX/vax780_uba.c |   13 ++++---------
VAX/vax_io.c     |   12 +++---------
VAX/vax_sysdev.c |    6 ++----


# HG changeset patch
# User Peter Lund <firefly at vax64.dk>
# Date 1189306469 -7200
# Node ID 12771ea2fbee8e16231265bc1e6567a9ef11e181
# Parent  88f8539ad85b749ffad9a3c556381e5aa31e4a4e
sim_printf_log() changes for VAX

diff -r 88f8539ad85b -r 12771ea2fbee VAX/vax780_mba.c
--- a/VAX/vax780_mba.c	Sun Sep 09 04:54:03 2007 +0200
+++ b/VAX/vax780_mba.c	Sun Sep 09 04:54:29 2007 +0200
@@ -27,6 +27,7 @@
 */
 
 #include "vax_defs.h"
+#include "sim_console.h"
 
 /* Massbus */
 
@@ -158,7 +159,6 @@ uint32 mba_map[MBA_NUM][MBA_NMAPR];     
 
 extern uint32 nexus_req[NEXUS_HLVL];
 extern UNIT cpu_unit;
-extern FILE *sim_log;
 extern FILE *sim_deb;
 extern int32 sim_switches;
 
@@ -755,10 +755,7 @@ if ((mbregR[idx] && dibp->rd &&         
     (mbregW[idx] != dibp->wr)) ||
     (mbabort[idx] && dibp->ack[0] &&
     (mbabort[idx] != dibp->ack[0]))) {
-        printf ("Massbus %s assignment conflict at %d\n",
-            sim_dname (dptr), dibp->ba);
-        if (sim_log) fprintf (sim_log,
-            "Massbus %s assignment conflict at %d\n",
+        sim_printf_log ("Massbus %s assignment conflict at %d\n",
             sim_dname (dptr), dibp->ba);
         return SCPE_STOP;
         }
diff -r 88f8539ad85b -r 12771ea2fbee VAX/vax780_sbi.c
--- a/VAX/vax780_sbi.c	Sun Sep 09 04:54:03 2007 +0200
+++ b/VAX/vax780_sbi.c	Sun Sep 09 04:54:29 2007 +0200
@@ -31,6 +31,7 @@
 */
 
 #include "vax_defs.h"
+#include "sim_console.h"
 
 /* 11/780 specific IPRs */
 
@@ -123,7 +124,6 @@ extern int32 p1;
 extern int32 p1;
 extern int32 sim_switches;
 extern DEVICE *sim_devices[];
-extern FILE *sim_log;
 extern CTAB *sim_vm_cmd;
 
 t_stat sbi_reset (DEVICE *dptr);
@@ -643,9 +643,7 @@ t_stat cpu_boot (int32 unitno, DEVICE *d
 {
 t_stat r;
 
-printf ("Loading boot code from vmb.exe\n");
-if (sim_log) fprintf (sim_log, 
-    "Loading boot code from vmb.exe\n");
+sim_printf_log ("Loading boot code from vmb.exe\n");
 r = load_cmd (0, "-O vmb.exe 200");
 if (r != SCPE_OK) return r;
 SP = PC = 512;
@@ -710,9 +708,7 @@ if ((nexusR[idx] && dibp->rd &&         
     (nexusR[idx] != dibp->rd)) ||
     (nexusW[idx] && dibp->wr &&
     (nexusW[idx] != dibp->wr))) {
-    printf ("Nexus %s conflict at %d\n", sim_dname (dptr), dibp->ba);
-    if (sim_log) fprintf (sim_log,
-        "Nexus %s conflict at %d\n", sim_dname (dptr), dibp->ba);
+    sim_printf_log ("Nexus %s conflict at %d\n", sim_dname (dptr), dibp->ba);
     return SCPE_STOP;
     }
 if (dibp->rd) nexusR[idx] = dibp->rd;                   /* set rd dispatch */
diff -r 88f8539ad85b -r 12771ea2fbee VAX/vax780_uba.c
--- a/VAX/vax780_uba.c	Sun Sep 09 04:54:03 2007 +0200
+++ b/VAX/vax780_uba.c	Sun Sep 09 04:54:29 2007 +0200
@@ -27,6 +27,7 @@
 */
 
 #include "vax_defs.h"
+#include "sim_console.h"
 
 /* Unibus adapter */
 
@@ -178,7 +179,7 @@ extern UNIT cpu_unit;
 extern UNIT cpu_unit;
 extern uint32 nexus_req[NEXUS_HLVL];
 extern int32 sim_switches;
-extern FILE *sim_log, *sim_deb;
+extern FILE *sim_deb;
 
 t_stat uba_svc (UNIT *uptr);
 t_stat uba_reset (DEVICE *dptr);
@@ -1105,10 +1106,7 @@ for (i = 0; i < dibp->vnum; i++) {      
         (int_ack[ilvl][ibit] != dibp->ack[i])) ||
         (int_vec[ilvl][ibit] && vec &&
         (int_vec[ilvl][ibit] != vec))) {
-        printf ("Device %s interrupt slot conflict at %d\n",
-            sim_dname (dptr), idx);
-        if (sim_log) fprintf (sim_log,
-            "Device %s interrupt slot conflict at %d\n",
+        sim_printf_log ("Device %s interrupt slot conflict at %d\n",
             sim_dname (dptr), idx);
         return SCPE_STOP;
         }
@@ -1121,10 +1119,7 @@ for (i = 0; i < (int32) dibp->lnt; i = i
         (iodispR[idx] != dibp->rd)) ||
         (iodispW[idx] && dibp->wr &&
         (iodispW[idx] != dibp->wr))) {
-        printf ("Device %s address conflict at %08o\n",
-            sim_dname (dptr), dibp->ba);
-        if (sim_log) fprintf (sim_log,
-            "Device %s address conflict at %08o\n",
+        sim_printf_log ("Device %s address conflict at %08o\n",
             sim_dname (dptr), dibp->ba);
         return SCPE_STOP;
         }
diff -r 88f8539ad85b -r 12771ea2fbee VAX/vax_io.c
--- a/VAX/vax_io.c	Sun Sep 09 04:54:03 2007 +0200
+++ b/VAX/vax_io.c	Sun Sep 09 04:54:29 2007 +0200
@@ -47,6 +47,7 @@
 */
 
 #include "vax_defs.h"
+#include "sim_console.h"
 
 /* CQBIC system configuration register */
 
@@ -123,7 +124,6 @@ extern void WriteB (uint32 pa, int32 val
 extern void WriteB (uint32 pa, int32 val);
 extern void WriteW (uint32 pa, int32 val);
 extern void WriteL (uint32 pa, int32 val);
-extern FILE *sim_log;
 
 t_stat dbl_rd (int32 *data, int32 addr, int32 access);
 t_stat dbl_wr (int32 data, int32 addr, int32 access);
@@ -900,10 +900,7 @@ for (i = 0; i < dibp->lnt; i = i + 2) { 
         (iodispR[idx] != dibp->rd)) ||
         (iodispW[idx] && dibp->wr &&
         (iodispW[idx] != dibp->wr))) {
-        printf ("Device %s address conflict at %08o\n",
-            sim_dname (dptr), dibp->ba);
-        if (sim_log) fprintf (sim_log,
-            "Device %s address conflict at %08o\n",
+        sim_printf_log ("Device %s address conflict at %08o\n",
             sim_dname (dptr), dibp->ba);
         return SCPE_STOP;
         }
@@ -932,10 +929,7 @@ for (i = 0; i < dibp->vnum; i++) {      
         (int_ack[ilvl][ibit] != dibp->ack[i])) ||
         (int_vec[ilvl][ibit] && vec &&
         (int_vec[ilvl][ibit] != vec))) {
-        printf ("Device %s interrupt slot conflict at %d\n",
-            sim_dname (dptr), idx);
-        if (sim_log) fprintf (sim_log,
-        "Device %s interrupt slot conflict at %d\n",
+        sim_printf_log ("Device %s interrupt slot conflict at %d\n",
             sim_dname (dptr), idx);
         return SCPE_STOP;
         }
diff -r 88f8539ad85b -r 12771ea2fbee VAX/vax_sysdev.c
--- a/VAX/vax_sysdev.c	Sun Sep 09 04:54:03 2007 +0200
+++ b/VAX/vax_sysdev.c	Sun Sep 09 04:54:29 2007 +0200
@@ -52,6 +52,7 @@
 */
 
 #include "vax_defs.h"
+#include "sim_console.h"
 
 #define UNIT_V_NODELAY  (UNIT_V_UF + 0)                 /* ROM access equal to RAM access */
 #define UNIT_NODELAY    (1u << UNIT_V_NODELAY)
@@ -1510,7 +1511,6 @@ t_stat cpu_boot (int32 unitno, DEVICE *d
 t_stat cpu_boot (int32 unitno, DEVICE *dptr)
 {
 extern t_stat load_cmd (int32 flag, char *cptr);
-extern FILE *sim_log;
 t_stat r;
 
 PC = ROMBASE;
@@ -1519,9 +1519,7 @@ conpsl = PSL_IS | PSL_IPL1F | CON_PWRUP;
 conpsl = PSL_IS | PSL_IPL1F | CON_PWRUP;
 if (rom == NULL) return SCPE_IERR;
 if (*rom == 0) {                                        /* no boot? */
-    printf ("Loading boot code from ka655x.bin\n");
-    if (sim_log) fprintf (sim_log, 
-        "Loading boot code from ka655x.bin\n");
+    sim_printf_log ("Loading boot code from ka655x.bin\n");
     r = load_cmd (0, "-R ka655x.bin");
     if (r != SCPE_OK) return r;
     }



More information about the Simh mailing list