mirror of
https://github.com/rcornwell/sims.git
synced 2026-04-16 00:21:25 +00:00
IBM360: Cleanup various compile errors.
This commit is contained in:
@@ -115,7 +115,6 @@ DEVICE cdp_dev = {
|
||||
uint8 cdp_startcmd(UNIT *uptr, uint16 chan, uint8 cmd) {
|
||||
DEVICE *dptr = find_dev_from_unit(uptr);
|
||||
int unit = (uptr - dptr->units);
|
||||
uint8 ch;
|
||||
|
||||
if ((uptr->u3 & (CDP_CARD|CDP_CMDMSK)) != 0) {
|
||||
if ((uptr->flags & UNIT_ATT) != 0)
|
||||
|
||||
@@ -110,7 +110,6 @@ DEVICE cdr_dev = {
|
||||
uint8 cdr_startcmd(UNIT *uptr, uint16 chan, uint8 cmd) {
|
||||
DEVICE *dptr = find_dev_from_unit(uptr);
|
||||
int unit = (uptr - dptr->units);
|
||||
uint8 ch;
|
||||
|
||||
if ((uptr->u3 & CDR_CMDMSK) != 0) {
|
||||
if ((uptr->flags & UNIT_ATT) != 0)
|
||||
@@ -249,7 +248,6 @@ t_stat
|
||||
cdr_boot(int32 unit_num, DEVICE * dptr)
|
||||
{
|
||||
UNIT *uptr = &dptr->units[unit_num];
|
||||
t_stat r;
|
||||
|
||||
if ((uptr->flags & UNIT_ATT) == 0)
|
||||
return SCPE_UNATT; /* attached? */
|
||||
|
||||
@@ -401,7 +401,6 @@ int
|
||||
chan_read_byte(uint16 addr, uint8 *data) {
|
||||
int chan = find_subchan(addr);
|
||||
int byte;
|
||||
int k;
|
||||
|
||||
/* Abort if we have any errors */
|
||||
if (chan < 0)
|
||||
@@ -449,9 +448,7 @@ chan_read_byte(uint16 addr, uint8 *data) {
|
||||
int
|
||||
chan_write_byte(uint16 addr, uint8 *data) {
|
||||
int chan = find_subchan(addr);
|
||||
int byte;
|
||||
int offset;
|
||||
int k;
|
||||
uint32 mask;
|
||||
|
||||
/* Abort if we have any errors */
|
||||
@@ -636,7 +633,6 @@ startio(uint16 addr) {
|
||||
int chan = find_subchan(addr);
|
||||
DIB *dibp = dev_unit[addr];
|
||||
UNIT *uptr;
|
||||
uint8 status;
|
||||
|
||||
/* Find channel this device is on, if no none return cc=3 */
|
||||
if (chan < 0 || dibp == 0) {
|
||||
@@ -829,7 +825,6 @@ int haltio(uint16 addr) {
|
||||
int chan = find_subchan(addr);
|
||||
DIB *dibp = dev_unit[addr];
|
||||
UNIT *uptr;
|
||||
uint8 status;
|
||||
|
||||
/* Find channel this device is on, if no none return cc=3 */
|
||||
if (chan < 0 || dibp == 0) {
|
||||
@@ -884,7 +879,6 @@ t_stat chan_boot(uint16 addr, DEVICE *dptyr) {
|
||||
int chan = find_subchan(addr);
|
||||
DIB *dibp = dev_unit[addr];
|
||||
UNIT *uptr;
|
||||
uint8 status;
|
||||
int i;
|
||||
|
||||
if (chan < 0 || dibp == 0)
|
||||
@@ -956,7 +950,7 @@ scan_chan(uint16 mask, int irq_en) {
|
||||
sim_debug(DEBUG_EXP, &cpu_dev, "Scan(%x %x %x %x) end\n", i,
|
||||
chan_status[i], imask, mask);
|
||||
if ((chan_status[i] & STATUS_DEND) != 0 &&
|
||||
(imask & mask) != 0 || loading != 0) {
|
||||
((imask & mask) != 0 || loading != 0)) {
|
||||
pend = chan_dev[i];
|
||||
break;
|
||||
}
|
||||
@@ -1009,7 +1003,7 @@ scan_chan(uint16 mask, int irq_en) {
|
||||
t_stat
|
||||
chan_set_devs()
|
||||
{
|
||||
int i, j;
|
||||
uint32 i, j;
|
||||
|
||||
for(i = 0; i < MAX_DEV; i++) {
|
||||
dev_unit[i] = NULL; /* Device pointer */
|
||||
@@ -1020,7 +1014,6 @@ chan_set_devs()
|
||||
UNIT *uptr = dptr->units;
|
||||
DIB *dibp = (DIB *) dptr->ctxt;
|
||||
int addr;
|
||||
int chan;
|
||||
|
||||
/* If no DIB, not channel device */
|
||||
if (dibp == NULL)
|
||||
@@ -1050,8 +1043,6 @@ set_dev_addr(UNIT * uptr, int32 val, CONST char *cptr, void *desc)
|
||||
DIB *dibp;
|
||||
t_value newdev;
|
||||
t_stat r;
|
||||
int num;
|
||||
int type;
|
||||
int i;
|
||||
int devaddr;
|
||||
|
||||
@@ -1072,7 +1063,7 @@ set_dev_addr(UNIT * uptr, int32 val, CONST char *cptr, void *desc)
|
||||
if (r != SCPE_OK)
|
||||
return r;
|
||||
|
||||
if ((newdev >> 8) > channels)
|
||||
if ((newdev >> 8) > (t_value)channels)
|
||||
return SCPE_ARG;
|
||||
|
||||
if (newdev >= MAX_DEV)
|
||||
@@ -1127,7 +1118,6 @@ t_stat
|
||||
show_dev_addr(FILE * st, UNIT * uptr, int32 v, CONST void *desc)
|
||||
{
|
||||
DEVICE *dptr;
|
||||
DIB *dibp;
|
||||
int addr;
|
||||
|
||||
|
||||
|
||||
@@ -238,7 +238,6 @@ uint8 coml_startcmd(UNIT *uptr, uint16 chan, uint8 cmd) {
|
||||
uint16 addr = GET_UADDR(uptr->u3);
|
||||
DEVICE *dptr = find_dev_from_unit(uptr);
|
||||
int unit = (uptr - dptr->units);
|
||||
uint8 ch;
|
||||
|
||||
sim_debug(DEBUG_CMD, dptr, "CMD unit=%d %x\n", unit, cmd);
|
||||
if ((uptr->u3 & 0xff) != 0) {
|
||||
@@ -274,7 +273,6 @@ uint8 coml_haltio(UNIT *uptr) {
|
||||
DEVICE *dptr = find_dev_from_unit(uptr);
|
||||
int unit = (uptr - dptr->units);
|
||||
int cmd = uptr->u3 & 0xff;
|
||||
uint8 ch;
|
||||
|
||||
sim_debug(DEBUG_CMD, dptr, "HLTIO unit=%d %x\n", unit, cmd);
|
||||
|
||||
@@ -476,7 +474,6 @@ com_reset(DEVICE * dptr)
|
||||
void
|
||||
coml_ini(UNIT * uptr, t_bool f)
|
||||
{
|
||||
UNIT *srv;
|
||||
}
|
||||
|
||||
t_stat
|
||||
@@ -502,7 +499,6 @@ com_detach(UNIT * uptr)
|
||||
{
|
||||
t_stat r;
|
||||
int i;
|
||||
UNIT *srv;
|
||||
|
||||
for (i = 0; i< com_desc.lines; i++) {
|
||||
(void)tmxr_set_get_modem_bits(&com_ldsc[i], 0, TMXR_MDM_DTR, NULL);
|
||||
@@ -517,7 +513,6 @@ com_detach(UNIT * uptr)
|
||||
t_stat com_help (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag,
|
||||
const char *cptr)
|
||||
{
|
||||
int i;
|
||||
fprint_set_help (st, dptr);
|
||||
fprint_show_help (st, dptr);
|
||||
return SCPE_OK;
|
||||
|
||||
@@ -142,6 +142,7 @@ uint32 tlb[256]; /* Translation look aside buffer */
|
||||
#define B1(x) (((x) >> 12) & 0xf)
|
||||
#define D1(x) ((x) & 0xfff)
|
||||
#define X2(x) R2(x)
|
||||
#define NEG(x) (uint32)(-(int32)(x))
|
||||
|
||||
#define PTE_LEN 0xff000000 /* Page table length */
|
||||
#define PTE_ADR 0x00fffffe /* Address of table */
|
||||
@@ -681,7 +682,6 @@ int WriteHalf(uint32 addr, uint32 data) {
|
||||
uint32 pa;
|
||||
uint32 pa2;
|
||||
int offset;
|
||||
int o;
|
||||
|
||||
/* Validate address */
|
||||
if (TransAddr(addr, &pa))
|
||||
@@ -774,7 +774,7 @@ sim_instr(void)
|
||||
uint8 zone;
|
||||
uint16 irq;
|
||||
int e1, e2;
|
||||
int temp, temp2;
|
||||
int temp;
|
||||
#ifdef USE_64BIT
|
||||
t_uint64 src1L;
|
||||
t_uint64 src2L;
|
||||
@@ -1080,9 +1080,7 @@ opr:
|
||||
} else if (addr1 >= MEMSIZE) {
|
||||
storepsw(OPPSW, IRC_ADDR);
|
||||
} else if (cpu_unit[0].flags & FEAT_PROT) {
|
||||
if (TransAddr(addr1, &addr2))
|
||||
break;
|
||||
key[addr2 >> 11] = src1 & 0xf8;
|
||||
key[addr1 >> 11] = src1 & 0xf8;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1097,10 +1095,8 @@ opr:
|
||||
} else if (addr1 >= MEMSIZE) {
|
||||
storepsw(OPPSW, IRC_ADDR);
|
||||
} else {
|
||||
if (TransAddr(addr1, &addr2))
|
||||
break;
|
||||
dest &= 0xffffff00;
|
||||
dest |= key[addr2 >> 11];
|
||||
dest |= key[addr1 >> 11] & 0xf8;
|
||||
regs[reg1] = dest;
|
||||
}
|
||||
break;
|
||||
@@ -1197,7 +1193,7 @@ opr:
|
||||
case OP_LCR:
|
||||
if (dest == MSIGN)
|
||||
goto set_cc3;
|
||||
dest = -dest;
|
||||
dest = NEG(dest);
|
||||
/* Fall through */
|
||||
|
||||
case OP_LTR:
|
||||
@@ -1208,7 +1204,7 @@ set_cc:
|
||||
|
||||
case OP_LNR:
|
||||
if ((dest & MSIGN) == 0)
|
||||
dest = -dest;
|
||||
dest = NEG(dest);
|
||||
goto set_cc;
|
||||
|
||||
case OP_LA:
|
||||
@@ -1233,7 +1229,7 @@ set_cc:
|
||||
case OP_S:
|
||||
case OP_SR:
|
||||
case OP_SH:
|
||||
src2 = -src2;
|
||||
src2 = NEG(src2);
|
||||
/* Fall through */
|
||||
|
||||
case OP_A:
|
||||
@@ -1253,7 +1249,7 @@ set_cc3:
|
||||
|
||||
case OP_SL:
|
||||
case OP_SLR:
|
||||
src2 = -src2;
|
||||
src2 = NEG(src2);
|
||||
/* Fall through */
|
||||
|
||||
case OP_AL:
|
||||
@@ -1289,16 +1285,16 @@ set_cc3:
|
||||
|
||||
if (src1 & MSIGN) {
|
||||
fill = 1;
|
||||
src1 = -src1;
|
||||
src1 = NEG(src1);
|
||||
}
|
||||
if (src2 & MSIGN) {
|
||||
fill ^= 1;
|
||||
src2 = -src2;
|
||||
src2 = NEG(src2);
|
||||
}
|
||||
#ifdef USE_64BIT
|
||||
src1L = ((t_uint64)src1) * ((t_uint64)src2);
|
||||
if (fill)
|
||||
src1L = -src1L;
|
||||
src1L = NEG(src1L);
|
||||
if (op != OP_MH) {
|
||||
STDBL(reg1, src1L);
|
||||
} else {
|
||||
@@ -1348,11 +1344,11 @@ set_cc3:
|
||||
|
||||
if (src1L & MSIGNL) {
|
||||
fill = 3;
|
||||
src1L = -src1L;
|
||||
src1L = NEG(src1L);
|
||||
}
|
||||
if (src2 & MSIGN) {
|
||||
fill ^= 1;
|
||||
src2 = -src2;
|
||||
src2 = NEG(src2);
|
||||
}
|
||||
src2L = src1L % (t_uint64)src2;
|
||||
src1L = src1L / (t_uint64)src2;
|
||||
@@ -1377,7 +1373,7 @@ set_cc3:
|
||||
}
|
||||
if (src2 & MSIGN) {
|
||||
fill ^= 1;
|
||||
src2 = -src2;
|
||||
src2 = NEG(src2);
|
||||
}
|
||||
dest = 0;
|
||||
for (reg = 0; reg < 32; reg++) {
|
||||
@@ -1405,9 +1401,9 @@ set_cc3:
|
||||
}
|
||||
#endif
|
||||
if (fill & 1)
|
||||
dest = -dest;
|
||||
dest = NEG(dest);
|
||||
if (fill & 2)
|
||||
src1 = -src1;
|
||||
src1 = NEG(src1);
|
||||
regs[reg1] = src1;
|
||||
regs[reg1|1] = dest;
|
||||
break;
|
||||
@@ -1817,9 +1813,6 @@ save_dbl:
|
||||
} else if (flags & PROBLEM) {
|
||||
storepsw(OPPSW, IRC_PRIV);
|
||||
} else {
|
||||
uint32 seg;
|
||||
uint32 page;
|
||||
|
||||
/* RX in RS range */
|
||||
if (X2(reg) != 0)
|
||||
addr1 = (addr1 + regs[X2(reg)]) & AMASK;
|
||||
@@ -2096,7 +2089,7 @@ save_dbl:
|
||||
}
|
||||
/* Twos compliment if needed */
|
||||
if (fill == 0xB || fill == 0xD)
|
||||
dest = -dest;
|
||||
dest = NEG(dest);
|
||||
regs[reg1] = dest;
|
||||
break;
|
||||
|
||||
@@ -2106,7 +2099,7 @@ save_dbl:
|
||||
src1 = 0;
|
||||
src1h = 0;
|
||||
if (dest & MSIGN) { /* Save sign */
|
||||
dest = -dest;
|
||||
dest = NEG(dest);
|
||||
fill = 1;
|
||||
} else
|
||||
fill = 0;
|
||||
@@ -4476,7 +4469,8 @@ dec_div(int op, uint32 addr1, uint8 len1, uint32 addr2, uint8 len2)
|
||||
|
||||
t_stat cpu_reset (DEVICE *dptr)
|
||||
{
|
||||
st_key = cc = pmsk = irqcode = flags = irqaddr = loading = 0;
|
||||
st_key = cc = pmsk = flags = 0;
|
||||
irqcode = irqaddr = loading = 0;
|
||||
dat_en = irq_en = ext_en = 0;
|
||||
chan_set_devs();
|
||||
if (M == NULL) { /* first time init? */
|
||||
@@ -4572,7 +4566,7 @@ if ((mc != 0) && !get_yn ("Really truncate memory [N]?", FALSE))
|
||||
nM = (uint32 *) calloc (val >> 2, sizeof (uint32));
|
||||
if (nM == NULL)
|
||||
return SCPE_MEM;
|
||||
clim = (val < MEMSIZE)? val >> 2: max;
|
||||
clim = ((t_addr)val < MEMSIZE)? val >> 2: max;
|
||||
for (i = 0; i < clim; i++)
|
||||
nM[i] = M[i];
|
||||
free (M);
|
||||
@@ -4644,7 +4638,6 @@ cpu_show_hist(FILE * st, UNIT * uptr, int32 val, CONST void *desc)
|
||||
for (k = 0; k < lnt; k++) { /* print specified */
|
||||
h = &hst[(++di) % hst_lnt]; /* entry pointer */
|
||||
if (h->pc & HIST_PC) { /* instruction? */
|
||||
int i;
|
||||
fprintf(st, "%06x %06x %06x %08x %08x %08x %1x %04x ",
|
||||
h->pc & PAMASK, h->addr1 & PAMASK, h->addr2 & PAMASK,
|
||||
h->src1, h->src2, h->dest, h->cc, h->inst[0]);
|
||||
@@ -4661,12 +4654,10 @@ cpu_show_hist(FILE * st, UNIT * uptr, int32 val, CONST void *desc)
|
||||
fputc('\n', st); /* end line */
|
||||
} /* end else instruction */
|
||||
if (h->pc & HIST_LPW) { /* load PSW */
|
||||
int i;
|
||||
fprintf(st, " LPSW %06x %08x %08x\n", h->pc & PAMASK, h->src1, h->src2);
|
||||
fprintf(st," LPSW %06x %08x %08x\n", h->pc & PAMASK, h->src1, h->src2);
|
||||
} /* end else instruction */
|
||||
if (h->pc & HIST_SPW) { /* load PSW */
|
||||
int i;
|
||||
fprintf(st, " SPSW %06x %08x %08x\n", h->pc & PAMASK, h->src1, h->src2);
|
||||
fprintf(st," SPSW %06x %08x %08x\n", h->pc & PAMASK, h->src1, h->src2);
|
||||
} /* end else instruction */
|
||||
} /* end for */
|
||||
return SCPE_OK;
|
||||
|
||||
@@ -196,9 +196,9 @@ struct dasd_t
|
||||
struct disk_t
|
||||
{
|
||||
const char *name; /* Type Name */
|
||||
unsigned int cyl; /* Number of cylinders */
|
||||
unsigned int heads; /* Number of heads/cylinder */
|
||||
unsigned int bpt; /* Max bytes per track */
|
||||
int cyl; /* Number of cylinders */
|
||||
int heads; /* Number of heads/cylinder */
|
||||
int bpt; /* Max bytes per track */
|
||||
uint8 sen_cnt; /* Number of sense bytes */
|
||||
uint8 dev_type; /* Device type code */
|
||||
}
|
||||
@@ -454,7 +454,8 @@ void dasd_adjpos(UNIT * uptr)
|
||||
|
||||
/* Set ourselves to start of track */
|
||||
data->state = DK_POS_HA;
|
||||
data->rpos = data->rec = data->count = data->klen = data->dlen = 0;
|
||||
data->rec = data->klen = 0;
|
||||
data->rpos = data->count = data->dlen = 0;
|
||||
data->tstart = (uptr->u4 & 0xff) * data->tsize;
|
||||
rec = &data->cbuf[data->rpos + data->tstart];
|
||||
/* Skip forward until we reach pos */
|
||||
@@ -1762,7 +1763,6 @@ dasd_boot(int32 unit_num, DEVICE * dptr)
|
||||
{
|
||||
UNIT *uptr = &dptr->units[unit_num];
|
||||
struct dasd_t *data = (struct dasd_t *)(uptr->up7);
|
||||
t_stat r;
|
||||
|
||||
if ((uptr->flags & UNIT_ATT) == 0)
|
||||
return SCPE_UNATT; /* attached? */
|
||||
|
||||
@@ -118,7 +118,7 @@ DEVICE lpr_dev = {
|
||||
t_stat
|
||||
lpr_setlpp(UNIT *uptr, int32 val, CONST char *cptr, void *desc)
|
||||
{
|
||||
int i;
|
||||
t_addr i;
|
||||
if (cptr == NULL)
|
||||
return SCPE_ARG;
|
||||
if (uptr == NULL)
|
||||
@@ -177,7 +177,7 @@ print_line(UNIT * uptr)
|
||||
uptr->pos += i;
|
||||
sim_debug(DEBUG_DETAIL, &lpr_dev, "%s", out);
|
||||
uptr->u4++;
|
||||
if (uptr->u4 > uptr->capac) {
|
||||
if ((t_addr)uptr->u4 > uptr->capac) {
|
||||
uptr->u4 = 1;
|
||||
}
|
||||
|
||||
@@ -187,8 +187,6 @@ print_line(UNIT * uptr)
|
||||
|
||||
uint8 lpr_startcmd(UNIT * uptr, uint16 chan, uint8 cmd)
|
||||
{
|
||||
uint8 ch;
|
||||
|
||||
if ((uptr->u3 & LPR_CMDMSK) != 0) {
|
||||
if ((uptr->flags & UNIT_ATT) != 0)
|
||||
return SNS_BSY;
|
||||
|
||||
@@ -228,7 +228,6 @@ uint8 mt_startcmd(UNIT *uptr, uint16 chan, uint8 cmd) {
|
||||
uint16 addr = GET_UADDR(uptr->u3);
|
||||
DEVICE *dptr = find_dev_from_unit(uptr);
|
||||
int unit = (uptr - dptr->units);
|
||||
uint8 ch;
|
||||
|
||||
if (mt_busy[GET_DEV_BUF(dptr->flags)] != 0 || (uptr->u3 & MT_CMDMSK) != 0) {
|
||||
sim_debug(DEBUG_CMD, dptr, "CMD busy unit=%d %x\n", unit, cmd);
|
||||
@@ -451,7 +450,7 @@ t_stat mt_srv(UNIT * uptr)
|
||||
if (uptr->u3 & MT_CONV) {
|
||||
sim_debug(DEBUG_DATA, dptr, "Read raw data unit=%d %d %02x %02x\n",
|
||||
unit, uptr->u4, ch, uptr->u6);
|
||||
if (uptr->u6 == 0 && uptr->u4 < uptr->hwmark) {
|
||||
if (uptr->u6 == 0 && (t_addr)uptr->u4 < uptr->hwmark) {
|
||||
uptr->u6 = MT_CONV1 | ch;
|
||||
sim_activate(uptr, 20);
|
||||
return SCPE_OK;
|
||||
@@ -474,7 +473,7 @@ t_stat mt_srv(UNIT * uptr)
|
||||
if (chan_write_byte(addr, &ch)) {
|
||||
sim_debug(DEBUG_DATA, dptr, "Read unit=%d EOR\n\r", unit);
|
||||
/* If not read whole record, skip till end */
|
||||
if (uptr->u4 < uptr->hwmark) {
|
||||
if ((t_addr)uptr->u4 < uptr->hwmark) {
|
||||
/* Send dummy character to force SLI */
|
||||
chan_write_byte(addr, &ch);
|
||||
sim_activate(uptr, (uptr->hwmark-uptr->u4) * 20);
|
||||
@@ -487,7 +486,7 @@ t_stat mt_srv(UNIT * uptr)
|
||||
} else {
|
||||
sim_debug(DEBUG_DATA, dptr, "Read data unit=%d %d %02x\n\r",
|
||||
unit, uptr->u4, ch);
|
||||
if (uptr->u4 >= uptr->hwmark) { /* In IRG */
|
||||
if ((t_addr)uptr->u4 >= uptr->hwmark) { /* In IRG */
|
||||
/* Handle end of record */
|
||||
uptr->u3 &= ~MT_CMDMSK;
|
||||
mt_busy[bufnum] &= ~1;
|
||||
@@ -591,7 +590,7 @@ t_stat mt_srv(UNIT * uptr)
|
||||
if (uptr->u3 & MT_TRANS)
|
||||
ch = bcd_to_ebcdic[ch];
|
||||
if (uptr->u3 & MT_CONV) {
|
||||
if (uptr->u6 == 0 && uptr->u4 < uptr->hwmark) {
|
||||
if (uptr->u6 == 0 && (t_addr)uptr->u4 < uptr->hwmark) {
|
||||
uptr->u6 = MT_CONV1 | ch;
|
||||
sim_activate(uptr, 20);
|
||||
return SCPE_OK;
|
||||
@@ -907,7 +906,6 @@ t_stat
|
||||
mt_boot(int32 unit_num, DEVICE * dptr)
|
||||
{
|
||||
UNIT *uptr = &dptr->units[unit_num];
|
||||
t_stat r;
|
||||
|
||||
if ((uptr->flags & UNIT_ATT) == 0)
|
||||
return SCPE_UNATT; /* attached? */
|
||||
|
||||
@@ -372,8 +372,6 @@ t_opcode optab[] = {
|
||||
|
||||
void fprint_inst(FILE *of, uint16 *val) {
|
||||
uint8 inst = (val[0] >> 8) & 0xff;
|
||||
int i;
|
||||
int l = 1;
|
||||
t_opcode *tab;
|
||||
|
||||
for (tab = optab; tab->name != NULL; tab++) {
|
||||
|
||||
Reference in New Issue
Block a user