1
0
mirror of https://github.com/simh/simh.git synced 2026-04-25 11:41:25 +00:00

TMXR: Reworked output to physical Serial ports for VMS and Windows hosts

The goal being to have output to physical serial ports complete without host
OS level buffering so that what is transmitted via the serial port has correct
timing with respect to I/O completion status within a simulator.

Linux, OS X, and various other *nix host platforms still need work here.
This commit is contained in:
Mark Pizzolato
2016-07-14 13:53:41 -07:00
parent 83bf230a47
commit c3496e4aa6
3 changed files with 148 additions and 91 deletions

View File

@@ -34,6 +34,11 @@
extern "C" {
#endif
#ifndef SIMH_SERHANDLE_DEFINED
#define SIMH_SERHANDLE_DEFINED 0
typedef struct SERPORT *SERHANDLE;
#endif /* SERHANDLE_DEFINED */
#if defined (_WIN32) /* Windows definitions */
/* We need the basic Win32 definitions, but including "windows.h" also includes
@@ -47,7 +52,7 @@ extern "C" {
#endif
#include <windows.h>
#if !defined(INVALID_HANDLE)
#define INVALID_HANDLE INVALID_HANDLE_VALUE
#define INVALID_HANDLE (SERHANDLE)INVALID_HANDLE_VALUE
#endif /* !defined(INVALID_HANDLE) */
#elif defined (__unix__) || defined (__APPLE__) || defined (__hpux) /* UNIX definitions */
@@ -61,31 +66,22 @@ extern "C" {
#include <sys/ioctl.h>
#if !defined(INVALID_HANDLE)
#define INVALID_HANDLE -1
#define INVALID_HANDLE ((SERHANDLE)(void *)-1)
#endif /* !defined(INVALID_HANDLE) */
#elif defined (VMS) /* VMS definitions */
#if !defined(INVALID_HANDLE)
#define INVALID_HANDLE (uint32)(-1)
#define INVALID_HANDLE ((SERHANDLE)(void *)-1)
#endif /* !defined(INVALID_HANDLE) */
#else /* Non-implemented definitions */
#if !defined(INVALID_HANDLE)
#define INVALID_HANDLE -1
#define INVALID_HANDLE ((SERHANDLE)(void *)-1)
#endif /* !defined(INVALID_HANDLE) */
#endif /* OS variants */
#ifndef SIMH_SERHANDLE_DEFINED
#define SIMH_SERHANDLE_DEFINED 0
#if defined (_WIN32) /* Windows definitions */
typedef void *SERHANDLE;
#else /* all other platforms */
typedef int SERHANDLE;
#endif
#endif /* SERHANDLE_DEFINED */
/* Common definitions */