TIMER, SCP: Change the sim_activate_after APIs to pass the delay value as uint32.

Also change all sim_defs.h structure declarations and references of sim_
structures to use the typedef names everywhere.
This commit is contained in:
Mark Pizzolato 2015-12-10 06:33:59 -08:00
parent 2549f34560
commit de0d251c75
13 changed files with 134 additions and 131 deletions

View file

@ -93,7 +93,7 @@ t_stat cpu_deposit (t_value val, t_addr addr, UNIT *uptr, int32 sw);
t_stat cpu_reset (DEVICE *dptr); t_stat cpu_reset (DEVICE *dptr);
t_stat cpu_req (UNIT *u, int32 val, char *cptr, void *desc); t_stat cpu_req (UNIT *u, int32 val, char *cptr, void *desc);
t_stat cpu_set_pult (UNIT *u, int32 val, char *cptr, void *desc); t_stat cpu_set_pult (UNIT *u, int32 val, char *cptr, void *desc);
t_stat cpu_show_pult (FILE *st, struct sim_unit *up, int32 v, void *dp); t_stat cpu_show_pult (FILE *st, UNIT *up, int32 v, void *dp);
/* /*
@ -415,7 +415,7 @@ t_stat cpu_set_pult (UNIT *u, int32 val, char *cptr, void *desc)
return SCPE_ARG; return SCPE_ARG;
} }
t_stat cpu_show_pult (FILE *st, struct sim_unit *up, int32 v, void *dp) t_stat cpu_show_pult (FILE *st, UNIT *up, int32 v, void *dp)
{ {
fprintf(st, "Pult packet switch position is %d", pult_packet_switch); fprintf(st, "Pult packet switch position is %d", pult_packet_switch);
return SCPE_OK; return SCPE_OK;

View file

@ -360,7 +360,7 @@ t_stat fprint_sym (FILE *of, t_addr addr, t_value *val,
void besm6_draw_panel (int force); void besm6_draw_panel (int force);
t_stat besm6_init_panel (UNIT *u, int32 val, char *cptr, void *desc); t_stat besm6_init_panel (UNIT *u, int32 val, char *cptr, void *desc);
t_stat besm6_close_panel (UNIT *u, int32 val, char *cptr, void *desc); t_stat besm6_close_panel (UNIT *u, int32 val, char *cptr, void *desc);
t_stat besm6_show_panel (FILE *st, struct sim_unit *up, int32 v, void *dp); t_stat besm6_show_panel (FILE *st, UNIT *up, int32 v, void *dp);
/* /*
* Арифметика. * Арифметика.

View file

@ -441,7 +441,7 @@ t_stat besm6_close_panel (UNIT *u, int32 val, char *cptr, void *desc)
return SCPE_OK; return SCPE_OK;
} }
t_stat besm6_show_panel (FILE *st, struct sim_unit *up, int32 v, void *dp) t_stat besm6_show_panel (FILE *st, UNIT *up, int32 v, void *dp)
{ {
if (screen) if (screen)
fprintf(st, "Panel displayed"); fprintf(st, "Panel displayed");
@ -688,7 +688,7 @@ t_stat besm6_close_panel (UNIT *u, int32 val, char *cptr, void *desc)
return SCPE_NOTATT; return SCPE_NOTATT;
} }
t_stat besm6_show_panel (FILE *st, struct sim_unit *up, int32 v, void *dp) t_stat besm6_show_panel (FILE *st, UNIT *up, int32 v, void *dp)
{ {
return SCPE_NOTATT; return SCPE_NOTATT;
} }

View file

@ -217,8 +217,8 @@ static t_bool lp20_davfu (int32 c);
static void update_lpcs (int32 flg); static void update_lpcs (int32 flg);
static void change_rdy (int32 setrdy, int32 clrrdy); static void change_rdy (int32 setrdy, int32 clrrdy);
static int16 evenbits (int16 value); static int16 evenbits (int16 value);
static t_stat lp20_help (FILE *st, struct sim_device *dptr, static t_stat lp20_help (FILE *st, DEVICE *dptr,
struct sim_unit *uptr, int32 flag, const char *cptr); UNIT *uptr, int32 flag, const char *cptr);
static const char *lp20_description (DEVICE *dptr); static const char *lp20_description (DEVICE *dptr);
/* DEC standard VFU tape for 'optical' VFU default. /* DEC standard VFU tape for 'optical' VFU default.
@ -1278,8 +1278,8 @@ update_lpcs (0);
return SCPE_OK; return SCPE_OK;
} }
static t_stat lp20_help (FILE *st, struct sim_device *dptr, static t_stat lp20_help (FILE *st, DEVICE *dptr,
struct sim_unit *uptr, int32 flag, const char *cptr) UNIT *uptr, int32 flag, const char *cptr)
{ {
fprintf (st, fprintf (st,
"The LP20 DMA line printer controller is a UNIBUS device developed by the 36-bit product line.\n" "The LP20 DMA line printer controller is a UNIBUS device developed by the 36-bit product line.\n"

View file

@ -493,8 +493,8 @@ static t_stat kmc_setLineSpeed (UNIT *txup, int32 val, char *cptr, void *desc);
static t_stat kmc_showLineSpeed (FILE *st, UNIT *txup, int32 val, void *desc); static t_stat kmc_showLineSpeed (FILE *st, UNIT *txup, int32 val, void *desc);
static t_stat kmc_showStatus (FILE *st, UNIT *up, int32 v, void *dp); static t_stat kmc_showStatus (FILE *st, UNIT *up, int32 v, void *dp);
static t_stat kmc_help (FILE *st, struct sim_device *dptr, static t_stat kmc_help (FILE *st, DEVICE *dptr,
struct sim_unit *uptr, int32 flag, const char *cptr); UNIT *uptr, int32 flag, const char *cptr);
static const char *kmc_description (DEVICE *dptr); static const char *kmc_description (DEVICE *dptr);
/* Global data */ /* Global data */
@ -2941,8 +2941,8 @@ t_stat kmc_showStatus (FILE *st, UNIT *up, int32 v, void *dp) {
* *
*/ */
static t_stat kmc_help (FILE *st, struct sim_device *dptr, static t_stat kmc_help (FILE *st, DEVICE *dptr,
struct sim_unit *uptr, int32 flag, const char *cptr) { UNIT *uptr, int32 flag, const char *cptr) {
const char *const text = const char *const text =
" The KMC11-A is a general purpose microprocessor that is used in\n" " The KMC11-A is a general purpose microprocessor that is used in\n"
" several DEC products. The KDP is an emulation of one of those\n" " several DEC products. The KDP is an emulation of one of those\n"

40
scp.c
View file

@ -8465,24 +8465,24 @@ else
reason = result (SCPE_OK if ok) reason = result (SCPE_OK if ok)
*/ */
t_stat sim_activate_after_abs (UNIT *uptr, int32 event_time) t_stat sim_activate_after_abs (UNIT *uptr, uint32 event_time)
{ {
return _sim_activate_after_abs (uptr, event_time); return _sim_activate_after_abs (uptr, event_time);
} }
t_stat _sim_activate_after_abs (UNIT *uptr, int32 event_time) t_stat _sim_activate_after_abs (UNIT *uptr, uint32 event_time)
{ {
AIO_ACTIVATE (_sim_activate_after_abs, uptr, event_time); AIO_ACTIVATE (_sim_activate_after_abs, uptr, event_time);
sim_cancel (uptr); sim_cancel (uptr);
return _sim_activate_after (uptr, event_time); return _sim_activate_after (uptr, event_time);
} }
t_stat sim_activate_after (UNIT *uptr, int32 event_time) t_stat sim_activate_after (UNIT *uptr, uint32 usec_delay)
{ {
return _sim_activate_after (uptr, event_time); return _sim_activate_after (uptr, usec_delay);
} }
t_stat _sim_activate_after (UNIT *uptr, int32 usec_delay) t_stat _sim_activate_after (UNIT *uptr, uint32 usec_delay)
{ {
if (sim_is_active (uptr)) /* already active? */ if (sim_is_active (uptr)) /* already active? */
return SCPE_OK; return SCPE_OK;
@ -10000,8 +10000,8 @@ return ret;
* *
* Device help can be presented hierarchically by calling * Device help can be presented hierarchically by calling
* *
* t_stat scp_help (FILE *st, struct sim_device *dptr, * t_stat scp_help (FILE *st, DEVICE *dptr,
* struct sim_unit *uptr, int flag, const char *help, char *cptr) * UNIT *uptr, int flag, const char *help, char *cptr)
* *
* or one of its three cousins from the device HELP routine. * or one of its three cousins from the device HELP routine.
* *
@ -10083,8 +10083,8 @@ return;
/* Build a help tree from a string. /* Build a help tree from a string.
* Handles substitutions, formatting. * Handles substitutions, formatting.
*/ */
static TOPIC *buildHelp (TOPIC *topic, struct sim_device *dptr, static TOPIC *buildHelp (TOPIC *topic, DEVICE *dptr,
struct sim_unit *uptr, const char *htext, va_list ap) UNIT *uptr, const char *htext, va_list ap)
{ {
char *end; char *end;
size_t n, ilvl; size_t n, ilvl;
@ -10368,7 +10368,7 @@ free (prefix);
return newp; return newp;
} }
static void displayMagicTopic (FILE *st, struct sim_device *dptr, TOPIC *topic) static void displayMagicTopic (FILE *st, DEVICE *dptr, TOPIC *topic)
{ {
char tbuf[CBUFSIZE]; char tbuf[CBUFSIZE];
size_t i, skiplines; size_t i, skiplines;
@ -10434,8 +10434,8 @@ return;
/* Flatten and display help for those who say they prefer it. /* Flatten and display help for those who say they prefer it.
*/ */
static t_stat displayFlatHelp (FILE *st, struct sim_device *dptr, static t_stat displayFlatHelp (FILE *st, DEVICE *dptr,
struct sim_unit *uptr, int32 flag, UNIT *uptr, int32 flag,
TOPIC *topic, va_list ap ) TOPIC *topic, va_list ap )
{ {
size_t i; size_t i;
@ -10498,8 +10498,8 @@ return match;
* Takes a va_list * Takes a va_list
*/ */
t_stat scp_vhelp (FILE *st, struct sim_device *dptr, t_stat scp_vhelp (FILE *st, DEVICE *dptr,
struct sim_unit *uptr, int32 flag, UNIT *uptr, int32 flag,
const char *help, const char *cptr, va_list ap) const char *help, const char *cptr, va_list ap)
{ {
@ -10731,8 +10731,8 @@ return SCPE_OK;
/* variable argument list shell - most commonly used /* variable argument list shell - most commonly used
*/ */
t_stat scp_help (FILE *st, struct sim_device *dptr, t_stat scp_help (FILE *st, DEVICE *dptr,
struct sim_unit *uptr, int32 flag, UNIT *uptr, int32 flag,
const char *help, const char *cptr, ...) const char *help, const char *cptr, ...)
{ {
t_stat r; t_stat r;
@ -10753,8 +10753,8 @@ return r;
* be found. * be found.
*/ */
t_stat scp_vhelpFromFile (FILE *st, struct sim_device *dptr, t_stat scp_vhelpFromFile (FILE *st, DEVICE *dptr,
struct sim_unit *uptr, int32 flag, UNIT *uptr, int32 flag,
const char *helpfile, const char *helpfile,
const char *cptr, va_list ap) const char *cptr, va_list ap)
{ {
@ -10850,8 +10850,8 @@ free (help);
return r; return r;
} }
t_stat scp_helpFromFile (FILE *st, struct sim_device *dptr, t_stat scp_helpFromFile (FILE *st, DEVICE *dptr,
struct sim_unit *uptr, int32 flag, UNIT *uptr, int32 flag,
const char *helpfile, const char *cptr, ...) const char *helpfile, const char *cptr, ...)
{ {
t_stat r; t_stat r;

24
scp.h
View file

@ -116,10 +116,10 @@ t_stat sim_activate (UNIT *uptr, int32 interval);
t_stat _sim_activate (UNIT *uptr, int32 interval); t_stat _sim_activate (UNIT *uptr, int32 interval);
t_stat sim_activate_abs (UNIT *uptr, int32 interval); t_stat sim_activate_abs (UNIT *uptr, int32 interval);
t_stat sim_activate_notbefore (UNIT *uptr, int32 rtime); t_stat sim_activate_notbefore (UNIT *uptr, int32 rtime);
t_stat sim_activate_after (UNIT *uptr, int32 usecs_walltime); t_stat sim_activate_after (UNIT *uptr, uint32 usecs_walltime);
t_stat _sim_activate_after (UNIT *uptr, int32 usecs_walltime); t_stat _sim_activate_after (UNIT *uptr, uint32 usecs_walltime);
t_stat sim_activate_after_abs (UNIT *uptr, int32 usecs_walltime); t_stat sim_activate_after_abs (UNIT *uptr, uint32 usecs_walltime);
t_stat _sim_activate_after_abs (UNIT *uptr, int32 usecs_walltime); t_stat _sim_activate_after_abs (UNIT *uptr, uint32 usecs_walltime);
t_stat sim_cancel (UNIT *uptr); t_stat sim_cancel (UNIT *uptr);
t_bool sim_is_active (UNIT *uptr); t_bool sim_is_active (UNIT *uptr);
int32 sim_activate_time (UNIT *uptr); int32 sim_activate_time (UNIT *uptr);
@ -220,14 +220,14 @@ void fprint_stopped_gen (FILE *st, t_stat v, REG *pc, DEVICE *dptr);
#define SCP_HELP_FLAT (1u << 31) /* Force flat help when prompting is not possible */ #define SCP_HELP_FLAT (1u << 31) /* Force flat help when prompting is not possible */
#define SCP_HELP_ONECMD (1u << 30) /* Display one topic, do not prompt */ #define SCP_HELP_ONECMD (1u << 30) /* Display one topic, do not prompt */
#define SCP_HELP_ATTACH (1u << 29) /* Top level topic is ATTACH help */ #define SCP_HELP_ATTACH (1u << 29) /* Top level topic is ATTACH help */
t_stat scp_help (FILE *st, struct sim_device *dptr, t_stat scp_help (FILE *st, DEVICE *dptr,
struct sim_unit *uptr, int32 flag, const char *help, const char *cptr, ...); UNIT *uptr, int32 flag, const char *help, const char *cptr, ...);
t_stat scp_vhelp (FILE *st, struct sim_device *dptr, t_stat scp_vhelp (FILE *st, DEVICE *dptr,
struct sim_unit *uptr, int32 flag, const char *help, const char *cptr, va_list ap); UNIT *uptr, int32 flag, const char *help, const char *cptr, va_list ap);
t_stat scp_helpFromFile (FILE *st, struct sim_device *dptr, t_stat scp_helpFromFile (FILE *st, DEVICE *dptr,
struct sim_unit *uptr, int32 flag, const char *help, const char *cptr, ...); UNIT *uptr, int32 flag, const char *help, const char *cptr, ...);
t_stat scp_vhelpFromFile (FILE *st, struct sim_device *dptr, t_stat scp_vhelpFromFile (FILE *st, DEVICE *dptr,
struct sim_unit *uptr, int32 flag, const char *help, const char *cptr, va_list ap); UNIT *uptr, int32 flag, const char *help, const char *cptr, va_list ap);
/* Global data */ /* Global data */

View file

@ -145,20 +145,20 @@
* To make use of this type of help in your device, create (or replace) a help routine with one that * To make use of this type of help in your device, create (or replace) a help routine with one that
* calls scp_help. Most of the arguments are the same as those of the device help routine. * calls scp_help. Most of the arguments are the same as those of the device help routine.
* *
* t_stat scp_help (FILE *st, struct sim_device *dptr, * t_stat scp_help (FILE *st, DEVICE *dptr,
* struct sim_unit *uptr, int flag, const char *help, char *cptr, ...) * UNIT *uptr, int flag, const char *help, char *cptr, ...)
* *
* If you need to pass the variable argument list from another routine, use: * If you need to pass the variable argument list from another routine, use:
* *
* t_stat scp_vhelp (FILE *st, struct sim_device *dptr, * t_stat scp_vhelp (FILE *st, DEVICE *dptr,
* struct sim_unit *uptr, int flag, const char *help, char *cptr, va_list ap) * UNIT *uptr, int flag, const char *help, char *cptr, va_list ap)
* *
* To obtain the help from an external file (Note this reads the entire file into memory): * To obtain the help from an external file (Note this reads the entire file into memory):
* t_stat scp_helpFromFile (FILE *st, struct sim_device *dptr, * t_stat scp_helpFromFile (FILE *st, DEVICE *dptr,
* struct sim_unit *uptr, int flag, const char *helpfile, char *cptr, ...) * UNIT *uptr, int flag, const char *helpfile, char *cptr, ...)
* and for va_list: * and for va_list:
* t_stat scp_vhelpFromFile (FILE *st, struct sim_device *dptr, * t_stat scp_vhelpFromFile (FILE *st, DEVICE *dptr,
* struct sim_unit *uptr, int flag, const char *helpfile, char *cptr, va_list ap) { * UNIT *uptr, int flag, const char *helpfile, char *cptr, va_list ap) {
* *
* dptr and uptr are only used if the %D and/or %U escapes are encountered. * dptr and uptr are only used if the %D and/or %U escapes are encountered.
* help is the help text; helpfile is the help file name. * help is the help text; helpfile is the help file name.

View file

@ -377,44 +377,64 @@ typedef uint32 t_addr;
/* 2 - to not be a valid/possible pointer (alignment) */ /* 2 - to not be a valid/possible pointer (alignment) */
#define QUEUE_LIST_END ((UNIT *)1) #define QUEUE_LIST_END ((UNIT *)1)
/* Typedefs for principal structures */
typedef struct DEVICE DEVICE;
typedef struct UNIT UNIT;
typedef struct REG REG;
typedef struct CTAB CTAB;
typedef struct C1TAB C1TAB;
typedef struct SHTAB SHTAB;
typedef struct MTAB MTAB;
typedef struct SCHTAB SCHTAB;
typedef struct BRKTAB BRKTAB;
typedef struct EXPTAB EXPTAB;
typedef struct EXPECT EXPECT;
typedef struct SEND SEND;
typedef struct DEBTAB DEBTAB;
typedef struct FILEREF FILEREF;
typedef struct BITFIELD BITFIELD;
typedef t_stat (*ACTIVATE_API)(UNIT *unit, int32 interval);
/* Device data structure */ /* Device data structure */
struct sim_device { struct DEVICE {
const char *name; /* name */ const char *name; /* name */
struct sim_unit *units; /* units */ UNIT *units; /* units */
struct sim_reg *registers; /* registers */ REG *registers; /* registers */
struct sim_mtab *modifiers; /* modifiers */ MTAB *modifiers; /* modifiers */
uint32 numunits; /* #units */ uint32 numunits; /* #units */
uint32 aradix; /* address radix */ uint32 aradix; /* address radix */
uint32 awidth; /* address width */ uint32 awidth; /* address width */
uint32 aincr; /* addr increment */ uint32 aincr; /* addr increment */
uint32 dradix; /* data radix */ uint32 dradix; /* data radix */
uint32 dwidth; /* data width */ uint32 dwidth; /* data width */
t_stat (*examine)(t_value *v, t_addr a, struct sim_unit *up, t_stat (*examine)(t_value *v, t_addr a, UNIT *up,
int32 sw); /* examine routine */ int32 sw); /* examine routine */
t_stat (*deposit)(t_value v, t_addr a, struct sim_unit *up, t_stat (*deposit)(t_value v, t_addr a, UNIT *up,
int32 sw); /* deposit routine */ int32 sw); /* deposit routine */
t_stat (*reset)(struct sim_device *dp);/* reset routine */ t_stat (*reset)(DEVICE *dp); /* reset routine */
t_stat (*boot)(int32 u, struct sim_device *dp); t_stat (*boot)(int32 u, DEVICE *dp);
/* boot routine */ /* boot routine */
t_stat (*attach)(struct sim_unit *up, char *cp); t_stat (*attach)(UNIT *up, char *cp);
/* attach routine */ /* attach routine */
t_stat (*detach)(struct sim_unit *up); /* detach routine */ t_stat (*detach)(UNIT *up); /* detach routine */
void *ctxt; /* context */ void *ctxt; /* context */
uint32 flags; /* flags */ uint32 flags; /* flags */
uint32 dctrl; /* debug control */ uint32 dctrl; /* debug control */
struct sim_debtab *debflags; /* debug flags */ DEBTAB *debflags; /* debug flags */
t_stat (*msize)(struct sim_unit *up, int32 v, char *cp, void *dp); t_stat (*msize)(UNIT *up, int32 v, char *cp, void *dp);
/* mem size routine */ /* mem size routine */
char *lname; /* logical name */ char *lname; /* logical name */
t_stat (*help)(FILE *st, struct sim_device *dptr, t_stat (*help)(FILE *st, DEVICE *dptr,
struct sim_unit *uptr, int32 flag, const char *cptr); UNIT *uptr, int32 flag, const char *cptr);
/* help */ /* help */
t_stat (*attach_help)(FILE *st, struct sim_device *dptr, t_stat (*attach_help)(FILE *st, DEVICE *dptr,
struct sim_unit *uptr, int32 flag, const char *cptr); UNIT *uptr, int32 flag, const char *cptr);
/* attach help */ /* attach help */
void *help_ctx; /* Context available to help routines */ void *help_ctx; /* Context available to help routines */
const char *(*description)(struct sim_device *dptr); const char *(*description)(DEVICE *dptr);
/* Device Description */ /* Device Description */
}; };
@ -466,9 +486,9 @@ struct sim_device {
are for a typical sequential device. are for a typical sequential device.
*/ */
struct sim_unit { struct UNIT {
struct sim_unit *next; /* next active */ UNIT *next; /* next active */
t_stat (*action)(struct sim_unit *up); /* action routine */ t_stat (*action)(UNIT *up); /* action routine */
char *filename; /* open file name */ char *filename; /* open file name */
FILE *fileref; /* file reference */ FILE *fileref; /* file reference */
void *filebuf; /* memory buffer */ void *filebuf; /* memory buffer */
@ -478,7 +498,7 @@ struct sim_unit {
uint32 dynflags; /* dynamic flags */ uint32 dynflags; /* dynamic flags */
t_addr capac; /* capacity */ t_addr capac; /* capacity */
t_addr pos; /* file position */ t_addr pos; /* file position */
void (*io_flush)(struct sim_unit *up);/* io flush routine */ void (*io_flush)(UNIT *up); /* io flush routine */
uint32 iostarttime; /* I/O start time */ uint32 iostarttime; /* I/O start time */
int32 buf; /* buffer */ int32 buf; /* buffer */
int32 wait; /* wait */ int32 wait; /* wait */
@ -490,12 +510,12 @@ struct sim_unit {
void *up8; /* device specific */ void *up8; /* device specific */
void *tmxr; /* TMXR linkage */ void *tmxr; /* TMXR linkage */
#ifdef SIM_ASYNCH_IO #ifdef SIM_ASYNCH_IO
void (*a_check_completion)(struct sim_unit *); void (*a_check_completion)(UNIT *);
t_bool (*a_is_active)(struct sim_unit *); t_bool (*a_is_active)(UNIT *);
void (*a_cancel)(struct sim_unit *); void (*a_cancel)(UNIT *);
struct sim_unit *a_next; /* next asynch active */ UNIT *a_next; /* next asynch active */
int32 a_event_time; int32 a_event_time;
t_stat (*a_activate_call)(struct sim_unit *, int32); ACTIVATE_API a_activate_call;
/* Asynchronous Polling control */ /* Asynchronous Polling control */
/* These fields should only be referenced when holding the sim_tmxr_poll_lock */ /* These fields should only be referenced when holding the sim_tmxr_poll_lock */
t_bool a_polling_now; /* polling active flag */ t_bool a_polling_now; /* polling active flag */
@ -547,7 +567,7 @@ struct sim_unit {
#define UNIT_V_DF_TAPE 4 /* Bit offset for Tape Density reservation */ #define UNIT_V_DF_TAPE 4 /* Bit offset for Tape Density reservation */
#define UNIT_S_DF_TAPE 3 /* Bits Reserved for Tape Density */ #define UNIT_S_DF_TAPE 3 /* Bits Reserved for Tape Density */
struct sim_bitfield { struct BITFIELD {
const char *name; /* field name */ const char *name; /* field name */
uint32 offset; /* starting bit */ uint32 offset; /* starting bit */
uint32 width; /* width */ uint32 width; /* width */
@ -557,7 +577,7 @@ struct sim_bitfield {
/* Register data structure */ /* Register data structure */
struct sim_reg { struct REG {
const char *name; /* name */ const char *name; /* name */
void *loc; /* location */ void *loc; /* location */
uint32 radix; /* radix */ uint32 radix; /* radix */
@ -565,7 +585,7 @@ struct sim_reg {
uint32 offset; /* starting bit */ uint32 offset; /* starting bit */
uint32 depth; /* save depth */ uint32 depth; /* save depth */
const char *desc; /* description */ const char *desc; /* description */
struct sim_bitfield *fields; /* bit fields */ BITFIELD *fields; /* bit fields */
uint32 flags; /* flags */ uint32 flags; /* flags */
uint32 qptr; /* circ q ptr */ uint32 qptr; /* circ q ptr */
}; };
@ -589,7 +609,7 @@ struct sim_reg {
/* Command tables, base and alternate formats */ /* Command tables, base and alternate formats */
struct sim_ctab { struct CTAB {
const char *name; /* name */ const char *name; /* name */
t_stat (*action)(int32 flag, char *cptr); t_stat (*action)(int32 flag, char *cptr);
/* action routine */ /* action routine */
@ -600,32 +620,32 @@ struct sim_ctab {
/* message printing routine */ /* message printing routine */
}; };
struct sim_c1tab { struct C1TAB {
const char *name; /* name */ const char *name; /* name */
t_stat (*action)(struct sim_device *dptr, struct sim_unit *uptr, t_stat (*action)(DEVICE *dptr, UNIT *uptr,
int32 flag, char *cptr); /* action routine */ int32 flag, char *cptr); /* action routine */
int32 arg; /* argument */ int32 arg; /* argument */
const char *help; /* help string */ const char *help; /* help string */
}; };
struct sim_shtab { struct SHTAB {
const char *name; /* name */ const char *name; /* name */
t_stat (*action)(FILE *st, struct sim_device *dptr, t_stat (*action)(FILE *st, DEVICE *dptr,
struct sim_unit *uptr, int32 flag, char *cptr); UNIT *uptr, int32 flag, char *cptr);
int32 arg; /* argument */ int32 arg; /* argument */
const char *help; /* help string */ const char *help; /* help string */
}; };
/* Modifier table - only extended entries have disp, reg, or flags */ /* Modifier table - only extended entries have disp, reg, or flags */
struct sim_mtab { struct MTAB {
uint32 mask; /* mask */ uint32 mask; /* mask */
uint32 match; /* match */ uint32 match; /* match */
const char *pstring; /* print string */ const char *pstring; /* print string */
const char *mstring; /* match string */ const char *mstring; /* match string */
t_stat (*valid)(struct sim_unit *up, int32 v, char *cp, void *dp); t_stat (*valid)(UNIT *up, int32 v, char *cp, void *dp);
/* validation routine */ /* validation routine */
t_stat (*disp)(FILE *st, struct sim_unit *up, int32 v, void *dp); t_stat (*disp)(FILE *st, UNIT *up, int32 v, void *dp);
/* display routine */ /* display routine */
void *desc; /* value descriptor */ void *desc; /* value descriptor */
/* REG * if MTAB_VAL */ /* REG * if MTAB_VAL */
@ -649,7 +669,7 @@ struct sim_mtab {
/* Search table */ /* Search table */
struct sim_schtab { struct SCHTAB {
int32 logic; /* logical operator */ int32 logic; /* logical operator */
int32 boolop; /* boolean operator */ int32 boolop; /* boolean operator */
uint32 count; /* value count in mask and comp arrays */ uint32 count; /* value count in mask and comp arrays */
@ -659,7 +679,7 @@ struct sim_schtab {
/* Breakpoint table */ /* Breakpoint table */
struct sim_brktab { struct BRKTAB {
t_addr addr; /* address */ t_addr addr; /* address */
uint32 typ; /* mask of types */ uint32 typ; /* mask of types */
#define BRK_TYP_DYN_STEPOVER (SWMASK ('Z'+1)) #define BRK_TYP_DYN_STEPOVER (SWMASK ('Z'+1))
@ -671,7 +691,7 @@ struct sim_brktab {
/* Expect rule */ /* Expect rule */
struct sim_exptab { struct EXPTAB {
uint8 *match; /* match string */ uint8 *match; /* match string */
uint32 size; /* match string size */ uint32 size; /* match string size */
char *match_pattern; /* match pattern for format */ char *match_pattern; /* match pattern for format */
@ -690,10 +710,10 @@ struct sim_exptab {
/* Expect Context */ /* Expect Context */
struct sim_expect { struct EXPECT {
struct sim_device *dptr; /* Device (for Debug) */ DEVICE *dptr; /* Device (for Debug) */
uint32 dbit; /* Debugging Bit */ uint32 dbit; /* Debugging Bit */
struct sim_exptab *rules; /* match rules */ EXPTAB *rules; /* match rules */
int32 size; /* count of match rules */ int32 size; /* count of match rules */
uint32 after; /* delay before halting */ uint32 after; /* delay before halting */
uint8 *buf; /* buffer of output data which has produced */ uint8 *buf; /* buffer of output data which has produced */
@ -703,10 +723,10 @@ struct sim_expect {
/* Send Context */ /* Send Context */
struct sim_send { struct SEND {
uint32 delay; /* instruction delay between sent data */ uint32 delay; /* instruction delay between sent data */
#define SEND_DEFAULT_DELAY 1000 /* default delay instruction count */ #define SEND_DEFAULT_DELAY 1000 /* default delay instruction count */
struct sim_device *dptr; /* Device (for Debug) */ DEVICE *dptr; /* Device (for Debug) */
uint32 dbit; /* Debugging Bit */ uint32 dbit; /* Debugging Bit */
uint32 after; /* instruction delay before sending any data */ uint32 after; /* instruction delay before sending any data */
double next_time; /* execution time when next data can be sent */ double next_time; /* execution time when next data can be sent */
@ -718,7 +738,7 @@ struct sim_send {
/* Debug table */ /* Debug table */
struct sim_debtab { struct DEBTAB {
const char *name; /* control name */ const char *name; /* control name */
uint32 mask; /* control bit */ uint32 mask; /* control bit */
const char *desc; /* description */ const char *desc; /* description */
@ -736,7 +756,7 @@ struct sim_debtab {
#define SIM_DBG_AIO_QUEUE 0x40000 #define SIM_DBG_AIO_QUEUE 0x40000
/* File Reference */ /* File Reference */
struct sim_fileref { struct FILEREF {
char name[CBUFSIZE]; /* file name */ char name[CBUFSIZE]; /* file name */
FILE *file; /* file handle */ FILE *file; /* file handle */
int32 refcount; /* reference count */ int32 refcount; /* reference count */
@ -820,23 +840,6 @@ struct sim_fileref {
#endif #endif
#define ENDBITS {NULL} /* end of bitfield list */ #define ENDBITS {NULL} /* end of bitfield list */
/* Typedefs for principal structures */
typedef struct sim_device DEVICE;
typedef struct sim_unit UNIT;
typedef struct sim_reg REG;
typedef struct sim_ctab CTAB;
typedef struct sim_c1tab C1TAB;
typedef struct sim_shtab SHTAB;
typedef struct sim_mtab MTAB;
typedef struct sim_schtab SCHTAB;
typedef struct sim_brktab BRKTAB;
typedef struct sim_exptab EXPTAB;
typedef struct sim_expect EXPECT;
typedef struct sim_send SEND;
typedef struct sim_debtab DEBTAB;
typedef struct sim_fileref FILEREF;
typedef struct sim_bitfield BITFIELD;
/* Function prototypes */ /* Function prototypes */
@ -1184,7 +1187,7 @@ extern int32 sim_asynch_inst_latency;
} else { \ } else { \
UNIT *q, *qe; \ UNIT *q, *qe; \
ouptr->a_event_time = event_time; \ ouptr->a_event_time = event_time; \
ouptr->a_activate_call = caller; \ ouptr->a_activate_call = (ACTIVATE_API)&caller; \
ouptr->a_next = QUEUE_LIST_END; /* Mark as on list */ \ ouptr->a_next = QUEUE_LIST_END; /* Mark as on list */ \
do { \ do { \
do \ do \
@ -1211,11 +1214,11 @@ extern int32 sim_asynch_inst_latency;
sim_debug (SIM_DBG_AIO_QUEUE, sim_dflt_dev, "Queueing Asynch events for %s after %d instructions\n", sim_uname(list), event_time);\ sim_debug (SIM_DBG_AIO_QUEUE, sim_dflt_dev, "Queueing Asynch events for %s after %d instructions\n", sim_uname(list), event_time);\
for (qe=(list); qe->a_next != QUEUE_LIST_END;) { \ for (qe=(list); qe->a_next != QUEUE_LIST_END;) { \
qe->a_event_time = event_time; \ qe->a_event_time = event_time; \
qe->a_activate_call = caller; \ qe->a_activate_call = (ACTIVATE_API)&caller; \
qe = qe->a_next; \ qe = qe->a_next; \
} \ } \
qe->a_event_time = event_time; \ qe->a_event_time = event_time; \
qe->a_activate_call = caller; \ qe->a_activate_call = (ACTIVATE_API)&caller; \
ouptr = (list); \ ouptr = (list); \
do { \ do { \
do \ do \
@ -1307,7 +1310,7 @@ extern int32 sim_asynch_inst_latency;
} else { \ } else { \
uptr->a_next = sim_asynch_queue; \ uptr->a_next = sim_asynch_queue; \
uptr->a_event_time = event_time; \ uptr->a_event_time = event_time; \
uptr->a_activate_call = caller; \ uptr->a_activate_call = (ACTIVATE_API)&caller; \
sim_asynch_queue = uptr; \ sim_asynch_queue = uptr; \
} \ } \
if (sim_idle_wait) { \ if (sim_idle_wait) { \
@ -1324,11 +1327,11 @@ extern int32 sim_asynch_inst_latency;
sim_debug (SIM_DBG_AIO_QUEUE, sim_dflt_dev, "Queueing Asynch events for %s after %d instructions\n", sim_uname(list), event_time);\ sim_debug (SIM_DBG_AIO_QUEUE, sim_dflt_dev, "Queueing Asynch events for %s after %d instructions\n", sim_uname(list), event_time);\
for (qe=list; qe->a_next != QUEUE_LIST_END;) { \ for (qe=list; qe->a_next != QUEUE_LIST_END;) { \
qe->a_event_time = event_time; \ qe->a_event_time = event_time; \
qe->a_activate_call = caller; \ qe->a_activate_call = (ACTIVATE_API)&caller; \
qe = qe->a_next; \ qe = qe->a_next; \
} \ } \
qe->a_event_time = event_time; \ qe->a_event_time = event_time; \
qe->a_activate_call = caller; \ qe->a_activate_call = (ACTIVATE_API)&caller; \
AIO_LOCK; \ AIO_LOCK; \
qe->a_next = sim_asynch_queue; \ qe->a_next = sim_asynch_queue; \
sim_asynch_queue = list; \ sim_asynch_queue = list; \

View file

@ -1440,7 +1440,7 @@ if (sim_asynch_enabled && sim_asynch_timer)
sim_start_timer_services (); sim_start_timer_services ();
else { else {
UNIT *uptr; UNIT *uptr;
int32 accum = 0; uint32 accum = 0;
sim_stop_timer_services (); sim_stop_timer_services ();
while (1) { while (1) {
@ -1475,7 +1475,7 @@ if (0 == inst_per_sec)
return inst_per_sec; return inst_per_sec;
} }
t_stat sim_timer_activate_after (UNIT *uptr, int32 usec_delay) t_stat sim_timer_activate_after (UNIT *uptr, uint32 usec_delay)
{ {
int inst_delay; int inst_delay;
double inst_delay_d, inst_per_sec; double inst_delay_d, inst_per_sec;

View file

@ -120,7 +120,7 @@ uint32 sim_os_ms_sleep_init (void);
void sim_start_timer_services (void); void sim_start_timer_services (void);
void sim_stop_timer_services (void); void sim_stop_timer_services (void);
t_stat sim_timer_change_asynch (void); t_stat sim_timer_change_asynch (void);
t_stat sim_timer_activate_after (UNIT *uptr, int32 usec_delay); t_stat sim_timer_activate_after (UNIT *uptr, uint32 usec_delay);
t_stat sim_register_clock_unit (UNIT *uptr); t_stat sim_register_clock_unit (UNIT *uptr);
t_stat sim_clock_coschedule (UNIT *uptr, int32 interval); t_stat sim_clock_coschedule (UNIT *uptr, int32 interval);
t_stat sim_clock_coschedule_abs (UNIT *uptr, int32 interval); t_stat sim_clock_coschedule_abs (UNIT *uptr, int32 interval);

View file

@ -3744,7 +3744,7 @@ return _sim_activate (uptr, interval);
#endif #endif
} }
t_stat tmxr_activate_after (UNIT *uptr, int32 usecs_walltime) t_stat tmxr_activate_after (UNIT *uptr, uint32 usecs_walltime)
{ {
#if defined(SIM_ASYNCH_IO) && defined(SIM_ASYNCH_MUX) #if defined(SIM_ASYNCH_IO) && defined(SIM_ASYNCH_MUX)
if ((!(uptr->dynflags & UNIT_TM_POLL)) || if ((!(uptr->dynflags & UNIT_TM_POLL)) ||
@ -3757,7 +3757,7 @@ return _sim_activate_after (uptr, usecs_walltime);
#endif #endif
} }
t_stat tmxr_activate_after_abs (UNIT *uptr, int32 usecs_walltime) t_stat tmxr_activate_after_abs (UNIT *uptr, uint32 usecs_walltime)
{ {
#if defined(SIM_ASYNCH_IO) && defined(SIM_ASYNCH_MUX) #if defined(SIM_ASYNCH_IO) && defined(SIM_ASYNCH_MUX)
if ((!(uptr->dynflags & UNIT_TM_POLL)) || if ((!(uptr->dynflags & UNIT_TM_POLL)) ||

View file

@ -272,8 +272,8 @@ t_stat tmxr_show_cstat (FILE *st, UNIT *uptr, int32 val, void *desc);
t_stat tmxr_show_lines (FILE *st, UNIT *uptr, int32 val, void *desc); t_stat tmxr_show_lines (FILE *st, UNIT *uptr, int32 val, void *desc);
t_stat tmxr_show_open_devices (FILE* st, DEVICE *dptr, UNIT* uptr, int32 val, char* desc); t_stat tmxr_show_open_devices (FILE* st, DEVICE *dptr, UNIT* uptr, int32 val, char* desc);
t_stat tmxr_activate (UNIT *uptr, int32 interval); t_stat tmxr_activate (UNIT *uptr, int32 interval);
t_stat tmxr_activate_after (UNIT *uptr, int32 usecs_walltime); t_stat tmxr_activate_after (UNIT *uptr, uint32 usecs_walltime);
t_stat tmxr_activate_after_abs (UNIT *uptr, int32 usecs_walltime); t_stat tmxr_activate_after_abs (UNIT *uptr, uint32 usecs_walltime);
t_stat tmxr_clock_coschedule (UNIT *uptr, int32 interval); t_stat tmxr_clock_coschedule (UNIT *uptr, int32 interval);
t_stat tmxr_clock_coschedule_abs (UNIT *uptr, int32 interval); t_stat tmxr_clock_coschedule_abs (UNIT *uptr, int32 interval);
t_stat tmxr_clock_coschedule_tmr (UNIT *uptr, int32 tmr, int32 interval); t_stat tmxr_clock_coschedule_tmr (UNIT *uptr, int32 tmr, int32 interval);