diff options
57 files changed, 275 insertions, 130 deletions
diff --git a/includes/rts/Flags.h b/includes/rts/Flags.h index dca727a1cd..d9e3be97de 100644 --- a/includes/rts/Flags.h +++ b/includes/rts/Flags.h @@ -208,9 +208,9 @@ extern RTS_FLAGS RtsFlags; /* Routines that operate-on/to-do-with RTS flags: */ -extern void initRtsFlagsDefaults(void); -extern void setupRtsFlags(int *argc, char *argv[], int *rts_argc, char *rts_argv[]); -extern void setProgName(char *argv[]); +void initRtsFlagsDefaults(void); +void setupRtsFlags(int *argc, char *argv[], int *rts_argc, char *rts_argv[]); +void setProgName(char *argv[]); /* diff --git a/rts/Apply.h b/rts/Apply.h index 76e36cb9fb..70faed4cb9 100644 --- a/rts/Apply.h +++ b/rts/Apply.h @@ -11,19 +11,19 @@ // canned slow entry points, indexed by arg type (ARG_P, ARG_PP, etc.) #ifdef IN_STG_CODE -extern StgWord stg_ap_stack_entries[]; +extern RTS_PRIVATE StgWord stg_ap_stack_entries[]; #else -extern StgFun *stg_ap_stack_entries[]; +extern RTS_PRIVATE StgFun *stg_ap_stack_entries[]; #endif // canned register save code for heap check failure in a function #ifdef IN_STG_CODE -extern StgWord stg_stack_save_entries[]; +extern RTS_PRIVATE StgWord stg_stack_save_entries[]; #else -extern StgFun *stg_stack_save_entries[]; +extern RTS_PRIVATE StgFun *stg_stack_save_entries[]; #endif // canned bitmap for each arg type -extern StgWord stg_arg_bitmaps[]; +extern RTS_PRIVATE StgWord stg_arg_bitmaps[]; #endif /* APPLY_H */ diff --git a/rts/Arena.h b/rts/Arena.h index 7a2989e543..086a0200ad 100644 --- a/rts/Arena.h +++ b/rts/Arena.h @@ -11,15 +11,15 @@ typedef struct _Arena Arena; // Start a new arena -extern Arena * newArena ( void ); +RTS_PRIVATE Arena * newArena ( void ); // Allocate memory in an arena -extern void * arenaAlloc ( Arena *, size_t ); +RTS_PRIVATE void * arenaAlloc ( Arena *, size_t ); // Free an entire arena -extern void arenaFree ( Arena * ); +RTS_PRIVATE void arenaFree ( Arena * ); // For internal use only: -extern unsigned long arenaBlocks( void ); +RTS_PRIVATE unsigned long arenaBlocks( void ); #endif /* ARENA_H */ diff --git a/rts/AwaitEvent.h b/rts/AwaitEvent.h index 758e81a288..ecc13b8ff2 100644 --- a/rts/AwaitEvent.h +++ b/rts/AwaitEvent.h @@ -17,8 +17,8 @@ * Called from STG : NO * Locks assumed : sched_mutex */ -void awaitEvent(rtsBool wait); /* In posix/Select.c or - * win32/AwaitEvent.c */ +RTS_PRIVATE void awaitEvent(rtsBool wait); /* In posix/Select.c or + * win32/AwaitEvent.c */ #endif #endif /* AWAITEVENT_H */ diff --git a/rts/Capability.h b/rts/Capability.h index fb199e2a3e..6fdc002049 100644 --- a/rts/Capability.h +++ b/rts/Capability.h @@ -22,6 +22,8 @@ #include "Task.h" #include "Sparks.h" +#pragma GCC visibility push(hidden) + struct Capability_ { // State required by the STG virtual machine when running Haskell // code. During STG execution, the BaseReg register always points @@ -330,4 +332,6 @@ contextSwitchCapability (Capability *cap) cap->context_switch = 1; } +#pragma GCC visibility pop + #endif /* CAPABILITY_H */ diff --git a/rts/Disassembler.h b/rts/Disassembler.h index 2851097117..c6f71564c4 100644 --- a/rts/Disassembler.h +++ b/rts/Disassembler.h @@ -11,8 +11,8 @@ #ifdef DEBUG -extern int disInstr ( StgBCO *bco, int pc ); -extern void disassemble( StgBCO *bco ); +RTS_PRIVATE int disInstr ( StgBCO *bco, int pc ); +RTS_PRIVATE void disassemble( StgBCO *bco ); #endif diff --git a/rts/FrontPanel.h b/rts/FrontPanel.h index de3b741657..07508aa403 100644 --- a/rts/FrontPanel.h +++ b/rts/FrontPanel.h @@ -9,6 +9,8 @@ #ifndef FRONTPANEL_H #define FRONTPANEL_H +#pragma GCC visibility push(hidden) + #ifdef RTS_GTK_FRONTPANEL #include "Rts.h" /* needed because this file gets included by @@ -31,5 +33,7 @@ extern gboolean continue_now, stop_now, quit; #endif /* RTS_GTK_FRONTPANEL */ +#pragma GCC visibility pop + #endif /* FRONTPANEL_H */ diff --git a/rts/GetTime.h b/rts/GetTime.h index 5f02df0625..11da641164 100644 --- a/rts/GetTime.h +++ b/rts/GetTime.h @@ -9,6 +9,8 @@ #ifndef GETTIME_H #define GETTIME_H +#pragma GCC visibility push(hidden) + // We'll use a fixed resolution of usec for now. The machine // dependent implementation may have a different resolution, but we'll // normalise to this for the machine independent interface. @@ -23,4 +25,6 @@ void getProcessTimes (Ticks *user, Ticks *elapsed); // Not strictly timing, but related nat getPageFaults (void); +#pragma GCC visibility pop + #endif /* GETTIME_H */ diff --git a/rts/Globals.h b/rts/Globals.h index bc68904f78..445072ca34 100644 --- a/rts/Globals.h +++ b/rts/Globals.h @@ -12,8 +12,8 @@ #ifndef GLOBALS_H #define GLOBALS_H -void initGlobalStore(void); -void exitGlobalStore(void); +RTS_PRIVATE void initGlobalStore(void); +RTS_PRIVATE void exitGlobalStore(void); #endif diff --git a/rts/Hash.h b/rts/Hash.h index d16f9ae9c1..c5eec37552 100644 --- a/rts/Hash.h +++ b/rts/Hash.h @@ -9,6 +9,8 @@ #ifndef HASH_H #define HASH_H +#pragma GCC visibility push(hidden) + typedef struct hashtable HashTable; /* abstract */ /* Hash table access where the keys are StgWords */ @@ -45,5 +47,7 @@ void freeHashTable ( HashTable *table, void (*freeDataFun)(void *) ); void exitHashTable ( void ); +#pragma GCC visibility pop + #endif /* HASH_H */ diff --git a/rts/Interpreter.h b/rts/Interpreter.h index d66e636084..fd4f7b98c3 100644 --- a/rts/Interpreter.h +++ b/rts/Interpreter.h @@ -9,6 +9,6 @@ #ifndef INTERPRETER_H #define INTERPRETER_H -extern Capability *interpretBCO (Capability* cap); +RTS_PRIVATE Capability *interpretBCO (Capability* cap); #endif /* INTERPRETER_H */ diff --git a/rts/LdvProfile.h b/rts/LdvProfile.h index 27215472d6..b4418046ba 100644 --- a/rts/LdvProfile.h +++ b/rts/LdvProfile.h @@ -14,8 +14,8 @@ #include "ProfHeap.h" -extern void LdvCensusForDead ( nat ); -extern void LdvCensusKillAll ( void ); +RTS_PRIVATE void LdvCensusForDead ( nat ); +RTS_PRIVATE void LdvCensusKillAll ( void ); // Creates a 0-filled slop of size 'howManyBackwards' backwards from the // address 'from'. diff --git a/rts/Papi.h b/rts/Papi.h index 8f58f6dfc9..8658d8ccac 100644 --- a/rts/Papi.h +++ b/rts/Papi.h @@ -8,6 +8,8 @@ #ifndef PAPI_H #define PAPI_H +#pragma GCC visibility push(hidden) + /* Check the error value of a PAPI call, reporting an error, if needed */ extern int papi_error; @@ -29,4 +31,6 @@ void papi_stop_gc1_count(void); void papi_thread_start_gc1_count(int event_set); void papi_thread_stop_gc1_count(int event_set); +#pragma GCC visibility pop + #endif /* PAPI_H */ diff --git a/rts/Printer.h b/rts/Printer.h index f627049e8a..33fe6a8316 100644 --- a/rts/Printer.h +++ b/rts/Printer.h @@ -9,6 +9,8 @@ #ifndef PRINTER_H #define PRINTER_H +#pragma GCC visibility push(hidden) + extern void printPtr ( StgPtr p ); extern void printObj ( StgClosure *obj ); @@ -30,5 +32,7 @@ extern void DEBUG_LoadSymbols( char *name ); extern const char *lookupGHCName( void *addr ); #endif +#pragma GCC visibility pop + #endif /* PRINTER_H */ diff --git a/rts/ProfHeap.h b/rts/ProfHeap.h index a3da424d24..b781235c77 100644 --- a/rts/ProfHeap.h +++ b/rts/ProfHeap.h @@ -9,10 +9,14 @@ #ifndef PROFHEAP_H #define PROFHEAP_H -extern void heapCensus( void ); -extern nat initHeapProfiling( void ); -extern void endHeapProfiling( void ); -extern void LDV_recordDead( StgClosure *c, nat size ); -extern rtsBool strMatchesSelector( char* str, char* sel ); +#pragma GCC visibility push(hidden) + +void heapCensus (void); +nat initHeapProfiling (void); +void endHeapProfiling (void); +void LDV_recordDead (StgClosure *c, nat size); +rtsBool strMatchesSelector (char* str, char* sel); + +#pragma GCC visibility pop #endif /* PROFHEAP_H */ diff --git a/rts/Profiling.h b/rts/Profiling.h index 8961da9b17..87d81e2f9b 100644 --- a/rts/Profiling.h +++ b/rts/Profiling.h @@ -11,6 +11,8 @@ #include <stdio.h> +#pragma GCC visibility push(hidden) + void initProfiling1 (void); void freeProfiling1 (void); void initProfiling2 (void); @@ -21,18 +23,20 @@ extern FILE *hp_file; #ifdef PROFILING -void gen_XML_logfile ( void ); +void gen_XML_logfile ( void ); void reportCCSProfiling ( void ); void PrintNewStackDecls ( void ); -extern void fprintCCS( FILE *f, CostCentreStack *ccs ); -extern void fprintCCS_stderr( CostCentreStack *ccs ); +void fprintCCS( FILE *f, CostCentreStack *ccs ); +void fprintCCS_stderr( CostCentreStack *ccs ); #ifdef DEBUG -extern void debugCCS( CostCentreStack *ccs ); +void debugCCS( CostCentreStack *ccs ); #endif #endif +#pragma GCC visibility pop + #endif /* PROFILING_H */ diff --git a/rts/Proftimer.h b/rts/Proftimer.h index 1379792d66..7d4295642d 100644 --- a/rts/Proftimer.h +++ b/rts/Proftimer.h @@ -9,17 +9,21 @@ #ifndef PROFTIMER_H #define PROFTIMER_H -extern void initProfTimer ( void ); -extern void handleProfTick ( void ); +#pragma GCC visibility push(hidden) + +void initProfTimer ( void ); +void handleProfTick ( void ); #ifdef PROFILING -extern void stopProfTimer ( void ); -extern void startProfTimer ( void ); +void stopProfTimer ( void ); +void startProfTimer ( void ); #endif -extern void stopHeapProfTimer ( void ); -extern void startHeapProfTimer ( void ); +void stopHeapProfTimer ( void ); +void startHeapProfTimer ( void ); extern rtsBool performHeapProfile; +#pragma GCC visibility pop + #endif /* PROFTIMER_H */ diff --git a/rts/RaiseAsync.h b/rts/RaiseAsync.h index 6f7c305d54..52a0aa4bf0 100644 --- a/rts/RaiseAsync.h +++ b/rts/RaiseAsync.h @@ -9,6 +9,8 @@ #ifndef RAISEASYNC_H #define RAISEASYNC_H +#pragma GCC visibility push(hidden) + #define THROWTO_SUCCESS 0 #define THROWTO_BLOCKED 1 @@ -66,5 +68,7 @@ interruptible(StgTSO *t) #endif /* CMINUSMINUS */ +#pragma GCC visibility pop + #endif /* RAISEASYNC_H */ diff --git a/rts/RetainerProfile.h b/rts/RetainerProfile.h index da9a847478..7278dc7465 100644 --- a/rts/RetainerProfile.h +++ b/rts/RetainerProfile.h @@ -14,10 +14,12 @@ #include "RetainerSet.h" -extern void initRetainerProfiling ( void ); -extern void endRetainerProfiling ( void ); -extern void retainerProfile ( void ); -extern void resetStaticObjectForRetainerProfiling( StgClosure *static_objects ); +#pragma GCC visibility push(hidden) + +void initRetainerProfiling ( void ); +void endRetainerProfiling ( void ); +void retainerProfile ( void ); +void resetStaticObjectForRetainerProfiling( StgClosure *static_objects ); extern StgWord flip; @@ -41,6 +43,8 @@ retainerSetOf( StgClosure *c ) extern lnat retainerStackBlocks ( void ); #endif +#pragma GCC visibility pop + #endif /* PROFILING */ #endif /* RETAINERPROFILE_H */ diff --git a/rts/RetainerSet.h b/rts/RetainerSet.h index 6a00e1395e..cbf8c1d9b0 100644 --- a/rts/RetainerSet.h +++ b/rts/RetainerSet.h @@ -14,6 +14,8 @@ #ifdef PROFILING +#pragma GCC visibility push(hidden) + /* Type 'retainer' defines the retainer identity. @@ -197,5 +199,7 @@ void outputAllRetainerSet(FILE *); // the best place to define it. void printRetainer(FILE *, retainer); +#pragma GCC visibility pop + #endif /* PROFILING */ #endif /* RETAINERSET_H */ diff --git a/rts/RtsMain.h b/rts/RtsMain.h index 7810f6f07d..4aabc56517 100644 --- a/rts/RtsMain.h +++ b/rts/RtsMain.h @@ -13,6 +13,6 @@ * The entry point for Haskell programs that use a Haskell main function * -------------------------------------------------------------------------- */ -extern int hs_main(int argc, char *argv[], void (*main_init)(void), StgClosure *main_closure); +int hs_main(int argc, char *argv[], void (*main_init)(void), StgClosure *main_closure); #endif /* RTSMAIN_H */ diff --git a/rts/RtsSignals.h b/rts/RtsSignals.h index 601a46b79c..3b569df5d3 100644 --- a/rts/RtsSignals.h +++ b/rts/RtsSignals.h @@ -25,12 +25,14 @@ #if RTS_USER_SIGNALS +#pragma GCC visibility push(hidden) + /* * Function: initUserSignals() * * Initialize the console handling substrate. */ -extern void initUserSignals(void); +void initUserSignals(void); /* * Function: initDefaultHandlers() @@ -38,10 +40,10 @@ extern void initUserSignals(void); * Install any default signal/console handlers. Currently we install a * Ctrl+C handler that shuts down the RTS in an orderly manner. */ -extern void initDefaultHandlers(void); -extern void resetDefaultHandlers(void); +void initDefaultHandlers(void); +void resetDefaultHandlers(void); -extern void freeSignalHandlers(void); +void freeSignalHandlers(void); /* * Function: blockUserSignals() @@ -51,21 +53,21 @@ extern void freeSignalHandlers(void); * when emptying the queue by running the handlers. * */ -extern void blockUserSignals(void); +void blockUserSignals(void); /* * Function: unblockUserSignals() * * The inverse of blockUserSignals(); re-enable the deliver of console events. */ -extern void unblockUserSignals(void); +void unblockUserSignals(void); /* * Function: awaitUserSignals() * * Wait for the next console event. Currently a NOP (returns immediately.) */ -extern void awaitUserSignals(void); +void awaitUserSignals(void); /* * Function: markSignalHandlers() @@ -73,7 +75,9 @@ extern void awaitUserSignals(void); * Evacuate the handler queue. _Assumes_ that console event delivery * has already been blocked. */ -extern void markSignalHandlers (evac_fn evac, void *user); +void markSignalHandlers (evac_fn evac, void *user); + +#pragma GCC visibility pop #endif /* RTS_USER_SIGNALS */ diff --git a/rts/RtsUtils.h b/rts/RtsUtils.h index 241cbf3368..a47f953383 100644 --- a/rts/RtsUtils.h +++ b/rts/RtsUtils.h @@ -9,6 +9,8 @@ #ifndef RTSUTILS_H #define RTSUTILS_H +#pragma GCC visibility push(hidden) + /* ----------------------------------------------------------------------------- * (Checked) dynamic allocation * -------------------------------------------------------------------------- */ @@ -49,4 +51,6 @@ int genericRaise(int sig); int rts_isProfiled(void); +#pragma GCC visibility pop + #endif /* RTSUTILS_H */ @@ -40,9 +40,7 @@ #define STM_UNIPROC #endif -#ifdef __cplusplus -extern "C" { -#endif +#pragma GCC visibility push(hidden) /*---------------------------------------------------------------------- @@ -50,7 +48,7 @@ extern "C" { -------------- */ -extern void stmPreGCHook(void); +void stmPreGCHook(void); /*---------------------------------------------------------------------- @@ -61,8 +59,8 @@ extern void stmPreGCHook(void); /* Create and enter a new transaction context */ -extern StgTRecHeader *stmStartTransaction(Capability *cap, StgTRecHeader *outer); -extern StgTRecHeader *stmStartNestedTransaction(Capability *cap, StgTRecHeader *outer +StgTRecHeader *stmStartTransaction(Capability *cap, StgTRecHeader *outer); +StgTRecHeader *stmStartNestedTransaction(Capability *cap, StgTRecHeader *outer ); /* @@ -71,8 +69,8 @@ extern StgTRecHeader *stmStartNestedTransaction(Capability *cap, StgTRecHeader * * to that read set could change whether or not the tx should abort. */ -extern void stmAbortTransaction(Capability *cap, StgTRecHeader *trec); -extern void stmFreeAbortedTRec(Capability *cap, StgTRecHeader *trec); +void stmAbortTransaction(Capability *cap, StgTRecHeader *trec); +void stmFreeAbortedTRec(Capability *cap, StgTRecHeader *trec); /* * Ensure that a subsequent commit / validation will fail. We use this @@ -83,14 +81,14 @@ extern void stmFreeAbortedTRec(Capability *cap, StgTRecHeader *trec); * in case other threads' updates make it valid in the mean time. */ -extern void stmCondemnTransaction(Capability *cap, StgTRecHeader *trec); +void stmCondemnTransaction(Capability *cap, StgTRecHeader *trec); /* * Return the trec within which the specified trec was created (not * valid if trec==NO_TREC). */ -extern StgTRecHeader *stmGetEnclosingTRec(StgTRecHeader *trec); +StgTRecHeader *stmGetEnclosingTRec(StgTRecHeader *trec); /*---------------------------------------------------------------------- @@ -106,7 +104,7 @@ extern StgTRecHeader *stmGetEnclosingTRec(StgTRecHeader *trec); threads at GC (in case they are stuck looping) */ -extern StgBool stmValidateNestOfTransactions(StgTRecHeader *trec); +StgBool stmValidateNestOfTransactions(StgTRecHeader *trec); /*---------------------------------------------------------------------- @@ -152,12 +150,12 @@ extern StgBool stmValidateNestOfTransactions(StgTRecHeader *trec); * transaction. */ -extern StgInvariantCheckQueue *stmGetInvariantsToCheck(Capability *cap, - StgTRecHeader *trec); +StgInvariantCheckQueue *stmGetInvariantsToCheck(Capability *cap, + StgTRecHeader *trec); -extern void stmAddInvariantToCheck(Capability *cap, - StgTRecHeader *trec, - StgClosure *code); +void stmAddInvariantToCheck(Capability *cap, + StgTRecHeader *trec, + StgClosure *code); /* * Test whether the current transaction context is valid and, if so, @@ -166,8 +164,8 @@ extern void stmAddInvariantToCheck(Capability *cap, * been committed to. */ -extern StgBool stmCommitTransaction(Capability *cap, StgTRecHeader *trec); -extern StgBool stmCommitNestedTransaction(Capability *cap, StgTRecHeader *trec); +StgBool stmCommitTransaction(Capability *cap, StgTRecHeader *trec); +StgBool stmCommitNestedTransaction(Capability *cap, StgTRecHeader *trec); /* * Test whether the current transaction context is valid and, if so, @@ -176,11 +174,9 @@ extern StgBool stmCommitNestedTransaction(Capability *cap, StgTRecHeader *trec); * if the thread is already waiting. */ -extern StgBool stmWait(Capability *cap, - StgTSO *tso, - StgTRecHeader *trec); +StgBool stmWait(Capability *cap, StgTSO *tso, StgTRecHeader *trec); -extern void stmWaitUnlock(Capability *cap, StgTRecHeader *trec); +void stmWaitUnlock(Capability *cap, StgTRecHeader *trec); /* * Test whether the current transaction context is valid and, if so, @@ -190,7 +186,7 @@ extern void stmWaitUnlock(Capability *cap, StgTRecHeader *trec); * thread is not waiting. */ -extern StgBool stmReWait(Capability *cap, StgTSO *tso); +StgBool stmReWait(Capability *cap, StgTSO *tso); /*---------------------------------------------------------------------- @@ -198,8 +194,7 @@ extern StgBool stmReWait(Capability *cap, StgTSO *tso); -------------------------- */ -extern StgTVar *stmNewTVar(Capability *cap, - StgClosure *new_value); +StgTVar *stmNewTVar(Capability *cap, StgClosure *new_value); /*---------------------------------------------------------------------- @@ -212,18 +207,18 @@ extern StgTVar *stmNewTVar(Capability *cap, * thread's current transaction. */ -extern StgClosure *stmReadTVar(Capability *cap, - StgTRecHeader *trec, - StgTVar *tvar); +StgClosure *stmReadTVar(Capability *cap, + StgTRecHeader *trec, + StgTVar *tvar); /* Update the logical contents of 'tvar' within the context of the * thread's current transaction. */ -extern void stmWriteTVar(Capability *cap, - StgTRecHeader *trec, - StgTVar *tvar, - StgClosure *new_value); +void stmWriteTVar(Capability *cap, + StgTRecHeader *trec, + StgTVar *tvar, + StgClosure *new_value); /*----------------------------------------------------------------------*/ @@ -237,9 +232,7 @@ extern void stmWriteTVar(Capability *cap, /*----------------------------------------------------------------------*/ -#ifdef __cplusplus -} -#endif +#pragma GCC visibility pop #endif /* STM_H */ diff --git a/rts/Sanity.h b/rts/Sanity.h index 3020246a70..f27c395c44 100644 --- a/rts/Sanity.h +++ b/rts/Sanity.h @@ -11,6 +11,8 @@ #ifdef DEBUG +#pragma GCC visibility push(hidden) + # if defined(PAR) # define PVM_PE_MASK 0xfffc0000 # define MAX_PVM_PES MAX_PES @@ -19,23 +21,22 @@ # endif /* debugging routines */ -extern void checkHeap ( bdescr *bd ); -extern void checkHeapChunk ( StgPtr start, StgPtr end ); -extern void checkLargeObjects ( bdescr *bd ); -extern void checkTSO ( StgTSO* tso ); -extern void checkGlobalTSOList ( rtsBool checkTSOs ); -extern void checkStaticObjects ( StgClosure* static_objects ); -extern void checkStackChunk ( StgPtr sp, StgPtr stack_end ); -extern StgOffset checkStackFrame ( StgPtr sp ); -extern StgOffset checkClosure ( StgClosure* p ); - -extern void checkMutableList ( bdescr *bd, nat gen ); -extern void checkMutableLists ( rtsBool checkTSOs ); - -extern void checkBQ (StgTSO *bqe, StgClosure *closure); - -/* test whether an object is already on update list */ -extern rtsBool isBlackhole( StgTSO* tso, StgClosure* p ); +void checkHeap ( bdescr *bd ); +void checkHeapChunk ( StgPtr start, StgPtr end ); +void checkLargeObjects ( bdescr *bd ); +void checkTSO ( StgTSO* tso ); +void checkGlobalTSOList ( rtsBool checkTSOs ); +void checkStaticObjects ( StgClosure* static_objects ); +void checkStackChunk ( StgPtr sp, StgPtr stack_end ); +StgOffset checkStackFrame ( StgPtr sp ); +StgOffset checkClosure ( StgClosure* p ); + +void checkMutableList ( bdescr *bd, nat gen ); +void checkMutableLists ( rtsBool checkTSOs ); + +void checkBQ (StgTSO *bqe, StgClosure *closure); + +#pragma GCC visibility pop #endif /* DEBUG */ diff --git a/rts/Schedule.h b/rts/Schedule.h index 378bd68c66..c83b6fdcb6 100644 --- a/rts/Schedule.h +++ b/rts/Schedule.h @@ -14,6 +14,8 @@ #include "Capability.h" #include "eventlog/EventLog.h" +#pragma GCC visibility push(hidden) + /* initScheduler(), exitScheduler() * Called from STG : no * Locks assumed : none @@ -239,5 +241,7 @@ emptyThreadQueues(Capability *cap) #endif /* !IN_STG_CODE */ +#pragma GCC visibility pop + #endif /* SCHEDULE_H */ diff --git a/rts/Sparks.h b/rts/Sparks.h index df037b5c4f..25affbbe55 100644 --- a/rts/Sparks.h +++ b/rts/Sparks.h @@ -11,6 +11,8 @@ #include "WSDeque.h" +#pragma GCC visibility push(hidden) + /* typedef for SparkPool in RtsTypes.h */ #if defined(THREADED_RTS) @@ -63,4 +65,6 @@ INLINE_HEADER void discardSparks (SparkPool *pool) #endif // THREADED_RTS +#pragma GCC visibility pop + #endif /* SPARKS_H */ diff --git a/rts/Stable.h b/rts/Stable.h index 258a6bea80..b1b25ff62f 100644 --- a/rts/Stable.h +++ b/rts/Stable.h @@ -17,7 +17,9 @@ #include "sm/GC.h" // for evac_fn below -void freeStablePtr (StgStablePtr sp); +#pragma GCC visibility push(hidden) + +void freeStablePtr ( StgStablePtr sp ); void initStablePtrTable ( void ); void exitStablePtrTable ( void ); @@ -31,4 +33,6 @@ void updateStablePtrTable ( rtsBool full ); void stablePtrPreGC ( void ); void stablePtrPostGC ( void ); +#pragma GCC visibility pop + #endif /* STABLE_H */ diff --git a/rts/Stats.h b/rts/Stats.h index 4b98739fe2..234d64c7e3 100644 --- a/rts/Stats.h +++ b/rts/Stats.h @@ -11,6 +11,8 @@ #include "GetTime.h" +#pragma GCC visibility push(hidden) + void stat_startInit(void); void stat_endInit(void); @@ -59,5 +61,6 @@ Ticks stat_getElapsedTime(void); void statsPrintf( char *s, ... ) GNUC3_ATTRIBUTE(format (printf, 1, 2)); +#pragma GCC visibility pop #endif /* STATS_H */ diff --git a/rts/StgPrimFloat.h b/rts/StgPrimFloat.h index 5de8360efd..13d3a5965a 100644 --- a/rts/StgPrimFloat.h +++ b/rts/StgPrimFloat.h @@ -9,13 +9,17 @@ #ifndef STGPRIMFLOAT_H #define STGPRIMFLOAT_H +#pragma GCC visibility push(hidden) + /* grimy low-level support functions defined in StgPrimFloat.c */ -extern void __decodeDouble_2Int (I_ *man_sign, W_ *man_high, W_ *man_low, I_ *exp, StgDouble dbl); -extern void __decodeFloat_Int (I_ *man, I_ *exp, StgFloat flt); -extern StgDouble __2Int_encodeDouble (I_ j_high, I_ j_low, I_ e); -extern StgDouble __int_encodeDouble (I_ j, I_ e); -extern StgDouble __word_encodeDouble (W_ j, I_ e); -extern StgFloat __int_encodeFloat (I_ j, I_ e); -extern StgFloat __word_encodeFloat (W_ j, I_ e); +void __decodeDouble_2Int (I_ *man_sign, W_ *man_high, W_ *man_low, I_ *exp, StgDouble dbl); +void __decodeFloat_Int (I_ *man, I_ *exp, StgFloat flt); +StgDouble __2Int_encodeDouble (I_ j_high, I_ j_low, I_ e); +StgDouble __int_encodeDouble (I_ j, I_ e); +StgDouble __word_encodeDouble (W_ j, I_ e); +StgFloat __int_encodeFloat (I_ j, I_ e); +StgFloat __word_encodeFloat (W_ j, I_ e); + +#pragma GCC visibility pop #endif /* STGPRIMFLOAT_H */ diff --git a/rts/StgRun.h b/rts/StgRun.h index 12d1475d13..f277097df7 100644 --- a/rts/StgRun.h +++ b/rts/StgRun.h @@ -9,6 +9,6 @@ #ifndef STGRUN_H #define STGRUN_H -extern StgRegTable * StgRun(StgFunPtr f, StgRegTable *basereg); +RTS_PRIVATE StgRegTable * StgRun (StgFunPtr f, StgRegTable *basereg); #endif /* STGRUN_H */ diff --git a/rts/Task.h b/rts/Task.h index c11afb584c..b18bcfb600 100644 --- a/rts/Task.h +++ b/rts/Task.h @@ -11,6 +11,8 @@ #include "GetTime.h" +#pragma GCC visibility push(hidden) + /* Definition of a Task -------------------- @@ -259,4 +261,6 @@ taskEnter (Task *task) setMyTask(task); } +#pragma GCC visibility pop + #endif /* TASK_H */ diff --git a/rts/ThreadLabels.h b/rts/ThreadLabels.h index 60289ef306..550e2869e3 100644 --- a/rts/ThreadLabels.h +++ b/rts/ThreadLabels.h @@ -10,6 +10,8 @@ #ifndef THREADLABELS_H #define THREADLABELS_H +#pragma GCC visibility push(hidden) + #if defined(DEBUG) void initThreadLabelTable (void); void freeThreadLabelTable (void); @@ -19,4 +21,6 @@ void removeThreadLabel (StgWord key); void labelThread (StgPtr tso, char *label); #endif +#pragma GCC visibility pop + #endif /* THREADLABELS_H */ diff --git a/rts/ThreadPaused.h b/rts/ThreadPaused.h index 60cded2885..197b8d3257 100644 --- a/rts/ThreadPaused.h +++ b/rts/ThreadPaused.h @@ -9,6 +9,6 @@ #ifndef THREADPAUSED_H #define THREADPAUSED_H -void threadPaused ( Capability *cap, StgTSO * ); +RTS_PRIVATE void threadPaused ( Capability *cap, StgTSO * ); #endif /* THREADPAUSED_H */ diff --git a/rts/Threads.h b/rts/Threads.h index d17235a2cb..e58b0db993 100644 --- a/rts/Threads.h +++ b/rts/Threads.h @@ -9,6 +9,8 @@ #ifndef THREADS_H #define THREADS_H +#pragma GCC visibility push(hidden) + StgTSO * unblockOne (Capability *cap, StgTSO *tso); StgTSO * unblockOne_ (Capability *cap, StgTSO *tso, rtsBool allow_migrate); @@ -27,4 +29,6 @@ void printAllThreads (void); void printThreadQueue (StgTSO *t); #endif +#pragma GCC visibility pop + #endif /* THREADS_H */ diff --git a/rts/Ticker.h b/rts/Ticker.h index a39e7d69c1..159820d399 100644 --- a/rts/Ticker.h +++ b/rts/Ticker.h @@ -9,11 +9,15 @@ #ifndef TICKER_H #define TICKER_H +#pragma GCC visibility push(hidden) + typedef void (*TickProc)(int); -extern void initTicker (nat ms, TickProc handle_tick); -extern void startTicker (void); -extern void stopTicker (void); -extern void exitTicker (void); +void initTicker (nat ms, TickProc handle_tick); +void startTicker (void); +void stopTicker (void); +void exitTicker (void); + +#pragma GCC visibility pop #endif /* TICKER_H */ diff --git a/rts/Ticky.h b/rts/Ticky.h index c8da50a940..a32a7a6542 100644 --- a/rts/Ticky.h +++ b/rts/Ticky.h @@ -9,6 +9,6 @@ #ifndef TICKY_H #define TICKY_H -void PrintTickyInfo(void); +RTS_PRIVATE void PrintTickyInfo(void); #endif /* TICKY_H */ diff --git a/rts/Timer.h b/rts/Timer.h index c679a5881a..f0b5459912 100644 --- a/rts/Timer.h +++ b/rts/Timer.h @@ -9,7 +9,7 @@ #ifndef TIMER_H #define TIMER_H -void initTimer (void); -void exitTimer (void); +RTS_PRIVATE void initTimer (void); +RTS_PRIVATE void exitTimer (void); #endif /* TIMER_H */ diff --git a/rts/Trace.h b/rts/Trace.h index fc19e8957a..8820075bea 100644 --- a/rts/Trace.h +++ b/rts/Trace.h @@ -16,6 +16,8 @@ #ifndef TRACE_H #define TRACE_H +#pragma GCC visibility push(hidden) + // ----------------------------------------------------------------------------- // Tracing functions // ----------------------------------------------------------------------------- @@ -88,4 +90,6 @@ traceClass (StgWord32 class) { return (classes_enabled & class); } // ----------------------------------------------------------------------------- +#pragma GCC visibility pop + #endif /* TRACE_H */ diff --git a/rts/Updates.h b/rts/Updates.h index 843be84131..3b37409476 100644 --- a/rts/Updates.h +++ b/rts/Updates.h @@ -9,6 +9,8 @@ #ifndef UPDATES_H #define UPDATES_H +#pragma GCC visibility push(hidden) + /* ----------------------------------------------------------------------------- Updates @@ -225,4 +227,7 @@ no_slop: } \ } #endif /* CMINUSMINUS */ + +#pragma GCC visibility pop + #endif /* UPDATES_H */ diff --git a/rts/Weak.h b/rts/Weak.h index 4f60bf9ebd..2c831d830e 100644 --- a/rts/Weak.h +++ b/rts/Weak.h @@ -11,6 +11,8 @@ #include "Capability.h" +#pragma GCC visibility push(hidden) + extern rtsBool running_finalizers; extern StgWeak * weak_ptr_list; @@ -19,5 +21,7 @@ void runAllCFinalizers(StgWeak *w); void scheduleFinalizers(Capability *cap, StgWeak *w); void markWeakList(void); +#pragma GCC visibility pop + #endif /* WEAK_H */ diff --git a/rts/eventlog/EventLog.h b/rts/eventlog/EventLog.h index 10903709d8..0358256357 100644 --- a/rts/eventlog/EventLog.h +++ b/rts/eventlog/EventLog.h @@ -12,6 +12,8 @@ #include "rts/EventLogFormat.h" #include "Capability.h" +#pragma GCC visibility push(hidden) + #ifdef EVENTLOG /* @@ -49,4 +51,6 @@ INLINE_HEADER void postEvent(Capability *cap STG_UNUSED, #endif +#pragma GCC visibility pop + #endif /* EVENTLOG_H */ diff --git a/rts/posix/FileLock.h b/rts/posix/FileLock.h index 2edee5ba6e..508cee8455 100644 --- a/rts/posix/FileLock.h +++ b/rts/posix/FileLock.h @@ -9,7 +9,7 @@ #ifndef POSIX_FILELOCK_H #define POSIX_FILELOCK_H -void initFileLocking(void); -void freeFileLocking(void); +RTS_PRIVATE void initFileLocking(void); +RTS_PRIVATE void freeFileLocking(void); #endif /* POSIX_FILELOCK_H */ diff --git a/rts/posix/Itimer.h b/rts/posix/Itimer.h index 4cae935710..b67c8c442e 100644 --- a/rts/posix/Itimer.h +++ b/rts/posix/Itimer.h @@ -9,6 +9,6 @@ #ifndef ITIMER_H #define ITIMER_H -extern lnat getourtimeofday ( void ); +RTS_PRIVATE lnat getourtimeofday ( void ); #endif /* ITIMER_H */ diff --git a/rts/posix/Signals.h b/rts/posix/Signals.h index e1d550fdad..30bc63ee46 100644 --- a/rts/posix/Signals.h +++ b/rts/posix/Signals.h @@ -13,7 +13,9 @@ # include <signal.h> #endif -extern rtsBool anyUserHandlers(void); +#pragma GCC visibility push(hidden) + +rtsBool anyUserHandlers(void); #if !defined(THREADED_RTS) extern siginfo_t pending_handler_buf[]; @@ -24,5 +26,7 @@ void startSignalHandlers(Capability *cap); extern StgInt *signal_handlers; +#pragma GCC visibility pop + #endif /* POSIX_SIGNALS_H */ diff --git a/rts/posix/TTY.h b/rts/posix/TTY.h index f291d30de4..7b8e16bb92 100644 --- a/rts/posix/TTY.h +++ b/rts/posix/TTY.h @@ -9,7 +9,6 @@ #ifndef POSIX_TTY_H #define POSIX_TTY_H -void resetTerminalSettings (void); +RTS_PRIVATE void resetTerminalSettings (void); #endif /* POSIX_TTY_H */ - diff --git a/rts/sm/BlockAlloc.h b/rts/sm/BlockAlloc.h index 776df9b627..86836e40b4 100644 --- a/rts/sm/BlockAlloc.h +++ b/rts/sm/BlockAlloc.h @@ -9,16 +9,20 @@ #ifndef BLOCK_ALLOC_H #define BLOCK_ALLOC_H +#pragma GCC visibility push(hidden) + /* Debugging -------------------------------------------------------------- */ #ifdef DEBUG -extern void checkFreeListSanity(void); -nat countFreeList(void); -void markBlocks (bdescr *bd); -void reportUnmarkedBlocks (void); +void checkFreeListSanity(void); +nat countFreeList(void); +void markBlocks (bdescr *bd); +void reportUnmarkedBlocks (void); #endif extern lnat n_alloc_blocks; // currently allocated blocks extern lnat hw_alloc_blocks; // high-water allocated blocks +#pragma GCC visibility pop + #endif /* BLOCK_ALLOC_H */ diff --git a/rts/sm/Compact.h b/rts/sm/Compact.h index 7a237ac362..1e89ad36a8 100644 --- a/rts/sm/Compact.h +++ b/rts/sm/Compact.h @@ -14,6 +14,8 @@ #ifndef SM_COMPACT_H #define SM_COMPACT_H +#pragma GCC visibility push(hidden) + INLINE_HEADER rtsBool mark_stack_empty(void) { @@ -74,6 +76,8 @@ is_marked(StgPtr p, bdescr *bd) return (*bitmap_word & bit_mask); } -extern void compact (StgClosure *static_objects); +void compact (StgClosure *static_objects); + +#pragma GCC visibility pop #endif /* SM_COMPACT_H */ diff --git a/rts/sm/Evac.h b/rts/sm/Evac.h index 78d024f3e9..ca5032f772 100644 --- a/rts/sm/Evac.h +++ b/rts/sm/Evac.h @@ -14,6 +14,8 @@ #ifndef SM_EVAC_H #define SM_EVAC_H +#pragma GCC visibility push(hidden) + // Use a register argument for evacuate, if available. // Earlier, the regparm attribute was used whenever __GNUC__ >= 2, but this // generated warnings on PPC. So the use is restricted further. @@ -35,5 +37,7 @@ REGPARM1 void evacuate1 (StgClosure **p); extern lnat thunk_selector_depth; +#pragma GCC visibility pop + #endif /* SM_EVAC_H */ diff --git a/rts/sm/GC.h b/rts/sm/GC.h index e746f092e5..2435c6cd4b 100644 --- a/rts/sm/GC.h +++ b/rts/sm/GC.h @@ -14,6 +14,8 @@ #ifndef SM_GC_H #define SM_GC_H +#pragma GCC visibility push(hidden) + void GarbageCollect(rtsBool force_major_gc, nat gc_type, Capability *cap); typedef void (*evac_fn)(void *user, StgClosure **root); @@ -56,4 +58,6 @@ void releaseGCThreads (Capability *cap); #define WORK_UNIT_WORDS 128 +#pragma GCC visibility pop + #endif /* SM_GC_H */ diff --git a/rts/sm/GCThread.h b/rts/sm/GCThread.h index 9188a20a9a..44ea537cda 100644 --- a/rts/sm/GCThread.h +++ b/rts/sm/GCThread.h @@ -16,6 +16,8 @@ #include "WSDeque.h" +#pragma GCC visibility push(hidden) + /* ----------------------------------------------------------------------------- General scheme @@ -270,5 +272,7 @@ extern StgWord8 the_gc_thread[]; #endif +#pragma GCC visibility pop + #endif // SM_GCTHREAD_H diff --git a/rts/sm/GCUtils.h b/rts/sm/GCUtils.h index d68ce7876f..c8f8d55c60 100644 --- a/rts/sm/GCUtils.h +++ b/rts/sm/GCUtils.h @@ -14,6 +14,8 @@ #ifndef SM_GCUTILS_H #define SM_GCUTILS_H +#pragma GCC visibility push(hidden) + bdescr *allocBlock_sync(void); void freeChain_sync(bdescr *bd); @@ -59,4 +61,6 @@ recordMutableGen_GC (StgClosure *p, nat gen_no) *bd->free++ = (StgWord)p; } +#pragma GCC visibility pop + #endif /* SM_GCUTILS_H */ diff --git a/rts/sm/MarkWeak.h b/rts/sm/MarkWeak.h index 2647a22eec..7fd81e536b 100644 --- a/rts/sm/MarkWeak.h +++ b/rts/sm/MarkWeak.h @@ -14,6 +14,8 @@ #ifndef SM_MARKWEAK_H #define SM_MARKWEAK_H +#pragma GCC visibility push(hidden) + extern StgWeak *old_weak_ptr_list; extern StgTSO *resurrected_threads; extern StgTSO *exception_threads; @@ -23,4 +25,6 @@ rtsBool traverseWeakPtrList ( void ); void markWeakPtrList ( void ); rtsBool traverseBlackholeQueue ( void ); +#pragma GCC visibility pop + #endif /* SM_MARKWEAK_H */ diff --git a/rts/sm/OSMem.h b/rts/sm/OSMem.h index 3dbca23d11..92fe350045 100644 --- a/rts/sm/OSMem.h +++ b/rts/sm/OSMem.h @@ -9,10 +9,14 @@ #ifndef SM_OSMEM_H #define SM_OSMEM_H +#pragma GCC visibility push(hidden) + void osMemInit(void); void *osGetMBlocks(nat n); void osFreeAllMBlocks(void); lnat getPageSize (void); void setExecutable (void *p, lnat len, rtsBool exec); +#pragma GCC visibility pop + #endif /* SM_OSMEM_H */ diff --git a/rts/sm/Scav.h b/rts/sm/Scav.h index 10b9ffde40..259fe1289a 100644 --- a/rts/sm/Scav.h +++ b/rts/sm/Scav.h @@ -14,6 +14,8 @@ #ifndef SM_SCAV_H #define SM_SCAV_H +#pragma GCC visibility push(hidden) + void scavenge_loop (void); void scavenge_mutable_list (bdescr *bd, generation *gen); void scavenge_capability_mut_lists (Capability *cap); @@ -24,5 +26,7 @@ void scavenge_mutable_list1 (bdescr *bd, generation *gen); void scavenge_capability_mut_Lists1 (Capability *cap); #endif +#pragma GCC visibility pop + #endif /* SM_SCAV_H */ diff --git a/rts/sm/Storage.h b/rts/sm/Storage.h index c6aa45e162..ea744a7a74 100644 --- a/rts/sm/Storage.h +++ b/rts/sm/Storage.h @@ -9,6 +9,8 @@ #ifndef SM_STORAGE_H #define SM_STORAGE_H +#pragma GCC visibility push(hidden) + /* ----------------------------------------------------------------------------- Initialisation / De-initialisation -------------------------------------------------------------------------- */ @@ -166,4 +168,6 @@ void move_TSO (StgTSO *src, StgTSO *dest); extern StgClosure * caf_list; extern StgClosure * revertible_caf_list; +#pragma GCC visibility pop + #endif /* SM_STORAGE_H */ diff --git a/rts/sm/Sweep.h b/rts/sm/Sweep.h index 562a934faa..f540cb3509 100644 --- a/rts/sm/Sweep.h +++ b/rts/sm/Sweep.h @@ -14,6 +14,6 @@ #ifndef SM_SWEEP_H #define SM_SWEEP_H -void sweep(step *gen); +RTS_PRIVATE void sweep(step *gen); #endif /* SM_SWEEP_H */ |