From d862d024ea5f6f0cc915e7347a199bfce2a5ea96 Mon Sep 17 00:00:00 2001 From: "J. David Bryan" Date: Sun, 14 Aug 2022 21:23:21 -0700 Subject: [PATCH] SCP: Fix details missed when merging update REGister macros from v3.12-2 --- HP3000/hp3000_defs.h | 22 +++++++++++----------- HP3000/hp3000_ds.c | 2 +- sim_defs.h | 20 ++++++++++---------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/HP3000/hp3000_defs.h b/HP3000/hp3000_defs.h index 00f91bb0..76cd120f 100644 --- a/HP3000/hp3000_defs.h +++ b/HP3000/hp3000_defs.h @@ -162,12 +162,12 @@ These additional register definition macros are used to define: FBDATA -- a one-bit flag in an arrayed register - SRDATA -- an array of bytes large enough to hold a structure + SVDATA -- a register only used for SAVE/RESTORE YRDATA -- a binary register The FBDATA macro defines a flag that is replicated in the same bit position in each element of an array; the array element size is assumed to be the - minimum necessary to hold the bit at the given offset. The SRDATA macro is + minimum necessary to hold the bit at the given offset. The SVDATA macro is used solely to SAVE data stored in a structure so that it may be RESTOREd later. The YRDATA macro extends the functionality of the ORDATA, DRDATA, and HRDATA macros to registers with binary (base 2) representation. @@ -199,24 +199,24 @@ #undef REGMAP #if (SIM_MAJOR >= 4) - #define REGMAP(nm,loc,rdx,wd,off,dep,fl) \ - REGDATA (nm, loc, rdx, wd, off, dep, NULL, NULL, fl, 0, 0) + #define REGMAP(nm,loc,rdx,wd,off,dep,fl,siz) \ + REGDATA (nm, loc, rdx, wd, off, dep, NULL, NULL, fl, 0, siz) #elif defined (__STDC__) || defined (_WIN32) - #define REGMAP(nm,loc,rdx,wd,off,dep,fl) \ + #define REGMAP(nm,loc,rdx,wd,off,dep,fl,siz) \ #nm, &(loc), (rdx), (wd), (off), (dep), (fl), 0 #else - #define REGMAP(nm,loc,rdx,wd,off,dep,fl) \ + #define REGMAP(nm,loc,rdx,wd,off,dep,fl,siz) \ "nm", &(loc), (rdx), (wd), (off), (dep), (fl), 0 #endif -/* Macro name loc radix width offset depth flags */ -/* ------------------------- ---- ------ ----- ----- ------ ---------- ----- */ -#define FBDATA(nm,loc,ofs,dep,fl) REGMAP (nm, (loc), 2, 1, (ofs), (dep), (fl) ) -#define SRDATA(nm,loc,fl) REGMAP (nm, (loc), 8, 8, 0, sizeof loc, (fl) ) -#define YRDATA(nm,loc,wid,fl) REGMAP (nm, (loc), 2, (wid), 0, 1, (fl) ) +/* Macro name loc radix width offset depth flags size */ +/* ------------------------- ---- ------ ----- ----- ------ ---------- ----- -------------- */ +#define FBDATA(nm,loc,ofs,dep,fl) REGMAP (nm, (loc), 2, 1, (ofs), (dep), (fl), sizeof *(loc)) +#define SVDATA(nm,loc) SAVEDATA (nm, (loc)) +#define YRDATA(nm,loc,wid,fl) BINRDATA (nm, (loc), (wid)), (fl) /* Debugging and console output. diff --git a/HP3000/hp3000_ds.c b/HP3000/hp3000_ds.c index f3497ecb..052d0aa8 100644 --- a/HP3000/hp3000_ds.c +++ b/HP3000/hp3000_ds.c @@ -441,7 +441,7 @@ static REG ds_reg [] = { { ORDATA (STATUS, status_word, 16), REG_FIT | PV_RZRO }, { DRDATA (RETRY, retry_counter, 4), REG_FIT | PV_LEFT }, - { SRDATA (DIAG, overrides, REG_HRO) }, + { SVDATA (DIAG, overrides) }, DIB_REGS (ds_dib), diff --git a/sim_defs.h b/sim_defs.h index 86d0f117..eb5968d1 100644 --- a/sim_defs.h +++ b/sim_defs.h @@ -1067,26 +1067,26 @@ struct MEMFILE { _RegCheck(#nm,&(loc),rdx,wd,pos,1,desc,flds,0,0,sizeof((loc)),GRDATADF) /* Arrayed register whose data is kept in a standard C array Register */ #define BRDATA(nm,aloc,rdx,wd,dep) \ - _RegCheck(#nm,aloc,rdx,wd,0,dep,NULL,NULL,0,0,sizeof(*(aloc)),BRDATA) + _RegCheck(#nm,aloc,rdx,wd,0,dep,NULL,NULL,0,sizeof(*(aloc)),sizeof(*(aloc)),BRDATA) #define BRDATAD(nm,aloc,rdx,wd,dep,desc) \ - _RegCheck(#nm,aloc,rdx,wd,0,dep,desc,NULL,0,0,sizeof(*(aloc)),BRDATAD) + _RegCheck(#nm,aloc,rdx,wd,0,dep,desc,NULL,0,sizeof(*(aloc)),sizeof(*(aloc)),BRDATAD) #define BRDATADF(nm,aloc,rdx,wd,dep,desc,flds) \ - _RegCheck(#nm,aloc,rdx,wd,0,dep,desc,flds,0,0,sizeof(*(aloc)),BRDATADF) -/* Arrayed register whose data is kept in a standard C array Register */ + _RegCheck(#nm,aloc,rdx,wd,0,dep,desc,flds,0,sizeof(*(aloc)),sizeof(*(aloc)),BRDATADF) +/* Arrayed register whose data is kept in a standard C two dimensional array Register */ #define CRDATA(nm,aloc,rdx,wd,dep) \ - _RegCheck(#nm,aloc,rdx,wd,0,dep,NULL,NULL,0,0,sizeof(**(aloc)),CRDATA) + _RegCheck(#nm,&(aloc),rdx,wd,0,dep,NULL,NULL,0,sizeof(**(aloc)),sizeof(**(aloc)),CRDATA) #define CRDATAD(nm,aloc,rdx,wd,dep,desc) \ - _RegCheck(#nm,aloc,rdx,wd,0,dep,desc,NULL,0,0,sizeof(**(aloc)),CRDATAD) + _RegCheck(#nm,&(aloc),rdx,wd,0,dep,desc,NULL,0,sizeof(**(aloc)),sizeof(**(aloc)),CRDATAD) #define CRDATADF(nm,aloc,rdx,wd,dep,desc,flds) \ - _RegCheck(#nm,aloc,rdx,wd,0,dep,desc,flds,0,0,sizeof(**(aloc)),CRDATADF) + _RegCheck(#nm,&(aloc),rdx,wd,0,dep,desc,flds,0,sizeof(**(aloc)),sizeof(**(aloc)),CRDATADF) /* Range of memory whose data is successive scalar values accessed like an array Register */ #define VBRDATA(nm,loc,rdx,wd,dep) \ - _RegCheck(#nm,&(loc),rdx,wd,0,dep,NULL,NULL,0,0,sizeof(loc),VBRDATA) + _RegCheck(#nm,&(loc),rdx,wd,0,dep,NULL,NULL,0,wd/8,sizeof(loc),VBRDATA) #define VBRDATAD(nm,loc,rdx,wd,dep,desc) \ - _RegCheck(#nm,&(loc),rdx,wd,0,dep,desc,NULL,0,0,sizeof(loc),VBRDATAD) + _RegCheck(#nm,&(loc),rdx,wd,0,dep,desc,NULL,0,wd/8,sizeof(loc),VBRDATAD) #define VBRDATADF(nm,loc,rdx,wd,dep,desc,flds) \ - _RegCheck(#nm,&(loc),rdx,wd,0,dep,desc,flds,0,0,sizeof(loc),VBRDATADF) + _RegCheck(#nm,&(loc),rdx,wd,0,dep,desc,flds,0,wd/8,sizeof(loc),VBRDATADF) /* Arrayed register whose data is part of the UNIT structure */ #define URDATA(nm,loc,rdx,wd,off,dep,fl) \ _RegCheck(#nm,&(loc),rdx,wd,off,dep,NULL,NULL,0,sizeof(UNIT),sizeof((loc)),URDATA),(fl)