From 8bdbfdd8e03f44572e683d221dd40ca81b0ed852 Mon Sep 17 00:00:00 2001 From: Duncan Coutts Date: Sun, 3 Jan 2021 14:50:58 +0000 Subject: Rename includes/rts/IOManager.h to IOInterface.h Naming is hard. Where we want to get to is to have a clear internal and external API for the IO manager within the RTS. What we have right now is just the external API (used in base for the Haskell side of the threaded IO manager impls) living in includes/rts/IOManager.h. We want to add a clear RTS internal API, which really ought to live in rts/IOManager.h. Several people think it's too confusing to have both: * includes/rts/IOManager.h for the external API * rts/IOManager.h for the internal API So the plan is to add rts/IOManager.{h,c} as the internal parts, and rename the external part to be includes/rts/IOInterface.h. It is admittidly not great to have .h files in includes/rts/ called "interface" since by definition, every .h fle under includes/ is an interface! Alternative naming scheme suggestions welcome! --- includes/Rts.h | 2 +- includes/rts/IOInterface.h | 50 ++++++++++++++++++++++++++++++++++++++++++++++ includes/rts/IOManager.h | 50 ---------------------------------------------- 3 files changed, 51 insertions(+), 51 deletions(-) create mode 100644 includes/rts/IOInterface.h delete mode 100644 includes/rts/IOManager.h (limited to 'includes') diff --git a/includes/Rts.h b/includes/Rts.h index fc69a964e3..e093a4bcde 100644 --- a/includes/Rts.h +++ b/includes/Rts.h @@ -230,7 +230,7 @@ void _assertFail(const char *filename, unsigned int linenum) #include "rts/FileLock.h" #include "rts/GetTime.h" #include "rts/Globals.h" -#include "rts/IOManager.h" +#include "rts/IOInterface.h" #include "rts/Linker.h" #include "rts/Ticky.h" #include "rts/Timer.h" diff --git a/includes/rts/IOInterface.h b/includes/rts/IOInterface.h new file mode 100644 index 0000000000..4c392e2058 --- /dev/null +++ b/includes/rts/IOInterface.h @@ -0,0 +1,50 @@ +/* ----------------------------------------------------------------------------- + * + * (c) The GHC Team, 1998-2009 + * + * IO Manager functionality in the RTS + * + * Do not #include this file directly: #include "Rts.h" instead. + * + * To understand the structure of the RTS headers, see the wiki: + * https://gitlab.haskell.org/ghc/ghc/wikis/commentary/source-tree/includes + * + * -------------------------------------------------------------------------- */ + +#pragma once + +#if defined(mingw32_HOST_OS) + +#define IO_MANAGER_WAKEUP 0xffffffff +#define IO_MANAGER_DIE 0xfffffffe +/* spurious wakeups are returned as zero. */ +/* console events are ((event<<1) | 1). */ + +int rts_InstallConsoleEvent ( int action, StgStablePtr *handler ); +void rts_ConsoleHandlerDone ( int ev ); +extern StgInt console_handler; + +void * getIOManagerEvent (void); +HsWord32 readIOManagerEvent (void); +void sendIOManagerEvent (HsWord32 event); + +#else + +void setIOManagerControlFd (uint32_t cap_no, int fd); +void setTimerManagerControlFd(int fd); +void setIOManagerWakeupFd (int fd); + +#endif + +/* + * Communicating with the IO manager thread (see GHC.Conc). + * Posix implementation in posix/Signals.c + * Win32 implementation in win32/ThrIOManager.c, Windows's WINIO has the same + * interfaces for Threaded and Non-threaded I/O, so these methods are always + * available for WINIO. +*/ +void ioManagerWakeup (void); +#if defined(THREADED_RTS) || defined(mingw32_HOST_OS) +void ioManagerDie (void); +void ioManagerStart (void); +#endif diff --git a/includes/rts/IOManager.h b/includes/rts/IOManager.h deleted file mode 100644 index 4c392e2058..0000000000 --- a/includes/rts/IOManager.h +++ /dev/null @@ -1,50 +0,0 @@ -/* ----------------------------------------------------------------------------- - * - * (c) The GHC Team, 1998-2009 - * - * IO Manager functionality in the RTS - * - * Do not #include this file directly: #include "Rts.h" instead. - * - * To understand the structure of the RTS headers, see the wiki: - * https://gitlab.haskell.org/ghc/ghc/wikis/commentary/source-tree/includes - * - * -------------------------------------------------------------------------- */ - -#pragma once - -#if defined(mingw32_HOST_OS) - -#define IO_MANAGER_WAKEUP 0xffffffff -#define IO_MANAGER_DIE 0xfffffffe -/* spurious wakeups are returned as zero. */ -/* console events are ((event<<1) | 1). */ - -int rts_InstallConsoleEvent ( int action, StgStablePtr *handler ); -void rts_ConsoleHandlerDone ( int ev ); -extern StgInt console_handler; - -void * getIOManagerEvent (void); -HsWord32 readIOManagerEvent (void); -void sendIOManagerEvent (HsWord32 event); - -#else - -void setIOManagerControlFd (uint32_t cap_no, int fd); -void setTimerManagerControlFd(int fd); -void setIOManagerWakeupFd (int fd); - -#endif - -/* - * Communicating with the IO manager thread (see GHC.Conc). - * Posix implementation in posix/Signals.c - * Win32 implementation in win32/ThrIOManager.c, Windows's WINIO has the same - * interfaces for Threaded and Non-threaded I/O, so these methods are always - * available for WINIO. -*/ -void ioManagerWakeup (void); -#if defined(THREADED_RTS) || defined(mingw32_HOST_OS) -void ioManagerDie (void); -void ioManagerStart (void); -#endif -- cgit v1.2.1