summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
Diffstat (limited to 'includes')
-rw-r--r--includes/rts/Flags.h58
-rw-r--r--includes/rts/IOManager.h2
-rw-r--r--includes/rts/OSThreads.h4
-rw-r--r--includes/rts/SpinLock.h4
-rw-r--r--includes/rts/Threads.h4
-rw-r--r--includes/rts/Types.h3
-rw-r--r--includes/rts/prof/CCS.h2
-rw-r--r--includes/rts/storage/Block.h4
-rw-r--r--includes/rts/storage/ClosureMacros.h36
-rw-r--r--includes/rts/storage/GC.h8
-rw-r--r--includes/rts/storage/MBlock.h4
-rw-r--r--includes/rts/storage/SMPClosureOps.h2
12 files changed, 66 insertions, 65 deletions
diff --git a/includes/rts/Flags.h b/includes/rts/Flags.h
index d3bc001ca1..8020a177b0 100644
--- a/includes/rts/Flags.h
+++ b/includes/rts/Flags.h
@@ -27,30 +27,30 @@
/* See Note [Synchronization of flags and base APIs] */
typedef struct _GC_FLAGS {
FILE *statsFile;
- nat giveStats;
+ uint32_t giveStats;
#define NO_GC_STATS 0
#define COLLECT_GC_STATS 1
#define ONELINE_GC_STATS 2
#define SUMMARY_GC_STATS 3
#define VERBOSE_GC_STATS 4
- nat maxStkSize; /* in *words* */
- nat initialStkSize; /* in *words* */
- nat stkChunkSize; /* in *words* */
- nat stkChunkBufferSize; /* in *words* */
-
- nat maxHeapSize; /* in *blocks* */
- nat minAllocAreaSize; /* in *blocks* */
- nat largeAllocLim; /* in *blocks* */
- nat nurseryChunkSize; /* in *blocks* */
- nat minOldGenSize; /* in *blocks* */
- nat heapSizeSuggestion; /* in *blocks* */
+ uint32_t maxStkSize; /* in *words* */
+ uint32_t initialStkSize; /* in *words* */
+ uint32_t stkChunkSize; /* in *words* */
+ uint32_t stkChunkBufferSize; /* in *words* */
+
+ uint32_t maxHeapSize; /* in *blocks* */
+ uint32_t minAllocAreaSize; /* in *blocks* */
+ uint32_t largeAllocLim; /* in *blocks* */
+ uint32_t nurseryChunkSize; /* in *blocks* */
+ uint32_t minOldGenSize; /* in *blocks* */
+ uint32_t heapSizeSuggestion; /* in *blocks* */
rtsBool heapSizeSuggestionAuto;
double oldGenFactor;
double pcFreeHeap;
- nat generations;
- nat steps;
+ uint32_t generations;
+ uint32_t steps;
rtsBool squeezeUpdFrames;
rtsBool compact; /* True <=> "compact all the time" */
@@ -97,7 +97,7 @@ typedef struct _DEBUG_FLAGS {
/* See Note [Synchronization of flags and base APIs] */
typedef struct _COST_CENTRE_FLAGS {
- nat doCostCentres;
+ uint32_t doCostCentres;
# define COST_CENTRES_NONE 0
# define COST_CENTRES_SUMMARY 1
# define COST_CENTRES_VERBOSE 2 /* incl. serial time profile */
@@ -110,7 +110,7 @@ typedef struct _COST_CENTRE_FLAGS {
/* See Note [Synchronization of flags and base APIs] */
typedef struct _PROFILING_FLAGS {
- nat doHeapProfile;
+ uint32_t doHeapProfile;
# define NO_HEAP_PROFILING 0 /* N.B. Used as indexes into arrays */
# define HEAP_BY_CCS 1
# define HEAP_BY_MOD 2
@@ -121,16 +121,16 @@ typedef struct _PROFILING_FLAGS {
# define HEAP_BY_CLOSURE_TYPE 8
- Time heapProfileInterval; /* time between samples */
- nat heapProfileIntervalTicks; /* ticks between samples (derived) */
- rtsBool includeTSOs;
+ Time heapProfileInterval; /* time between samples */
+ uint32_t heapProfileIntervalTicks; /* ticks between samples (derived) */
+ rtsBool includeTSOs;
rtsBool showCCSOnException;
- nat maxRetainerSetSize;
+ uint32_t maxRetainerSetSize;
- nat ccsLength;
+ uint32_t ccsLength;
const char* modSelector;
const char* descrSelector;
@@ -184,27 +184,27 @@ typedef struct _MISC_FLAGS {
#ifdef THREADED_RTS
/* See Note [Synchronization of flags and base APIs] */
typedef struct _PAR_FLAGS {
- nat nNodes; /* number of threads to run simultaneously */
+ uint32_t nNodes; /* number of threads to run simultaneously */
rtsBool migrate; /* migrate threads between capabilities */
- nat maxLocalSparks;
+ uint32_t maxLocalSparks;
rtsBool parGcEnabled; /* enable parallel GC */
- nat parGcGen; /* do parallel GC in this generation
+ uint32_t parGcGen; /* do parallel GC in this generation
* and higher only */
- rtsBool parGcLoadBalancingEnabled;
+ rtsBool parGcLoadBalancingEnabled;
/* enable load-balancing in the
* parallel GC */
- nat parGcLoadBalancingGen;
+ uint32_t parGcLoadBalancingGen;
/* do load-balancing in this
* generation and higher only */
- nat parGcNoSyncWithIdle;
+ uint32_t parGcNoSyncWithIdle;
/* if a Capability has been idle for
* this many GCs, do not try to wake
* it up when doing a
* non-load-balancing parallel GC.
* (zero disables) */
- nat parGcThreads;
+ uint32_t parGcThreads;
/* Use this many threads for parallel
* GC (default: use all nNodes). */
@@ -249,7 +249,7 @@ extern RTS_FLAGS RtsFlags;
/*
* The printf formats are here, so we are less likely to make
* overly-long filenames (with disastrous results). No more than 128
- * chars, please!
+ * chars, please!
*/
#define STATS_FILENAME_MAXLEN 128
diff --git a/includes/rts/IOManager.h b/includes/rts/IOManager.h
index 7bf2cdf43c..f9e2cd7958 100644
--- a/includes/rts/IOManager.h
+++ b/includes/rts/IOManager.h
@@ -26,7 +26,7 @@ void sendIOManagerEvent (HsWord32 event);
#else
-void setIOManagerControlFd (nat cap_no, int fd);
+void setIOManagerControlFd (uint32_t cap_no, int fd);
void setTimerManagerControlFd(int fd);
void setIOManagerWakeupFd (int fd);
diff --git a/includes/rts/OSThreads.h b/includes/rts/OSThreads.h
index a3ed47c19b..ee1855b4da 100644
--- a/includes/rts/OSThreads.h
+++ b/includes/rts/OSThreads.h
@@ -200,7 +200,7 @@ void setThreadLocalVar (ThreadLocalKey *key, void *value);
void freeThreadLocalKey (ThreadLocalKey *key);
// Processors and affinity
-void setThreadAffinity (nat n, nat m);
+void setThreadAffinity (uint32_t n, uint32_t m);
#endif // !CMINUSMINUS
#else
@@ -221,7 +221,7 @@ int forkOS_createThread ( HsStablePtr entry );
//
// Returns the number of processor cores in the machine
//
-nat getNumberOfProcessors (void);
+uint32_t getNumberOfProcessors (void);
//
// Support for getting at the kernel thread Id for tracing/profiling.
diff --git a/includes/rts/SpinLock.h b/includes/rts/SpinLock.h
index b54d678fa5..dccd86705c 100644
--- a/includes/rts/SpinLock.h
+++ b/includes/rts/SpinLock.h
@@ -42,7 +42,7 @@ typedef StgWord SpinLock;
INLINE_HEADER void ACQUIRE_SPIN_LOCK(SpinLock * p)
{
StgWord32 r = 0;
- nat i;
+ uint32_t i;
do {
for (i = 0; i < SPIN_COUNT; i++) {
r = cas((StgVolatilePtr)&(p->lock), 1, 0);
@@ -75,7 +75,7 @@ INLINE_HEADER void initSpinLock(SpinLock * p)
INLINE_HEADER void ACQUIRE_SPIN_LOCK(SpinLock * p)
{
StgWord32 r = 0;
- nat i;
+ uint32_t i;
do {
for (i = 0; i < SPIN_COUNT; i++) {
r = cas((StgVolatilePtr)p, 1, 0);
diff --git a/includes/rts/Threads.h b/includes/rts/Threads.h
index fc8ae6e089..67d01db7d4 100644
--- a/includes/rts/Threads.h
+++ b/includes/rts/Threads.h
@@ -62,7 +62,7 @@ HsBool rtsSupportsBoundThreads (void);
extern unsigned int n_capabilities;
// The number of Capabilities that are not disabled
-extern nat enabled_capabilities;
+extern uint32_t enabled_capabilities;
#if !IN_STG_CODE
extern Capability MainCapability;
@@ -72,6 +72,6 @@ extern Capability MainCapability;
// Change the number of capabilities (only supports increasing the
// current value at the moment).
//
-extern void setNumCapabilities (nat new_);
+extern void setNumCapabilities (uint32_t new_);
#endif /* RTS_THREADS_H */
diff --git a/includes/rts/Types.h b/includes/rts/Types.h
index 1791b88772..08baceb1cf 100644
--- a/includes/rts/Types.h
+++ b/includes/rts/Types.h
@@ -16,7 +16,8 @@
#include <stddef.h>
-typedef unsigned int nat; /* at least 32 bits (like int) */
+// Deprecated, use uint32_t instead.
+typedef unsigned int nat __attribute__((deprecated)); /* uint32_t */
/* ullong (64|128-bit) type: only include if needed (not ANSI) */
#if defined(__GNUC__)
diff --git a/includes/rts/prof/CCS.h b/includes/rts/prof/CCS.h
index f3c158d8e2..1ed53c1d7c 100644
--- a/includes/rts/prof/CCS.h
+++ b/includes/rts/prof/CCS.h
@@ -113,7 +113,7 @@ typedef struct IndexTable_ {
CostCentre *cc;
CostCentreStack *ccs;
struct IndexTable_ *next;
- nat back_edge;
+ uint32_t back_edge;
} IndexTable;
diff --git a/includes/rts/storage/Block.h b/includes/rts/storage/Block.h
index 024f78c6e3..1a31de5512 100644
--- a/includes/rts/storage/Block.h
+++ b/includes/rts/storage/Block.h
@@ -57,7 +57,7 @@
* own and treat it as an immovable object during GC, expressed as a
* fraction of BLOCK_SIZE.
*/
-#define LARGE_OBJECT_THRESHOLD ((nat)(BLOCK_SIZE * 8 / 10))
+#define LARGE_OBJECT_THRESHOLD ((uint32_t)(BLOCK_SIZE * 8 / 10))
/*
* Note [integer overflow]
@@ -295,7 +295,7 @@ void freeChain(bdescr *p);
void freeGroup_lock(bdescr *p);
void freeChain_lock(bdescr *p);
-bdescr * splitBlockGroup (bdescr *bd, nat blocks);
+bdescr * splitBlockGroup (bdescr *bd, uint32_t blocks);
/* Round a value to megablocks --------------------------------------------- */
diff --git a/includes/rts/storage/ClosureMacros.h b/includes/rts/storage/ClosureMacros.h
index 03589f2f16..d7ae5ea122 100644
--- a/includes/rts/storage/ClosureMacros.h
+++ b/includes/rts/storage/ClosureMacros.h
@@ -256,20 +256,20 @@ INLINE_HEADER rtsBool LOOKS_LIKE_CLOSURE_PTR (void *p)
Macros for calculating the size of a closure
-------------------------------------------------------------------------- */
-EXTERN_INLINE StgOffset PAP_sizeW ( nat n_args );
-EXTERN_INLINE StgOffset PAP_sizeW ( nat n_args )
+EXTERN_INLINE StgOffset PAP_sizeW ( uint32_t n_args );
+EXTERN_INLINE StgOffset PAP_sizeW ( uint32_t n_args )
{ return sizeofW(StgPAP) + n_args; }
-EXTERN_INLINE StgOffset AP_sizeW ( nat n_args );
-EXTERN_INLINE StgOffset AP_sizeW ( nat n_args )
+EXTERN_INLINE StgOffset AP_sizeW ( uint32_t n_args );
+EXTERN_INLINE StgOffset AP_sizeW ( uint32_t n_args )
{ return sizeofW(StgAP) + n_args; }
-EXTERN_INLINE StgOffset AP_STACK_sizeW ( nat size );
-EXTERN_INLINE StgOffset AP_STACK_sizeW ( nat size )
+EXTERN_INLINE StgOffset AP_STACK_sizeW ( uint32_t size );
+EXTERN_INLINE StgOffset AP_STACK_sizeW ( uint32_t size )
{ return sizeofW(StgAP_STACK) + size; }
-EXTERN_INLINE StgOffset CONSTR_sizeW( nat p, nat np );
-EXTERN_INLINE StgOffset CONSTR_sizeW( nat p, nat np )
+EXTERN_INLINE StgOffset CONSTR_sizeW( uint32_t p, uint32_t np );
+EXTERN_INLINE StgOffset CONSTR_sizeW( uint32_t p, uint32_t np )
{ return sizeofW(StgHeader) + p + np; }
EXTERN_INLINE StgOffset THUNK_SELECTOR_sizeW ( void );
@@ -333,12 +333,12 @@ EXTERN_INLINE StgWord bco_sizeW ( StgBCO *bco )
{ return bco->size; }
/*
- * TODO: Consider to switch return type from 'nat' to 'StgWord' #8742
+ * TODO: Consider to switch return type from 'uint32_t' to 'StgWord' #8742
*
* (Also for 'closure_sizeW' below)
*/
-EXTERN_INLINE nat closure_sizeW_ (StgClosure *p, StgInfoTable *info);
-EXTERN_INLINE nat
+EXTERN_INLINE uint32_t closure_sizeW_ (StgClosure *p, StgInfoTable *info);
+EXTERN_INLINE uint32_t
closure_sizeW_ (StgClosure *p, StgInfoTable *info)
{
switch (info->type) {
@@ -399,8 +399,8 @@ closure_sizeW_ (StgClosure *p, StgInfoTable *info)
}
// The definitive way to find the size, in words, of a heap-allocated closure
-EXTERN_INLINE nat closure_sizeW (StgClosure *p);
-EXTERN_INLINE nat closure_sizeW (StgClosure *p)
+EXTERN_INLINE uint32_t closure_sizeW (StgClosure *p);
+EXTERN_INLINE uint32_t closure_sizeW (StgClosure *p)
{
return closure_sizeW_(p, get_itbl(p));
}
@@ -505,13 +505,13 @@ INLINE_HEADER StgWord8 *mutArrPtrsCard (StgMutArrPtrs *a, W_ n)
#endif
#ifdef PROFILING
-void LDV_recordDead (StgClosure *c, nat size);
+void LDV_recordDead (StgClosure *c, uint32_t size);
#endif
EXTERN_INLINE void overwritingClosure (StgClosure *p);
EXTERN_INLINE void overwritingClosure (StgClosure *p)
{
- nat size, i;
+ uint32_t size, i;
#if ZERO_SLOP_FOR_LDV_PROF && !ZERO_SLOP_FOR_SANITY_CHECK
// see Note [zeroing slop], also #8402
@@ -537,10 +537,10 @@ EXTERN_INLINE void overwritingClosure (StgClosure *p)
//
// Note: As this calls LDV_recordDead() you have to call LDV_RECORD()
// on the final state of the closure at the call-site
-EXTERN_INLINE void overwritingClosureOfs (StgClosure *p, nat offset);
-EXTERN_INLINE void overwritingClosureOfs (StgClosure *p, nat offset)
+EXTERN_INLINE void overwritingClosureOfs (StgClosure *p, uint32_t offset);
+EXTERN_INLINE void overwritingClosureOfs (StgClosure *p, uint32_t offset)
{
- nat size, i;
+ uint32_t size, i;
#if ZERO_SLOP_FOR_LDV_PROF && !ZERO_SLOP_FOR_SANITY_CHECK
// see Note [zeroing slop], also #8402
diff --git a/includes/rts/storage/GC.h b/includes/rts/storage/GC.h
index f7da838739..04548be379 100644
--- a/includes/rts/storage/GC.h
+++ b/includes/rts/storage/GC.h
@@ -88,7 +88,7 @@ typedef struct nursery_ {
// memory allocation is tracked.
typedef struct generation_ {
- nat no; // generation number
+ uint32_t no; // generation number
bdescr * blocks; // blocks in this gen
memcount n_blocks; // number of blocks
@@ -109,9 +109,9 @@ typedef struct generation_ {
struct generation_ *to; // destination gen for live objects
// stats information
- nat collections;
- nat par_collections;
- nat failed_promotions;
+ uint32_t collections;
+ uint32_t par_collections;
+ uint32_t failed_promotions;
// ------------------------------------
// Fields below are used during GC only
diff --git a/includes/rts/storage/MBlock.h b/includes/rts/storage/MBlock.h
index 046990eea9..419a96e225 100644
--- a/includes/rts/storage/MBlock.h
+++ b/includes/rts/storage/MBlock.h
@@ -17,8 +17,8 @@ extern W_ mblocks_allocated;
extern void initMBlocks(void);
extern void * getMBlock(void);
-extern void * getMBlocks(nat n);
-extern void freeMBlocks(void *addr, nat n);
+extern void * getMBlocks(uint32_t n);
+extern void freeMBlocks(void *addr, uint32_t n);
extern void releaseFreeMemory(void);
extern void freeAllMBlocks(void);
diff --git a/includes/rts/storage/SMPClosureOps.h b/includes/rts/storage/SMPClosureOps.h
index a8ebb5d0ed..ee92186f5f 100644
--- a/includes/rts/storage/SMPClosureOps.h
+++ b/includes/rts/storage/SMPClosureOps.h
@@ -51,7 +51,7 @@ EXTERN_INLINE StgInfoTable *reallyLockClosure(StgClosure *p)
{
StgWord info;
do {
- nat i = 0;
+ uint32_t i = 0;
do {
info = xchg((P_)(void *)&p->header.info, (W_)&stg_WHITEHOLE_info);
if (info != (W_)&stg_WHITEHOLE_info) return (StgInfoTable *)info;