Skip to content

Commit

Permalink
VAX: Allow SET CPU IDLE command to not specify a stability value.
Browse files Browse the repository at this point in the history
Report invalid stability values and explain why they're invalid.

Fixes #281
  • Loading branch information
markpizz committed Feb 26, 2016
1 parent 9a7c46f commit c8cd853
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
4 changes: 2 additions & 2 deletions VAX/vax_cpu.c
Expand Up @@ -3719,8 +3719,8 @@ fprintf (st, "detection is operating system specific. If idle detection is enab
fprintf (st, "an incorrect operating system setting, simulator performance or correct\n");
fprintf (st, "functionality could be impacted. The default operating system setting is\n");
fprintf (st, "VMS. The value 'n', if present in the \"SET CPU IDLE={OS}:n\" command,\n");
fprintf (st, "indicated the number of seconds which the simulator must run before idling\n");
fprintf (st, "(and clock calibration) starts.\n\n");
fprintf (st, "indicats the number of seconds which the simulator must run before idling\n");
fprintf (st, "starts.\n\n");
fprintf (st, "The CPU can maintain a history of the most recently executed instructions.\n");
fprintf (st, "This is controlled by the SET CPU HISTORY and SHOW CPU HISTORY commands:\n\n");
fprintf (st, " sim> SET CPU HISTORY clear history buffer\n");
Expand Down
Binary file modified doc/vax780_doc.doc
Binary file not shown.
Binary file modified doc/vax_doc.doc
Binary file not shown.
16 changes: 6 additions & 10 deletions sim_timer.c
Expand Up @@ -1004,18 +1004,14 @@ t_stat sim_set_idle (UNIT *uptr, int32 val, char *cptr, void *desc)
t_stat r;
uint32 v;

if (sim_idle_rate_ms == 0) {
sim_printf ("Idling is not available, Minimum OS sleep time is %dms\n", sim_os_sleep_min_ms);
return SCPE_NOFNC;
}
if ((val != 0) && (sim_idle_rate_ms > (uint32) val)) {
sim_printf ("Idling is not available, Minimum OS sleep time is %dms, Requied minimum OS sleep is %dms\n", sim_os_sleep_min_ms, val);
return SCPE_NOFNC;
}
if (cptr) {
if (sim_idle_rate_ms == 0)
return sim_messagef (SCPE_NOFNC, "Idling is not available, Minimum OS sleep time is %dms\n", sim_os_sleep_min_ms);
if ((val != 0) && (sim_idle_rate_ms > (uint32) val))
return sim_messagef (SCPE_NOFNC, "Idling is not available, Minimum OS sleep time is %dms, Requied minimum OS sleep is %dms\n", sim_os_sleep_min_ms, val);
if (cptr && *cptr) {
v = (uint32) get_uint (cptr, 10, SIM_IDLE_STMAX, &r);
if ((r != SCPE_OK) || (v < SIM_IDLE_STMIN))
return SCPE_ARG;
return sim_messagef (SCPE_ARG, "Invalid Stability value: %s. Valid values range from %d to %d.\n", cptr, SIM_IDLE_STMIN, SIM_IDLE_STMAX);
sim_idle_stable = v;
}
sim_idle_enab = TRUE;
Expand Down

0 comments on commit c8cd853

Please sign in to comment.