summaryrefslogtreecommitdiff
path: root/includes
Commit message (Collapse)AuthorAgeFilesLines
* includes/Stg.h: add declarations for hs_popcnt and frindsSergei Trofimovich2014-02-172-0/+40
| | | | | | | | | | | | | | This fixes most of implicit function declarations emitted C codegen in UNREG mode. Found by adding the following to mk/build.mk: SRC_CC_OPTS += -Werror=implicit-function-declaration SRC_HC_OPTS += -optc-Werror=implicit-function-declaration Issue #8748 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Signed-off-by: Austin Seipp <austin@well-typed.com>
* Fix --enable-unregistered by declaring missing RTS functions (#8748)Sergei Trofimovich2014-02-171-0/+2
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* Make `#include "Rts.h"` C++-compatible again (re #8676)Herbert Valerio Riedel2014-01-193-9/+9
| | | | Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Remove obsolete declarations from `MiscClosures.h`Herbert Valerio Riedel2014-01-131-33/+0
| | | | | | | | When `integer-gmp` was moved out of the RTS (via 1b61c2db6a8d6627577bcd7876474a0c5bd1eedb) these declarations were missed. Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Move the allocation of CAF blackholes into 'newCAF' (#8590)Patrick Palka2013-12-041-2/+2
| | | | | | | | | | We now do the allocation of the blackhole indirection closure inside the RTS procedure 'newCAF' instead of generating the allocation code inline in the closure body of each CAF. This slightly decreases code size in modules with a lot of CAFs. As a result of this change, for example, the size of DynFlags.o drops by ~60KB and HsExpr.o by ~100KB.
* Untab ClosureTypes.h and ClosureFlags.cPatrick Palka2013-12-041-38/+38
|
* Comment on StgArrWords vs StgArrBytesArash Rouhani2013-11-221-1/+8
| | | | | | | See #8552 Signed-off-by: Arash Rouhani <rarash@student.chalmers.se> Reviewed-by: Austin Seipp <austin@well-typed.com>
* GHCi: Properly generate jump code for ARM (#8380)Austin Seipp2013-11-221-0/+1
| | | | | | | | | | | | | | | | | | | | This adds code for jumping to given addresses for ARM, written by Ben Gamari. However, when allocating new infotables for bytecode (which is where this jump code occurs), we need to be sure to flush the cache on the execute pointer returned from allocateExec() - on systems like ARM, the processor won't reliably read back code or automatically cache flush, where x86 will. So we add a new flushExec primitive to call out to GCC's __builtin___clear_cache primitive, which will properly generate the correct code (nothing on x86, and a call to libgcc's __clear_cache on ARM) and make sure we use it after writing the code out. Authored-by: Ben Gamari <bgamari.foss@gmail.com> Authored-by: Austin Seipp <austin@well-typed.com> Signed-off-by: Austin Seipp <austin@well-typed.com>
* Grammar in commentsGabor Greif2013-11-221-1/+1
|
* Allow the linker to be used without retaining CAFs unconditionallySimon Marlow2013-11-211-2/+19
| | | | | | | | | This creates a new C API: initLinker_ (int retain_cafs) The old initLinker() was left as-is for backwards compatibility. See documentation in Linker.h.
* In the DEBUG rts, track when CAFs are GC'dSimon Marlow2013-11-212-2/+3
| | | | | | | | | | | | This resurrects some old code and makes it work again. The idea is that we want to get an error message if we ever enter a CAF that has been GC'd, rather than following its indirection which will likely cause a segfault. Without this patch, these bugs are hard to track down in gdb, because the IND_STATIC code overwrites R1 (the pointer to the CAF) with its indirectee before jumping into bad memory, so we've lost the address of the CAF that got GC'd. Some associated refactoring while I was here.
* Improve the shutdownHaskellAndSignal and add fast exitDuncan Coutts2013-11-141-6/+4
| | | | | | | | | | | | | | | | | | | | | This is the RTS part of a patch to base's topHandler to handle exiting by a signal. The intended behaviour is that on Unix, throwing ExitFailure (-sig) results in the process terminating with that signal. Previously shutdownHaskellAndSignal was only used for exiting with SIGINT due to the UserInterrupt exception. Improve shutdownHaskellAndSignal to do the signal part more carefully. In particular, it (should) now reliably terminates the process one way or another. Previusly if the signal was blocked, ignored or handled then shutdownHaskellAndSignal would actually return! Also, the topHandler code has two paths a careful shutdown and a "fast exit" where it does not give finalisers a chance to run. We want to support that mode also when we want to exit by signal. So rather than the base code directly calling stg_exit as it did before, we have a fastExit bool paramater for both shutdownHaskellAnd{Exit,Signal}.
* Linker.c: remove stablehash, which is no longer usedTakano Akio2013-10-251-3/+0
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* Placate clang (#8444, #8445)Austin Seipp2013-10-251-0/+2
| | | | | | | | Once again the whitespace rules (and the rules concerning expansion of tokens) have bitten us. Authored-by: Authored-by: Luke Iannini <lukexi@me.com> Signed-off-by: Austin Seipp <austin@well-typed.com>
* rts: Print correct stack size on stack overflowBen Gamari2013-10-251-1/+1
| | | | | This requires that stackOverflow() in RtsUtils.c be passed a reference to the current TSO. This requires a small change in libraries/base.
* Make integer overflow less likely to happen (#7762)Simon Marlow2013-10-251-0/+24
| | | | | | | | | | | | | | | The particular problematic code in #7762 was this: nat newSize = size - n; char *freeAddr = MBLOCK_ROUND_DOWN(bd->start); freeAddr += newSize * MBLOCK_SIZE; ^^^^^^^^^^^^^^^^^^^^^^ OVERFLOW!!! For good measure, I'm going to fix the bug twice. This patch fixes the class of bugs of this kind, by making sure that any expressions involving BLOCK_SIZE or MBLOCK_SIZE are promoted to unsigned long. In a separate patch, I'll fix a bunch of individual instances (including the one above).
* Another attempt to fix the conditions for slop-zeroingSimon Marlow2013-10-251-3/+6
| | | | | Also refactor the #defines to hopefully make it clearer what's going on.
* Fix building RtsProbes.d on Mac OS X 10.9 (#8139)Darin Morrison2013-10-111-1/+1
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* Fix up the conditions for zeroing slop (#8402)Simon Marlow2013-10-111-10/+26
|
* Use dynamic linking only if the GHC package is compiled with -dynamic (#8376)Simon Marlow2013-10-112-3/+10
|
* Globally replace "hackage.haskell.org" with "ghc.haskell.org"Simon Marlow2013-10-0143-46/+46
|
* Remove use of R9, and fix associated bugsSimon Marlow2013-10-012-13/+31
| | | | | | | | | | We were passing the function address to stg_gc_prim_p in R9, which was wrong because the call was a high-level call and didn't declare R9 as a parameter. Passing R9 as an argument is the right way, but unfortunately that exposed another bug: we were using the same macro in some low-level Cmm, where it is illegal to call functions with arguments (see Note [syntax of cmm files]). So we now have low-level variants of STK_CHK() and STK_CHK_P() for use in low-level Cmm code.
* Fix the definition of cas() on x86 (#8219)Patrick Palka2013-09-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | *p is both read and written to by the cmpxchg instruction, and therefore should be given the '+' constraint modifier. (In GCC's extended ASM language, '+' means that the operand is both read and written to whereas '=' means that it is only written to.) Otherwise, the compiler is allowed to rewrite something like SpinLock lock; initSpinLock(&lock); /* sets lock = 1 */ ACQUIRE_SPIN_LOCK(&lock); into SpinLock lock; ACQUIRE_SPIN_LOCK(&lock); because according to the asm statement, the previous value of 'lock' is not important.
* Fix linker_unload now that we are running constructors in the linker (#8291)Simon Marlow2013-09-231-0/+3
| | | | | | | See also #5435. Now we have to remember the the StablePtrs that get created by the module initializer so that we can free them again in unloadObj().
* Pass 512-bit-wide vectors in registers.Geoffrey Mainland2013-09-224-0/+122
|
* Add support for 512-bit-wide vectors.Geoffrey Mainland2013-09-223-17/+21
|
* Pass 256-bit-wide vectors in registers.Geoffrey Mainland2013-09-224-0/+122
|
* Add support for 256-bit-wide vectors.Geoffrey Mainland2013-09-223-17/+21
|
* Enable passing vector arguments in xmm registers on x86-32.Geoffrey Mainland2013-09-221-1/+6
| | | | | Note that this will only work with the LLVM back end pending LLVM patches to change the GHC calling convention appropriately.
* Ensure that globalRegMaybe returns accurate information for XMM registers.Geoffrey Mainland2013-09-221-1/+13
|
* Distinguish between hs-main cases when giving rtsopts advice.Edward Z. Yang2013-09-151-0/+5
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Fix freeHaskellFunPtr crash on iOS.Austin Seipp2013-09-151-0/+3
| | | | | Authored-by: Stephen Blackheath <...@blacksapphire.com> Signed-off-by: Austin Seipp <austin@well-typed.com>
* Revert "Default to infinite stack size (#8189)"Austin Seipp2013-09-083-13/+5
| | | | This reverts commit d85044f6b201eae0a9e453b89c0433608e0778f0.
* Default to infinite stack size (#8189)Austin Seipp2013-09-083-5/+13
| | | | | | | | | | | | | When servicing a stack overflows, only throw an exception to the given thread if the user explicitly set a max stack size, using +RTS -K. Otherwise just service it normally and grow the stack. In case we actually run out of *heap* (stack chuncks are allocated on the heap), then we need to bail by calling the stackOverflow() hook and exit immediately. Authored-by: Ben Gamari <bgamari.foss@gmail.com> Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Fix printf formats for pathchar on Windows (where it's wchar_t, not char)Simon Marlow2013-09-041-0/+2
|
* Merge branch 'master' into atomicsRyan Newton2013-08-311-3/+6
|\
| * In the non-threaded RTS, make *_barrier functions EXTERN_INLINE, not ↵Ryan Newton2013-08-211-3/+6
| | | | | | | | #define. (fixes #8077)
* | Eliminate atomic_inc_by and instead medofiy atomic_inc.Ryan Newton2013-08-211-27/+8
| |
* | Add PrimOp fetchAddIntArray# plus supporting C function atomic_inc_by.Ryan Newton2013-08-212-4/+29
| |
* | Add PrimOp: casIntArray#. Modify casMutVar# for 'ticketed' style.Ryan Newton2013-08-211-0/+1
| |
* | add casArray# primop, similar to casMutVar# but for array elementsRyan Newton2013-08-211-0/+1
|/
* Rename SSE -> XMM for consistency.Geoffrey Mainland2013-08-063-21/+21
| | | | | We were using SSE is some places and XMM in others. Better to keep a consistent naming scheme.
* adding FastString.string_table to the sharedCAF/Globals.c mechanismNicolas Frisby2013-07-161-0/+1
|
* Rename atomicReadMVar and friends to readMVar.Edward Z. Yang2013-07-121-4/+4
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Implement tryAtomicReadMVar#.Edward Z. Yang2013-07-101-0/+1
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Add LOCK_CLOSURE macro for use in C--, which inlines the capability check.Edward Z. Yang2013-07-101-9/+26
| | | | | | | | This patch also tweaks lockClosure to be INLINE_HEADER, so C-- clients don't accidentally use them and updates some other code which locks closures to do the capability check. Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Implement atomicReadMVar, fixing #4001.Edward Z. Yang2013-07-092-12/+16
| | | | | | | | | We add the invariant to the MVar blocked threads queue that threads blocked on an atomic read are always at the front of the queue. This invariant is easy to maintain, since takers are only ever added to the end of the queue. Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Fix build on OS XIan Lynagh2013-06-221-0/+4
|
* Fix #8009 : Failure to compile on powerpc64-linux.Erik de Castro Lopo2013-06-221-0/+4
| | | | Add definitions for stg_C_FINALIZER_LIST and n_capabilities.
* Add some missing clang bits to the build system.Austin Seipp2013-06-171-0/+5
| | | | Signed-off-by: Austin Seipp <aseipp@pobox.com>