mirror of
https://github.com/simh/simh.git
synced 2026-04-04 21:07:39 +00:00
ALL: Massive 'const' cleanup
These changes facilitate more robust parameter type checking and helps to identify unexpected coding errors. Most simulators can now also be compiled with a C++ compiler without warnings. Additionally, these changes have also been configured to facilitate easier backporting of simulator and device simulation modules to run under the simh v3.9+ SCP framework.
This commit is contained in:
@@ -210,10 +210,10 @@ t_stat cpu_ex (t_value *vptr, t_addr addr, UNIT *uptr, int32 sw);
|
||||
t_stat cpu_dep (t_value val, t_addr addr, UNIT *uptr, int32 sw);
|
||||
t_stat cpu_reset (DEVICE *dptr);
|
||||
t_bool cpu_is_pc_a_subroutine_call (t_addr **ret_addrs);
|
||||
t_stat cpu_set_hist (UNIT *uptr, int32 val, char *cptr, void *desc);
|
||||
t_stat cpu_show_hist (FILE *st, UNIT *uptr, int32 val, void *desc);
|
||||
t_stat cpu_set_serial (UNIT *uptr, int32 val, char *cptr, void *desc);
|
||||
t_stat cpu_show_serial (FILE *st, UNIT *uptr, int32 val, void *desc);
|
||||
t_stat cpu_set_hist (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
|
||||
t_stat cpu_show_hist (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
|
||||
t_stat cpu_set_serial (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
|
||||
t_stat cpu_show_serial (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
|
||||
|
||||
d10 adjsp (d10 val, a10 ea);
|
||||
void ibp (a10 ea, int32 pflgs);
|
||||
@@ -253,7 +253,7 @@ int32 test_int (void);
|
||||
void set_ac_display (d10 *acbase);
|
||||
|
||||
extern t_stat build_dib_tab (void);
|
||||
extern t_stat show_iospace (FILE *st, UNIT *uptr, int32 val, void *desc);
|
||||
extern t_stat show_iospace (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
|
||||
extern d10 Read (a10 ea, int32 prv); /* read, read check */
|
||||
extern d10 ReadM (a10 ea, int32 prv); /* read, write check */
|
||||
extern d10 ReadE (a10 ea); /* read, exec */
|
||||
@@ -328,7 +328,7 @@ extern t_bool wrpcst (a10 ea, int32 prv);
|
||||
extern t_bool spm (a10 ea, int32 prv);
|
||||
extern t_bool lpmr (a10 ea, int32 prv);
|
||||
extern int32 pi_ub_vec (int32 lvl, int32 *uba);
|
||||
extern t_stat tim_set_mod (UNIT *uptr, int32 val, char *cptr, void *desc);
|
||||
extern t_stat tim_set_mod (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
|
||||
|
||||
/* CPU data structures
|
||||
|
||||
@@ -2505,7 +2505,7 @@ return;
|
||||
|
||||
/* Set history */
|
||||
|
||||
t_stat cpu_set_hist (UNIT *uptr, int32 val, char *cptr, void *desc)
|
||||
t_stat cpu_set_hist (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
|
||||
{
|
||||
int32 i, lnt;
|
||||
t_stat r;
|
||||
@@ -2536,10 +2536,10 @@ return SCPE_OK;
|
||||
|
||||
/* Show history */
|
||||
|
||||
t_stat cpu_show_hist (FILE *st, UNIT *uptr, int32 val, void *desc)
|
||||
t_stat cpu_show_hist (FILE *st, UNIT *uptr, int32 val, CONST void *desc)
|
||||
{
|
||||
int32 k, di, lnt;
|
||||
char *cptr = (char *) desc;
|
||||
const char *cptr = (const char *) desc;
|
||||
t_stat r;
|
||||
t_value sim_eval;
|
||||
InstHistory *h;
|
||||
@@ -2576,7 +2576,7 @@ return SCPE_OK;
|
||||
|
||||
/* Set serial */
|
||||
|
||||
t_stat cpu_set_serial (UNIT *uptr, int32 val, char *cptr, void *desc)
|
||||
t_stat cpu_set_serial (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
|
||||
{
|
||||
int32 lnt;
|
||||
t_stat r;
|
||||
@@ -2594,7 +2594,7 @@ return SCPE_OK;
|
||||
|
||||
/* Show serial */
|
||||
|
||||
t_stat cpu_show_serial (FILE *st, UNIT *uptr, int32 val, void *desc)
|
||||
t_stat cpu_show_serial (FILE *st, UNIT *uptr, int32 val, CONST void *desc)
|
||||
{
|
||||
fprintf (st, "Serial: " );
|
||||
if( (apr_serial == -1) || (!Q_ITS && apr_serial < 4096) ) {
|
||||
|
||||
@@ -766,20 +766,24 @@ typedef struct pdp_dib DIB;
|
||||
int32 Map_ReadB (uint32 ba, int32 bc, uint8 *buf);
|
||||
int32 Map_ReadW (uint32 ba, int32 bc, uint16 *buf);
|
||||
int32 Map_ReadW18 (uint32 ba, int32 bc, uint32 *buf);
|
||||
int32 Map_WriteB (uint32 ba, int32 bc, uint8 *buf);
|
||||
int32 Map_WriteW (uint32 ba, int32 bc, uint16 *buf);
|
||||
int32 Map_WriteW18 (uint32 ba, int32 bc, uint32 *buf);
|
||||
int32 Map_WriteB (uint32 ba, int32 bc, const uint8 *buf);
|
||||
int32 Map_WriteW (uint32 ba, int32 bc, const uint16 *buf);
|
||||
int32 Map_WriteW18 (uint32 ba, int32 bc, const uint32 *buf);
|
||||
void uba_debug_dma_in (uint32 ba, a10 pa_start, a10 pa_end);
|
||||
void uba_debug_dma_out (uint32 ba, a10 pa_start, a10 pa_end);
|
||||
void uba_debug_dma_nxm (const char *msg, a10 pa10, uint32 ba, int32 bc);
|
||||
|
||||
t_stat set_addr (UNIT *uptr, int32 val, char *cptr, void *desc);
|
||||
t_stat set_addr_flt (UNIT *uptr, int32 val, char *cptr, void *desc);
|
||||
t_stat show_addr (FILE *st, UNIT *uptr, int32 val, void *desc);
|
||||
t_stat set_vec (UNIT *uptr, int32 val, char *cptr, void *desc);
|
||||
t_stat show_vec (FILE *st, UNIT *uptr, int32 val, void *desc);
|
||||
t_stat show_vec_mux (FILE *st, UNIT *uptr, int32 val, void *desc);
|
||||
t_stat set_addr (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
|
||||
t_stat set_addr_flt (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
|
||||
t_stat show_addr (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
|
||||
t_stat set_vec (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
|
||||
t_stat show_vec (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
|
||||
t_stat show_vec_mux (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
|
||||
t_stat auto_config (const char *name, int32 num);
|
||||
|
||||
extern d10 *ac_cur; /* current AC block */
|
||||
extern int32 flags; /* flags */
|
||||
extern const int32 pi_l2bit[8];
|
||||
extern const d10 bytemask[64];
|
||||
|
||||
#endif
|
||||
|
||||
@@ -49,7 +49,7 @@ t_stat fei_svc (UNIT *uptr);
|
||||
t_stat feo_svc (UNIT *uptr);
|
||||
static t_stat kaf_svc (UNIT *uptr);
|
||||
t_stat fe_reset (DEVICE *dptr);
|
||||
t_stat fe_stop_os (UNIT *uptr, int32 val, char *cptr, void *desc);
|
||||
t_stat fe_stop_os (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
|
||||
a10 fe_xct = 0;
|
||||
uint32 fe_bootrh = 0;
|
||||
int32 fe_bootunit = -1;
|
||||
@@ -307,7 +307,7 @@ return SCPE_OK;
|
||||
|
||||
/* Stop operating system */
|
||||
|
||||
t_stat fe_stop_os (UNIT *uptr, int32 val, char *cptr, void *desc)
|
||||
t_stat fe_stop_os (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
|
||||
{
|
||||
M[FE_SWITCH] = IOBA_RP; /* tell OS to stop */
|
||||
return SCPE_OK;
|
||||
|
||||
@@ -150,10 +150,7 @@ static const int32 ubabr54[UBANUM] = {
|
||||
#define M_WORD1 (~INT64_C (0000000777777)) /* Clear word 1 + XX */
|
||||
|
||||
extern d10 *M; /* main memory */
|
||||
extern d10 *ac_cur;
|
||||
extern d10 pager_word;
|
||||
extern int32 flags;
|
||||
extern const int32 pi_l2bit[8];
|
||||
extern UNIT cpu_unit;
|
||||
extern jmp_buf save_env;
|
||||
|
||||
@@ -1036,7 +1033,7 @@ return 0;
|
||||
|
||||
/* Byte-mode writes */
|
||||
|
||||
int32 Map_WriteB (uint32 ba, int32 bc, uint8 *buf)
|
||||
int32 Map_WriteB (uint32 ba, int32 bc, const uint8 *buf)
|
||||
{
|
||||
uint32 ea, ofs, cp, np;
|
||||
int32 seg, ubm = 0;
|
||||
@@ -1183,7 +1180,7 @@ return 0;
|
||||
|
||||
/* Word mode writes; 16-bit data */
|
||||
|
||||
int32 Map_WriteW (uint32 ba, int32 bc, uint16 *buf)
|
||||
int32 Map_WriteW (uint32 ba, int32 bc, const uint16 *buf)
|
||||
{
|
||||
uint32 ea, cp, np;
|
||||
int32 seg, ubm = 0;
|
||||
@@ -1295,7 +1292,7 @@ return 0;
|
||||
|
||||
/* Word mode writes; 18-bit data */
|
||||
|
||||
int32 Map_WriteW18 (uint32 ba, int32 bc, uint32 *buf)
|
||||
int32 Map_WriteW18 (uint32 ba, int32 bc, const uint32 *buf)
|
||||
{
|
||||
uint32 ea, cp, np;
|
||||
int32 seg, ubm = 0;
|
||||
@@ -1404,7 +1401,7 @@ return 0;
|
||||
|
||||
/* Word mode writes; 36-bit data */
|
||||
|
||||
int32 Map_WriteW36 (uint32 ba, int32 bc, a10 *buf)
|
||||
int32 Map_WriteW36 (uint32 ba, int32 bc, const a10 *buf)
|
||||
{
|
||||
uint32 ea, cp, np;
|
||||
int32 seg, ubm = 0;
|
||||
@@ -1699,7 +1696,7 @@ return SCPE_OK;
|
||||
|
||||
/* Change device address */
|
||||
|
||||
t_stat set_addr (UNIT *uptr, int32 val, char *cptr, void *desc)
|
||||
t_stat set_addr (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
|
||||
{
|
||||
DEVICE *dptr;
|
||||
DIB *dibp;
|
||||
@@ -1730,7 +1727,7 @@ return SCPE_OK;
|
||||
|
||||
/* Show device address */
|
||||
|
||||
t_stat show_addr (FILE *st, UNIT *uptr, int32 val, void *desc)
|
||||
t_stat show_addr (FILE *st, UNIT *uptr, int32 val, CONST void *desc)
|
||||
{
|
||||
DEVICE *dptr;
|
||||
DIB *dibp;
|
||||
@@ -1756,7 +1753,7 @@ return SCPE_OK;
|
||||
|
||||
/* Change device vector */
|
||||
|
||||
t_stat set_vec (UNIT *uptr, int32 arg, char *cptr, void *desc)
|
||||
t_stat set_vec (UNIT *uptr, int32 arg, CONST char *cptr, void *desc)
|
||||
{
|
||||
DEVICE *dptr;
|
||||
DIB *dibp;
|
||||
@@ -1785,7 +1782,7 @@ return SCPE_OK;
|
||||
|
||||
/* Show device vector */
|
||||
|
||||
t_stat show_vec (FILE *st, UNIT *uptr, int32 arg, void *desc)
|
||||
t_stat show_vec (FILE *st, UNIT *uptr, int32 arg, CONST void *desc)
|
||||
{
|
||||
DEVICE *dptr;
|
||||
DIB *dibp;
|
||||
@@ -1817,9 +1814,9 @@ return SCPE_OK;
|
||||
|
||||
/* Show vector for terminal multiplexor */
|
||||
|
||||
t_stat show_vec_mux (FILE *st, UNIT *uptr, int32 arg, void *desc)
|
||||
t_stat show_vec_mux (FILE *st, UNIT *uptr, int32 arg, CONST void *desc)
|
||||
{
|
||||
TMXR *mp = (TMXR *) desc;
|
||||
const TMXR *mp = (const TMXR *) desc;
|
||||
|
||||
if ((mp == NULL) || (arg == 0))
|
||||
return SCPE_IERR;
|
||||
@@ -1904,7 +1901,7 @@ return SCPE_OK;
|
||||
|
||||
/* Show dib_tab */
|
||||
|
||||
t_stat show_iospace (FILE *st, UNIT *uptr, int32 val, void *desc)
|
||||
t_stat show_iospace (FILE *st, UNIT *uptr, int32 val, CONST void *desc)
|
||||
{
|
||||
int32 i, j, done = 0;
|
||||
DEVICE *dptr;
|
||||
@@ -1976,7 +1973,7 @@ return SCPE_OK;
|
||||
|
||||
|
||||
typedef struct {
|
||||
char *dnam[AUTO_MAXC];
|
||||
const char *dnam[AUTO_MAXC];
|
||||
int32 numc;
|
||||
int32 numv;
|
||||
uint32 amod;
|
||||
@@ -2281,7 +2278,7 @@ return SCPE_OK;
|
||||
|
||||
/* Set address floating */
|
||||
|
||||
t_stat set_addr_flt (UNIT *uptr, int32 val, char *cptr, void *desc)
|
||||
t_stat set_addr_flt (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
|
||||
{
|
||||
DEVICE *dptr;
|
||||
|
||||
|
||||
@@ -193,7 +193,6 @@ static int32 lpi = DEFAULT_LPI; /* Printer's LPI. */
|
||||
static int16 txram[TX_SIZE] = { 0 }; /* translation RAM */
|
||||
static int16 davfu[DV_SIZE] = { 0 }; /* DAVFU */
|
||||
|
||||
DEVICE lp20_dev;
|
||||
static t_stat lp20_rd (int32 *data, int32 pa, int32 access);
|
||||
static t_stat lp20_wr (int32 data, int32 pa, int32 access);
|
||||
static int32 lp20_inta (void);
|
||||
@@ -202,15 +201,15 @@ static t_stat idle_svc (UNIT *uptr);
|
||||
static void set_flush_timer (UNIT *uptr);
|
||||
static t_stat lp20_reset (DEVICE *dptr);
|
||||
static t_stat lp20_init (DEVICE *dptr);
|
||||
static t_stat lp20_attach (UNIT *uptr, char *ptr);
|
||||
static t_stat lp20_attach (UNIT *uptr, CONST char *ptr);
|
||||
static t_stat lp20_detach (UNIT *uptr);
|
||||
static t_stat lp20_set_lpi (UNIT *uptr, int32 val, char *cptr, void *desc);
|
||||
static t_stat lp20_show_lpi (FILE *st, UNIT *up, int32 v, void *dp);
|
||||
static t_stat lp20_set_vfu_type (UNIT *uptr, int32 val, char *cptr, void *desc);
|
||||
static t_stat lp20_show_vfu_type (FILE *st, UNIT *up, int32 v, void *dp);
|
||||
static t_stat lp20_show_vfu (FILE *st, UNIT *up, int32 v, void *dp);
|
||||
static t_stat lp20_set_tof (UNIT *uptr, int32 val, char *cptr, void *desc);
|
||||
static t_stat lp20_clear_vfu (UNIT *uptr, int32 val, char *cptr, void *desc);
|
||||
static t_stat lp20_set_lpi (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
|
||||
static t_stat lp20_show_lpi (FILE *st, UNIT *up, int32 v, CONST void *dp);
|
||||
static t_stat lp20_set_vfu_type (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
|
||||
static t_stat lp20_show_vfu_type (FILE *st, UNIT *up, int32 v, CONST void *dp);
|
||||
static t_stat lp20_show_vfu (FILE *st, UNIT *up, int32 v, CONST void *dp);
|
||||
static t_stat lp20_set_tof (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
|
||||
static t_stat lp20_clear_vfu (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
|
||||
static t_bool lp20_print (int32 c);
|
||||
static t_bool lp20_adv (int32 c, t_bool advdvu);
|
||||
static t_bool lp20_davfu (int32 c);
|
||||
@@ -341,14 +340,9 @@ static DIB lp20_dib = {
|
||||
* product'. It's not implemented in this emulation.
|
||||
*/
|
||||
|
||||
static UNIT lp20_idle;
|
||||
static UNIT lp20_unit = {
|
||||
UDATA (&lp20_svc, UNIT_SEQ+UNIT_ATTABLE+UNIT_TEXT, 0), SERIAL_OUT_WAIT,
|
||||
0, 0, 0, 0, &lp20_idle,
|
||||
};
|
||||
static UNIT lp20_idle = {
|
||||
UDATA (&idle_svc, UNIT_DIS, 0), 1000000, LP20_IDLE_TIME,
|
||||
0, 0, 0, &lp20_unit,
|
||||
static UNIT lp20_unit[] = {
|
||||
{UDATA (&lp20_svc, UNIT_SEQ+UNIT_ATTABLE+UNIT_TEXT, 0), SERIAL_OUT_WAIT},
|
||||
{UDATA (&idle_svc, UNIT_DIS, 0), 1000000, LP20_IDLE_TIME}
|
||||
};
|
||||
|
||||
static REG lp20_reg[] = {
|
||||
@@ -371,8 +365,8 @@ static REG lp20_reg[] = {
|
||||
{ FLDATAD (ERR, lpcsa, CSR_V_ERR, "error flag") },
|
||||
{ FLDATAD (DONE, lpcsa, CSR_V_DONE, "done flag") },
|
||||
{ FLDATAD (IE, lpcsa, CSR_V_IE, "interrupt enable flag") },
|
||||
{ DRDATAD (POS, lp20_unit.pos, T_ADDR_W, "position in output file"), PV_LEFT },
|
||||
{ DRDATAD (TIME, lp20_unit.wait, 24, "response time"), PV_LEFT },
|
||||
{ DRDATAD (POS, lp20_unit[0].pos, T_ADDR_W, "position in output file"), PV_LEFT },
|
||||
{ DRDATAD (TIME, lp20_unit[0].wait, 24, "response time"), PV_LEFT },
|
||||
{ FLDATAD (STOP_IOE, lp20_stopioe, 0, "stop on I/O error") },
|
||||
{ BRDATAD (TXRAM, txram, 8, 13, TX_SIZE, "translation RAM") },
|
||||
{ BRDATAD (DAVFU, davfu, 8, 12, DV_SIZE, "vertical forms unit array") },
|
||||
@@ -401,8 +395,8 @@ static MTAB lp20_mod[] = {
|
||||
};
|
||||
|
||||
DEVICE lp20_dev = {
|
||||
"LP20", &lp20_unit, lp20_reg, lp20_mod,
|
||||
1, 10, 31, 1, 8, 8,
|
||||
"LP20", lp20_unit, lp20_reg, lp20_mod,
|
||||
2, 10, 31, 1, 8, 8,
|
||||
NULL, NULL, &lp20_reset,
|
||||
NULL, &lp20_attach, &lp20_detach,
|
||||
&lp20_dib, DEV_DISABLE | DEV_UBUS, 0,
|
||||
@@ -484,7 +478,7 @@ switch ((pa >> 1) & 07) { /* case on PA<3:1> */
|
||||
if (data & CSA_ECLR) { /* error clear? */
|
||||
lpcsa = (lpcsa | CSA_DONE) & ~CSA_GO; /* set done, clr go */
|
||||
lpcsb = lpcsb & ~CSB_ECLR; /* clear err */
|
||||
sim_cancel (&lp20_unit); /* cancel I/O */
|
||||
sim_cancel (lp20_unit); /* cancel I/O */
|
||||
}
|
||||
if (data & CSA_INIT) /* init? */
|
||||
lp20_init (&lp20_dev);
|
||||
@@ -493,10 +487,10 @@ switch ((pa >> 1) & 07) { /* case on PA<3:1> */
|
||||
if (lpcsb & CSB_ERR)
|
||||
lpcsb = lpcsb | CSB_GOE;
|
||||
lpcsum = 0; /* clear checksum */
|
||||
sim_activate (&lp20_unit, lp20_unit.wait);
|
||||
sim_activate (lp20_unit, lp20_unit->wait);
|
||||
}
|
||||
}
|
||||
else sim_cancel (&lp20_unit); /* go clr, stop DMA */
|
||||
else sim_cancel (lp20_unit); /* go clr, stop DMA */
|
||||
lpcsa = (lpcsa & ~CSA_RW) | (data & CSA_RW);
|
||||
if (dvld && (CSA_GETFNC (lpcsa) != FNC_DVU)) { /* DVU load aborted */
|
||||
change_rdy (0, CSA_DVON); /* Mark DVU off-line and empty */
|
||||
@@ -598,7 +592,7 @@ lpcsa = lpcsa & ~CSA_GO;
|
||||
ba = CSA_GETUAE (lpcsa) | lpba;
|
||||
fnc = CSA_GETFNC (lpcsa);
|
||||
tbc = 010000 - lpbc;
|
||||
if (((fnc & FNC_INTERNAL) == 0) && ((lp20_unit.flags & UNIT_ATT) == 0)) {
|
||||
if (((fnc & FNC_INTERNAL) == 0) && ((uptr->flags & UNIT_ATT) == 0)) {
|
||||
update_lpcs (CSA_ERR);
|
||||
return IORETURN (lp20_stopioe, SCPE_UNATT);
|
||||
}
|
||||
@@ -724,16 +718,16 @@ for (i = 0, cont = TRUE; (i < tbc) && cont; ba++, i++) {
|
||||
} /* end case function */
|
||||
} /* end for */
|
||||
if (lpcolc == 0)
|
||||
set_flush_timer (&lp20_unit);
|
||||
set_flush_timer (uptr);
|
||||
else
|
||||
sim_cancel ((UNIT *)lp20_unit.up7);
|
||||
sim_cancel (uptr+1);
|
||||
lpba = ba & 0177777;
|
||||
lpcsa = (lpcsa & ~CSA_UAE) | ((ba >> (16 - CSA_V_UAE)) & CSA_UAE);
|
||||
lpbc = (lpbc + i) & BC_MASK;
|
||||
if (lpbc) /* intr, but not done */
|
||||
update_lpcs (CSA_MBZ);
|
||||
else update_lpcs (CSA_DONE); /* intr and done */
|
||||
if ((fnc == FNC_PR) && ferror (lp20_unit.fileref)) {
|
||||
if ((fnc == FNC_PR) && ferror (uptr->fileref)) {
|
||||
sim_perror ("LP I/O error");
|
||||
clearerr (uptr->fileref);
|
||||
return SCPE_IOERR;
|
||||
@@ -779,8 +773,8 @@ else {
|
||||
r = lp20_adv (1, TRUE); /* adv carriage */
|
||||
}
|
||||
for (i = 0; i < rpt; i++)
|
||||
fputc (lppdat, lp20_unit.fileref);
|
||||
lp20_unit.pos = (t_addr)sim_ftell (lp20_unit.fileref);
|
||||
fputc (lppdat, lp20_unit->fileref);
|
||||
lp20_unit->pos = (t_addr)sim_ftell (lp20_unit->fileref);
|
||||
lpcolc = lpcolc + rpt;
|
||||
return r;
|
||||
}
|
||||
@@ -804,7 +798,7 @@ if (lpcsb & CSB_DVOF)
|
||||
|
||||
lpcolc = 0; /* reset col cntr */
|
||||
for (i = 0; i < cnt; i++) { /* print 'n' newlines; each can complete a page */
|
||||
fputc ('\n', lp20_unit.fileref);
|
||||
fputc ('\n', lp20_unit->fileref);
|
||||
if (dvuadv) { /* update DAVFU ptr */
|
||||
dvptr = (dvptr + cnt) % dvlnt;
|
||||
if (davfu[dvptr] & (1 << DV_TOF)) { /* at top of form? */
|
||||
@@ -816,7 +810,7 @@ for (i = 0; i < cnt; i++) { /* print 'n' newlines; e
|
||||
} /* At TOF */
|
||||
} /* update pointer */
|
||||
}
|
||||
lp20_unit.pos = (t_addr)sim_ftell (lp20_unit.fileref);
|
||||
lp20_unit->pos = (t_addr)sim_ftell (lp20_unit->fileref);
|
||||
if (stoppc) /* Crossed one or more TOFs? */
|
||||
return FALSE;
|
||||
|
||||
@@ -840,8 +834,8 @@ for (i = 0; i < dvlnt; i++) { /* search DAVFU */
|
||||
return lp20_adv (i + 1, FALSE);
|
||||
if (lpcolc) /* TOF, need newline? */
|
||||
lp20_adv (1, FALSE);
|
||||
fputc ('\f', lp20_unit.fileref); /* print form feed */
|
||||
lp20_unit.pos = (t_addr)sim_ftell (lp20_unit.fileref);
|
||||
fputc ('\f', lp20_unit->fileref); /* print form feed */
|
||||
lp20_unit->pos = (t_addr)sim_ftell (lp20_unit->fileref);
|
||||
lppagc = (lppagc - 1) & PAGC_MASK; /* decr page cntr */
|
||||
if (lppagc != 0)
|
||||
return TRUE;
|
||||
@@ -863,7 +857,7 @@ if (flg) /* set int req */
|
||||
lp20_irq = 1;
|
||||
lpcsa = (lpcsa | flg) & ~(CSA_MBZ | CSA_ERR | CSA_ONL);
|
||||
lpcsb = (lpcsb | CSB_OFFL) & ~CSB_MBZ;
|
||||
if (lp20_unit.flags & UNIT_ATT) {
|
||||
if (lp20_unit->flags & UNIT_ATT) {
|
||||
lpcsa = lpcsa | CSA_ONL;
|
||||
lpcsb = lpcsb & ~CSB_OFFL;
|
||||
}
|
||||
@@ -884,7 +878,7 @@ static void change_rdy (int32 setrdy, int32 clrrdy)
|
||||
{
|
||||
int32 newcsa = (lpcsa | setrdy) & ~clrrdy;
|
||||
|
||||
if ((newcsa ^ lpcsa) & (CSA_ONL | CSA_DVON) && !sim_is_active (&lp20_unit)) {
|
||||
if ((newcsa ^ lpcsa) & (CSA_ONL | CSA_DVON) && !sim_is_active (lp20_unit)) {
|
||||
lp20_irq |= 1;
|
||||
if (newcsa & CSA_IE)
|
||||
SET_INT(LP20);
|
||||
@@ -945,16 +939,16 @@ lpcsb = lpcsb & (CSB_OVFU | CSB_DVOF);
|
||||
lpba = lpbc = lppagc = lpcolc = 0; /* clear registers */
|
||||
lprdat = lppdat = lpcbuf = lpcsum = 0;
|
||||
lp20_irq = 0; /* clear int req */
|
||||
sim_cancel (&lp20_unit); /* deactivate unit */
|
||||
if (sim_is_active ((UNIT *)lp20_unit.up7)) {
|
||||
fflush (lp20_unit.fileref);
|
||||
sim_cancel ((UNIT *)lp20_unit.up7);
|
||||
sim_cancel (lp20_unit); /* deactivate unit */
|
||||
if (sim_is_active (lp20_unit+1)) {
|
||||
fflush (lp20_unit->fileref);
|
||||
sim_cancel (lp20_unit+1);
|
||||
}
|
||||
update_lpcs (0); /* update status */
|
||||
return SCPE_OK;
|
||||
}
|
||||
|
||||
static t_stat lp20_attach (UNIT *uptr, char *cptr)
|
||||
static t_stat lp20_attach (UNIT *uptr, CONST char *cptr)
|
||||
{
|
||||
t_stat reason;
|
||||
|
||||
@@ -975,7 +969,7 @@ if (lpcsa & CSA_DVON) {
|
||||
}
|
||||
if (lpcsa & CSA_ONL) /* just file chg? */
|
||||
return reason;
|
||||
if (sim_is_active (&lp20_unit)) /* busy? no int */
|
||||
if (sim_is_active (lp20_unit)) /* busy? no int */
|
||||
update_lpcs (0);
|
||||
else update_lpcs (CSA_MBZ); /* interrupt */
|
||||
return reason;
|
||||
@@ -987,12 +981,12 @@ t_stat reason;
|
||||
|
||||
if (!(uptr->flags & UNIT_ATT)) /* attached? */
|
||||
return SCPE_OK;
|
||||
if (sim_is_active ((UNIT *)lp20_unit.up7)) {
|
||||
fflush (lp20_unit.fileref);
|
||||
sim_cancel ((UNIT *)lp20_unit.up7);
|
||||
if (sim_is_active (lp20_unit+1)) {
|
||||
fflush (lp20_unit->fileref);
|
||||
sim_cancel (lp20_unit+1);
|
||||
}
|
||||
reason = detach_unit (uptr);
|
||||
sim_cancel (&lp20_unit);
|
||||
sim_cancel (lp20_unit);
|
||||
lpcsa = lpcsa & ~CSA_GO;
|
||||
update_lpcs (CSA_MBZ);
|
||||
return reason;
|
||||
@@ -1022,15 +1016,20 @@ fflush (uptr->fileref);
|
||||
return SCPE_OK;
|
||||
}
|
||||
|
||||
static t_stat lp20_set_vfu_type (UNIT *uptr, int32 val, char *cptr, void *desc)
|
||||
static t_stat lp20_set_vfu_type (UNIT *uptr, int32 val, CONST char *gptr, void *desc)
|
||||
{
|
||||
char gbuf[CBUFSIZE], *cptr;
|
||||
char *fname, *cp;
|
||||
FILE *vfile;
|
||||
int sum = 0;
|
||||
|
||||
if (!cptr || !*cptr)
|
||||
if (!gptr || !*gptr)
|
||||
return SCPE_ARG;
|
||||
|
||||
gbuf[sizeof(gbuf)-1] = '\0';
|
||||
strncpy (gbuf, gptr, sizeof(gbuf)-1);
|
||||
cptr = gbuf;
|
||||
|
||||
fname = strchr (cptr, '=');
|
||||
if (fname)
|
||||
*fname++ = '\0';
|
||||
@@ -1148,7 +1147,7 @@ fclose(vfile);
|
||||
return SCPE_FMT;
|
||||
}
|
||||
|
||||
static t_stat lp20_show_vfu_type (FILE *st, UNIT *up, int32 v, void *dp)
|
||||
static t_stat lp20_show_vfu_type (FILE *st, UNIT *up, int32 v, CONST void *dp)
|
||||
{
|
||||
if (lpcsb & CSB_OVFU)
|
||||
fprintf (st, "optical VFU");
|
||||
@@ -1163,7 +1162,7 @@ else
|
||||
return SCPE_OK;
|
||||
}
|
||||
|
||||
static t_stat lp20_set_lpi (UNIT *uptr, int32 val, char *cptr, void *desc)
|
||||
static t_stat lp20_set_lpi (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
|
||||
{
|
||||
int32 newlpi;
|
||||
|
||||
@@ -1186,14 +1185,14 @@ lpi = newlpi;
|
||||
return SCPE_OK;
|
||||
}
|
||||
|
||||
static t_stat lp20_show_lpi (FILE *st, UNIT *up, int32 v, void *dp)
|
||||
static t_stat lp20_show_lpi (FILE *st, UNIT *up, int32 v, CONST void *dp)
|
||||
{
|
||||
fprintf (st, "%u LPI", lpi);
|
||||
|
||||
return SCPE_OK;
|
||||
}
|
||||
|
||||
static t_stat lp20_show_vfu (FILE *st, UNIT *up, int32 v, void *dp)
|
||||
static t_stat lp20_show_vfu (FILE *st, UNIT *up, int32 v, CONST void *dp)
|
||||
{
|
||||
int l, c, sum;
|
||||
|
||||
@@ -1231,7 +1230,7 @@ if (!(sum & (1 << DV_BOF))) {
|
||||
|
||||
return SCPE_OK;
|
||||
}
|
||||
static t_stat lp20_set_tof (UNIT *uptr, int32 val, char *cptr, void *desc)
|
||||
static t_stat lp20_set_tof (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
|
||||
{
|
||||
int32 s_lpcsa = lpcsa;
|
||||
int32 s_lppagc = lppagc;
|
||||
@@ -1262,7 +1261,7 @@ while (value) {
|
||||
return even;
|
||||
}
|
||||
|
||||
static t_stat lp20_clear_vfu (UNIT *uptr, int32 val, char *cptr, void *desc)
|
||||
static t_stat lp20_clear_vfu (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
@@ -154,8 +154,6 @@ typedef struct { /* unpacked fp number */
|
||||
#define UNEG(x) ((~x) + 1)
|
||||
#define DUNEG(x) x.flo = UNEG (x.flo); x.fhi = ~x.fhi + (x.flo == 0)
|
||||
|
||||
extern d10 *ac_cur; /* current AC block */
|
||||
extern int32 flags; /* flags */
|
||||
void mul (d10 a, d10 b, d10 *rs);
|
||||
void funpack (d10 h, d10 l, UFP *r, t_bool sgn);
|
||||
void fnorm (UFP *r, t_int64 rnd);
|
||||
|
||||
@@ -97,9 +97,8 @@
|
||||
|
||||
extern d10 *M;
|
||||
extern d10 acs[AC_NBLK * AC_NUM];
|
||||
extern d10 *ac_cur, *ac_prv, *last_pa;
|
||||
extern d10 *ac_prv, *last_pa;
|
||||
extern a10 epta, upta;
|
||||
extern int32 flags;
|
||||
extern d10 pager_word;
|
||||
extern int32 apr_flg;
|
||||
extern d10 ebr, ubr, hsb;
|
||||
|
||||
@@ -370,12 +370,12 @@ int32 rp_inta (void);
|
||||
t_stat rp_svc (UNIT *uptr);
|
||||
t_stat rp_reset (DEVICE *dptr);
|
||||
t_stat rp_boot (int32 unitno, DEVICE *dptr);
|
||||
t_stat rp_attach (UNIT *uptr, char *cptr);
|
||||
t_stat rp_attach (UNIT *uptr, CONST char *cptr);
|
||||
t_stat rp_detach (UNIT *uptr);
|
||||
void set_rper (int16 flag, int32 drv);
|
||||
void update_rpcs (int32 flags, int32 drv);
|
||||
void rp_go (int32 drv, int32 fnc);
|
||||
t_stat rp_set_size (UNIT *uptr, int32 val, char *cptr, void *desc);
|
||||
t_stat rp_set_size (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
|
||||
|
||||
/* RP data structures
|
||||
|
||||
@@ -1150,7 +1150,7 @@ return SCPE_OK;
|
||||
|
||||
/* Device attach */
|
||||
|
||||
t_stat rp_attach (UNIT *uptr, char *cptr)
|
||||
t_stat rp_attach (UNIT *uptr, CONST char *cptr)
|
||||
{
|
||||
int32 i, p;
|
||||
t_stat r;
|
||||
@@ -1203,7 +1203,7 @@ return detach_unit (uptr);
|
||||
|
||||
/* Set size command validation routine */
|
||||
|
||||
t_stat rp_set_size (UNIT *uptr, int32 val, char *cptr, void *desc)
|
||||
t_stat rp_set_size (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
|
||||
{
|
||||
int32 dtype = GET_DTYPE (val);
|
||||
|
||||
|
||||
@@ -344,7 +344,7 @@ return SCPE_OK;
|
||||
|
||||
/* Master loader */
|
||||
|
||||
t_stat sim_load (FILE *fileref, char *cptr, char *fnam, int flag)
|
||||
t_stat sim_load (FILE *fileref, CONST char *cptr, CONST char *fnam, int flag)
|
||||
{
|
||||
d10 data;
|
||||
int32 wc, fmt;
|
||||
@@ -782,11 +782,11 @@ return SCPE_ARG;
|
||||
val = output value
|
||||
*/
|
||||
|
||||
t_value get_opnd (char *cptr, t_stat *status)
|
||||
t_value get_opnd (CONST char *cptr, t_stat *status)
|
||||
{
|
||||
int32 sign = 0;
|
||||
t_value val, xr = 0, ind = 0;
|
||||
const char *tptr;
|
||||
CONST char *tptr;
|
||||
|
||||
*status = SCPE_ARG; /* assume fail */
|
||||
if (*cptr == '@') {
|
||||
@@ -804,14 +804,14 @@ if (val > 0777777)
|
||||
return 0;
|
||||
if (sign)
|
||||
val = (~val + 1) & 0777777;
|
||||
cptr = (char *)tptr;
|
||||
cptr = tptr;
|
||||
if (*cptr == '(') {
|
||||
cptr++;
|
||||
xr = strtotv (cptr, &tptr, 8);
|
||||
if ((cptr == tptr) || (*tptr != ')') ||
|
||||
(xr > AC_NUM) || (xr == 0))
|
||||
return 0;
|
||||
cptr = (char *)++tptr;
|
||||
cptr = ++tptr;
|
||||
}
|
||||
if (*cptr == 0)
|
||||
*status = SCPE_OK;
|
||||
@@ -830,20 +830,17 @@ return (ind | (xr << 18) | val);
|
||||
status = error status
|
||||
*/
|
||||
|
||||
t_stat parse_sym (char *cptr, t_addr addr, UNIT *uptr, t_value *val, int32 sw)
|
||||
t_stat parse_sym (CONST char *cptr, t_addr addr, UNIT *uptr, t_value *val, int32 sw)
|
||||
{
|
||||
int32 i, j;
|
||||
t_value ac, dev;
|
||||
t_stat r;
|
||||
char gbuf[CBUFSIZE];
|
||||
char gbuf[CBUFSIZE], cbuf[2*CBUFSIZE];
|
||||
|
||||
while (isspace (*cptr)) cptr++;
|
||||
for (i = 0; i < 6; i++) {
|
||||
if (cptr[i] == 0) {
|
||||
for (j = i + 1; j <= 6; j++) cptr[j] = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
memset (cbuf, '\0', sizeof(cbuf));
|
||||
strncpy (cbuf, cptr, sizeof(cbuf)-7);
|
||||
cptr = cbuf;
|
||||
if ((sw & SWMASK ('A')) || ((*cptr == '\'') && cptr++)) { /* ASCII char? */
|
||||
if (cptr[0] == 0) /* must have 1 char */
|
||||
return SCPE_ARG;
|
||||
|
||||
@@ -145,7 +145,6 @@ extern d10 pcst;
|
||||
extern a10 pager_PC;
|
||||
extern int32 t20_idlelock;
|
||||
|
||||
DEVICE tim_dev;
|
||||
static t_stat tcu_rd (int32 *data, int32 PA, int32 access);
|
||||
static t_stat tim_svc (UNIT *uptr);
|
||||
static t_stat tim_reset (DEVICE *dptr);
|
||||
@@ -378,7 +377,7 @@ return SCPE_OK;
|
||||
|
||||
/* Set timer parameters from CPU model */
|
||||
|
||||
t_stat tim_set_mod (UNIT *uptr, int32 val, char *cptr, void *desc)
|
||||
t_stat tim_set_mod (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
|
||||
{
|
||||
if (val & (UNIT_T20|UNIT_KLAD)) {
|
||||
clk_tps = TIM_TPS_T20;
|
||||
|
||||
@@ -328,7 +328,7 @@ int32 reg_in_fmtr1[32] = { /* rmr if write + go */
|
||||
int32 fmt_test[16] = { /* fmt bytes/10 wd */
|
||||
5, 0, 5, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||
};
|
||||
static char *tu_fname[CS1_N_FNC] = {
|
||||
static const char *tu_fname[CS1_N_FNC] = {
|
||||
"NOP", "UNLD", "2", "REW", "FCLR", "5", "6", "7",
|
||||
"RIP", "11", "ERASE", "WREOF", "SPCF", "SPCR", "16", "17",
|
||||
"20", "21", "22", "23", "WRCHKF", "25", "26", "WRCHKR",
|
||||
@@ -341,7 +341,7 @@ t_stat tu_wr (int32 data, int32 PA, int32 access);
|
||||
int32 tu_inta (void);
|
||||
t_stat tu_svc (UNIT *uptr);
|
||||
t_stat tu_reset (DEVICE *dptr);
|
||||
t_stat tu_attach (UNIT *uptr, char *cptr);
|
||||
t_stat tu_attach (UNIT *uptr, CONST char *cptr);
|
||||
t_stat tu_detach (UNIT *uptr);
|
||||
t_stat tu_boot (int32 unitno, DEVICE *dptr);
|
||||
void tu_go (int32 drv);
|
||||
@@ -1179,7 +1179,7 @@ return SCPE_OK;
|
||||
|
||||
/* Attach routine */
|
||||
|
||||
t_stat tu_attach (UNIT *uptr, char *cptr)
|
||||
t_stat tu_attach (UNIT *uptr, CONST char *cptr)
|
||||
{
|
||||
int32 drv = uptr - tu_dev.units;
|
||||
t_stat r;
|
||||
|
||||
@@ -138,9 +138,6 @@
|
||||
#define ED_SKPN 0600 /* skip if N */
|
||||
#define ED_SKPA 0700 /* skip always */
|
||||
|
||||
extern d10 *ac_cur; /* current AC block */
|
||||
extern const d10 bytemask[64];
|
||||
extern int32 flags;
|
||||
extern int32 rlog;
|
||||
extern jmp_buf save_env;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user