|Version 3 (modified by 10 years ago) (diff),|
[ Up one level ]
GHC Source Tree Roadmap: includes/
This directory contains C header files that are included in a GHC distribution. We classify header files into 4 categories.
These are header files that define an external API to the RTS that can be used by client code. These interfaces are intended to be relatively stable:
- The external FFI api
The top-level interface to the RTS (
- External API to the RTS scheduler
- External API to the RTS runtime flags
- External API to the linker
Used when compiling via C
These header files are
#included into the
generated by GHC when it compiles Haskell code to C.
These days the amount of stuff included this way is kept to a minimum, because we don't want to pollute the C namespace with too much extraneous goop.
The top of the hierarchy is
Stg.h, which includes everything required by
.hccode. The following files are
Configuration info derived by the
- Settings for Rts configurables (eg. eager vs. lazy BH)
- Sizes of various basic types.
Basic types specific to the virtual machine (eg.
Tail calls in
- Stuff related to Windows DLLs.
- Global register assignments for this processor.
- "registers" in the virtual machine.
- Profiling gubbins.
- Declarations for closures & info tables built-in to the RTS
Declarations for RTS things referred to by
.hccode. (NOTE: also includes
Included into the RTS source code itself
Some of the header files here define important aspects of the
implementation of the runtime, such as
Closures.h which defines
structures representing the layout of closures.
All such header files lie below
Rts.h in the inclusion
hierarchy, in general all RTS sources
Pretty much all the header files in this directory fall into this
- Types used in the RTS
- Build-time constants
- The layout of closures.
- macros for constructing RET_DYN liveness masks
- The layout of info tables.
- The structure of Thread State Objects.
- Macros for performing updates.
Macros for multiprocessor support, eg.
The block allocator, block descriptors,
- Ticky-ticky profiling.
- Stable pointers, stable names.
- Hooks for changing RTS behaviour.
- The API for using Signals from Haskell.
- .NET stuff (bitrotted).
Included into C-- code
- included into .cmm source only
- generated by includes/mkDerivedConstants.c from other .h files, see Commentary/Compiler/CodeGen.
also included into
Included into various non-C source code
Some of these header files are
#included into Haskell code or
.cmm) code, so that we can have one place for defining constants and
configuration settings. Files in this category therefore must contain
#defines only, no C code or declarations.
The following headers are in this category: