scp.c, scp.h - Change the sim_clock_queue event list to be terminated by the value QUEUE_LIST_END instead of NULL. This allows easy determination of whether a unit is on a list since when it is not on a list the next pointer is NULL. - standardized the usage of UPDATE_SIM_TIME - Added support for internal/pseudo devices to support the TIMER and CON-TEL pseudo devices (to enable and disable debugging) - Reverted to the prior "SET CONSOLE DEBUG" command semantics since the console debug can be manipulated via the generic "SET <dev> DEBUG" command (i.e. SET CON-TEL DEBUG=TRC;XMT;RCV) - Changed "SHOW TIMERS" to "SHOW CLOCKS" to display the current calibrated timer information - Added sim_is_active_bool API to return the boolean active status avoiding the potential work walking the list when most callers aren't interested in the event firing time - Fixed run_boot_prep to properly record the not queued status of any units which are removed from the sim_clock_queue during initialization - Added display of DEBUG, NODEBUG options to the SHOW SHOW command sim_timer.c, sim_timer.h - Added asynchronous timer capabilities with support for calibration and idling - Added internal/pseudo device to support debugging of Idle, Calibration and asynch timer activites. - Added suppression of timer calibration when idling has occurred sim_tmxr.c, sim_tmxr.h - Added tmxr_activate_after and macro definition for sim_activate_after to invoke it for proper behavior with multiplexer devices - Added all polling units to the standard timer queue when dropping back to the simulator command prompt to accommodate the potential to disable asynch mode - Fixed synchronization to operate with pthread synchronized asynch queue and proper stopping of poll when dropping back to the simulator command prompt - Fixed calls to select to have a timeout with properly ranged tv_usec values and dealt with possible EINTR return from select sim_console.c, sim_console.h - Changed internal/pseudo console telnet device name to CON=TEL - Reverted to the prior "SET CONSOLE DEBUG" command semantics since the console debug can be manipulated via the generic "SET <dev> DEBUG" command (i.e. SET CON-TEL DEBUG=TRC;XMT;RCV) - Fixed synchronization to operate with pthread synchronized asynch queue and proper stopping of poll when dropping back to the simulator command prompt - Fixed calls to select to have a timeout with properly ranged tv_usec values sim_defs.h - Added necessary unit fields to support asynchronous timing activities - Added asynchronous macros to support async timing activities - Fixed asynch pthread only macros (not using AIO_INTRINSICS). - Fixed the definition of the UDATA macro which was never adjusted to accommodate the insertion of 2 extra fields in the unit structure and thus made the initialization of the unit wait field meaningless. - Changed the NOQUEUE_WAIT value from 10000 to 1000000. This is only used when the sim_clock_queue is empty, which normally never happens on any simulator since they all have clocks and/or other frequently polling devices. With asynchronous multiplexer and timing support the queue is often empty and this value is then used when calculating idling delays. If it is too small, idling will be inefficient. Being large should not be a problem otherwise. Interdata/id16_cpu.c - removed test of sim_idle_enab before calling sim_idle Interdata/id32_cpu.c - removed test of sim_idle_enab before calling sim_idle vax/vax_cpu.c - removed test of sim_idle_enab before calling sim_idle vax/vax_stddev.c - converted CLK device to use the internal timer service API sim_activate_after to leverage asynchronous timing when available
95 lines
4.6 KiB
C
95 lines
4.6 KiB
C
/* sim_console.h: simulator console I/O library headers
|
|
|
|
Copyright (c) 1993-2008, Robert M Supnik
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a
|
|
copy of this software and associated documentation files (the "Software"),
|
|
to deal in the Software without restriction, including without limitation
|
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
and/or sell copies of the Software, and to permit persons to whom the
|
|
Software is furnished to do so, subject to the following conditions:
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
all copies or substantial portions of the Software.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
ROBERT M SUPNIK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
Except as contained in this notice, the name of Robert M Supnik shall not be
|
|
used in advertising or otherwise to promote the sale, use or other dealings
|
|
in this Software without prior written authorization from Robert M Supnik.
|
|
|
|
17-Jan-11 MP Added buffered line capabilities
|
|
22-Jun-06 RMS Implemented SET/SHOW PCHAR
|
|
22-Nov-05 RMS Added central input/output conversion support
|
|
05-Nov-04 RMS Moved SET/SHOW DEBUG under CONSOLE hierarchy
|
|
28-May-04 RMS Added SET/SHOW CONSOLE
|
|
02-Jan-04 RMS Removed timer routines, added Telnet console routines
|
|
*/
|
|
|
|
#ifndef _SIM_CONSOLE_H_
|
|
#define _SIM_CONSOLE_H_ 0
|
|
|
|
#define TTUF_V_MODE (UNIT_V_UF + 0)
|
|
#define TTUF_W_MODE 2
|
|
#define TTUF_MODE_7B 0
|
|
#define TTUF_MODE_8B 1
|
|
#define TTUF_MODE_UC 2
|
|
#define TTUF_MODE_7P 3
|
|
#define TTUF_KSR (1u << TTUF_W_MODE)
|
|
#define TTUF_M_MODE ((1u << TTUF_W_MODE) - 1)
|
|
#define TTUF_V_UF (TTUF_V_MODE + TTUF_W_MODE)
|
|
#define TT_MODE (TTUF_M_MODE << TTUF_V_MODE)
|
|
#define TT_MODE_7B (TTUF_MODE_7B << TTUF_V_MODE)
|
|
#define TT_MODE_8B (TTUF_MODE_8B << TTUF_V_MODE)
|
|
#define TT_MODE_UC (TTUF_MODE_UC << TTUF_V_MODE)
|
|
#define TT_MODE_7P (TTUF_MODE_7P << TTUF_V_MODE)
|
|
#define TT_MODE_KSR (TT_MODE_UC)
|
|
#define TT_GET_MODE(x) (((x) >> TTUF_V_MODE) & TTUF_M_MODE)
|
|
|
|
t_stat sim_set_console (int32 flag, char *cptr);
|
|
t_stat sim_set_kmap (int32 flag, char *cptr);
|
|
t_stat sim_set_telnet (int32 flag, char *cptr);
|
|
t_stat sim_set_notelnet (int32 flag, char *cptr);
|
|
t_stat sim_set_logon (int32 flag, char *cptr);
|
|
t_stat sim_set_logoff (int32 flag, char *cptr);
|
|
t_stat sim_set_debon (int32 flag, char *cptr);
|
|
t_stat sim_set_cons_debug (int32 flg, char *cptr);
|
|
t_stat sim_set_cons_nodebug (int32 flg, char *cptr);
|
|
t_stat sim_set_cons_buff (int32 flg, char *cptr);
|
|
t_stat sim_set_cons_unbuff (int32 flg, char *cptr);
|
|
t_stat sim_set_cons_log (int32 flg, char *cptr);
|
|
t_stat sim_set_cons_nolog (int32 flg, char *cptr);
|
|
t_stat sim_set_deboff (int32 flag, char *cptr);
|
|
t_stat sim_set_pchar (int32 flag, char *cptr);
|
|
t_stat sim_set_console_units (UNIT *rxuptr, UNIT *txuptr);
|
|
t_stat sim_show_console (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, char *cptr);
|
|
t_stat sim_show_kmap (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, char *cptr);
|
|
t_stat sim_show_telnet (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, char *cptr);
|
|
t_stat sim_show_log (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, char *cptr);
|
|
t_stat sim_show_debug (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, char *cptr);
|
|
t_stat sim_show_pchar (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, char *cptr);
|
|
t_stat sim_show_cons_debug (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, char *cptr);
|
|
t_stat sim_show_cons_buff (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, char *cptr);
|
|
t_stat sim_show_cons_log (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, char *cptr);
|
|
t_stat sim_check_console (int32 sec);
|
|
t_stat sim_open_logfile (char *filename, t_bool binary, FILE **pf, FILEREF **pref);
|
|
t_stat sim_close_logfile (FILEREF **pref);
|
|
const char *sim_logfile_name (FILE *st, FILEREF *ref);
|
|
t_stat sim_poll_kbd (void);
|
|
t_stat sim_putchar (int32 c);
|
|
t_stat sim_putchar_s (int32 c);
|
|
t_stat sim_ttinit (void);
|
|
t_stat sim_ttrun (void);
|
|
t_stat sim_ttcmd (void);
|
|
t_stat sim_ttclose (void);
|
|
t_bool sim_ttisatty (void);
|
|
t_stat sim_os_poll_kbd (void);
|
|
int32 sim_tt_inpcvt (int32 c, uint32 mode);
|
|
int32 sim_tt_outcvt (int32 c, uint32 mode);
|
|
|
|
#endif
|