Reworked all priority adjustment code to leverage a new
sim_os_set_thread_priority API which is coded to use pthreads or OS
priority adjustment APIs as necessary.
Compilation under Cygwin with gcc 5.3.0 - missing const gave rise to
incompatible pointer type warning, and _eth_get_system_id for _WIN32
was included under a conditional for either _WIN32 or __CYGWIN__
and later redefined for !_WIN32
sim> SET XQ MAC=aa:bb:cc:dd:ee:ff{/bits}{>filespec}
where:
- all of the aa:bb:cc:dd:ee:ff values must be hex digits
- bits is the number of bits which are to be taken from the supplied
MAC aa:bb:cc:dd:ee:ff with legal values from 16 to 48 and a default
of 48 bits.
- filespec specifies a file which contains the MAC address to be used
and if it doesn't exist an appropriate generated address will be stored
in this file and a subsequent SET MAC invocation specifying the same
file will use the value stored in the file rather than generating a new
MAC.
As discussed in #317
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 should work on all byte addressable host systems using GCC/clang to build.
The QEMU slirp code has been pried out of QEMU and stubs have been created to solve where the current slirp is entangled with the QEMU code. Ths slirp/simh directory contains all the necessary include and glue files to make this useful. Everything in the slirp directory is unmodified QEMU code.
Cleanup/Simplification by:
1) removing irrelevant master flag variable from sim_close_sock and thus sim_err_sock
2) change previous boolean feature arguments (datagram, nodelay, reuseaddr) to flag bits in a single option argument. This allows for features to be added by new flag bits which don't change the calling signatures.
3) changed all status returns to be int (vs t_stat) with success being 0 and error being -1
4) removed unneeded simh specific type references to allow sim_sock to be used by n
Extended API by providing flags to influence socket setup/behavior:
SIM_SOCK_OPT_REUSEADDR Retains prior behavior when sim_switches had -U set
SIM_SOCK_OPT_DATAGRAM UDP socket setup provided for when prior datagram argument was specified
SIM_SOCK_OPT_NODELAY TCP Nagle disable provided for when prior nodelay argument was specified
SIM_SOCK_OPT_BLOCKING Blocking socket mode (detault is non blocking)
Avoid permanent network network hangs when a network transport starts to return errors for various reasons.
These hangs also result in at least one thread in a CPU bound loop attempting to read on a pcap connection which will never be useful again.
When transmit or receive errors occur, the invoking thread sleeps for 1 second and subsequent operations proceed. When the total of read + write errors reaches a multiple of ETH_ERROR_REOPEN_THRESHOLD the current transport connection (usually pcap) is closed and re-opened after a ETH_ERROR_REOPEN_PAUSE second delay. If the open succeeds, we're happy. If it fails, then the link behaves as if it were never attached until some subsequent operator intervention is performed.
Activities which are known to induce this problems include (but are not limited to) when a simulator is running in a Windows Virtual Machine on a Hyper-V host system and the Hyper-V host system performs a SAVE and a subsequent Restart of the Guest Windows Virtual Machine. This operation can occur due to specific operator requests or merely when the Hyper-V host system reboots.
Migrated the XQ help to the hierarchical help model. This is a work in progress which will eventually merge much from 0readme_ethernet.txt into the device help.
Some of this behavior was previously available in the pdp11_xq simulation for the DELQA device variants, but not the DEQNA. This adds the behavior for all ethernet devices.
The helps to avoid MAC address conflicts since the Ethernet physical address is completely user settable, and starts with a static value. Multiple simulators on the same LAN will have conflicting addresses if they don't specifically set unique values.
The goals here being to simplify calling code while getting consistent output delivered everywhere it may be useful.
Modified most places which explicitly used sim_log or merely called printf to now avoid doing that and merely call sim_printf().