summaryrefslogtreecommitdiff
path: root/includes/SMP.h
Commit message (Collapse)AuthorAgeFilesLines
* RTS tidyup sweep, first phaseSimon Marlow2009-08-021-326/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The first phase of this tidyup is focussed on the header files, and in particular making sure we are exposinng publicly exactly what we need to, and no more. - Rts.h now includes everything that the RTS exposes publicly, rather than a random subset of it. - Most of the public header files have moved into subdirectories, and many of them have been renamed. But clients should not need to include any of the other headers directly, just #include the main public headers: Rts.h, HsFFI.h, RtsAPI.h. - All the headers needed for via-C compilation have moved into the stg subdirectory, which is self-contained. Most of the headers for the rest of the RTS APIs have moved into the rts subdirectory. - I left MachDeps.h where it is, because it is so widely used in Haskell code. - I left a deprecated stub for RtsFlags.h in place. The flag structures are now exposed by Rts.h. - Various internal APIs are no longer exposed by public header files. - Various bits of dead code and declarations have been removed - More gcc warnings are turned on, and the RTS code is more warning-clean. - More source files #include "PosixSource.h", and hence only use standard POSIX (1003.1c-1995) interfaces. There is a lot more tidying up still to do, this is just the first pass. I also intend to standardise the names for external RTS APIs (e.g use the rts_ prefix consistently), and declare the internal APIs as hidden for shared libraries.
* enable the x86-specific versions of atomic_inc()/atomic_dec()Simon Marlow2009-07-291-4/+4
|
* Add atomic_inc()/atomic_dec(), and use them to replace gc_running_mutexSimon Marlow2009-07-241-0/+72
| | | | | | This also fixes a memory leak on Windows with -threaded, because we were calling initMutex(&gc_running_mutex) for each GC, which allocates memory.
* Remove old GUM/GranSim codeSimon Marlow2009-06-021-1/+1
|
* update Sparc store/load barrier (#3019), and fix commentsSimon Marlow2009-02-121-3/+2
|
* comment wibblesSimon Marlow2009-02-111-2/+2
|
* NCG: Use sync instead of msync for a memory barrier for powerpcBen.Lippmeier@anu.edu.au2009-02-131-1/+1
| | | | | Darwin 9.6.0 + GCC 4.0.1 doesn't understand "msync". I think "sync" means the same thing.
* one more bugfix: a load/load memory barrier is required in stealWSDeque_()Simon Marlow2009-02-111-16/+37
|
* add a single-threaded version of cas()Simon Marlow2009-02-061-0/+11
|
* add a store/load memory barrierSimon Marlow2009-02-061-0/+25
|
* refactor: move unlockClosure() into SMPClosureOps() where it should beSimon Marlow2008-11-141-10/+0
|
* Omit definitions of cas() and xchg() in .hc codeSimon Marlow2008-11-141-0/+13
| | | | | They cause compilation errors (correctly) with newer gccs Shows up compiling the RTS via C, which happens on Windows
* Fix up inlines for gcc 4.3Simon Marlow2008-06-191-6/+6
| | | | | | | | | gcc 4.3 emits warnings for static inline functions that its heuristics decided not to inline. The workaround is to either mark appropriate functions as "hot" (a new attribute in gcc 4.3), or sometimes to use "extern inline" instead. With this fix I can validate with gcc 4.3 on Fedora 9.
* Do not #include external header files when compiling via CSimon Marlow2008-04-021-151/+3
| | | | | | | | | | | | | | | | | | | | | | | This has several advantages: - -fvia-C is consistent with -fasm with respect to FFI declarations: both bind to the ABI, not the API. - foreign calls can now be inlined freely across module boundaries, since a header file is not required when compiling the call. - bootstrapping via C will be more reliable, because this difference in behavour between the two backends has been removed. There is one disadvantage: - we get no checking by the C compiler that the FFI declaration is correct. So now, the c-includes field in a .cabal file is always ignored by GHC, as are header files specified in an FFI declaration. This was previously the case only for -fasm compilations, now it is also the case for -fvia-C too.
* Fix warnings with newer gcc versions (I hope)Simon Marlow2008-01-031-3/+3
|
* Make the threaded RTS compilable using -fasmSimon Marlow2007-06-261-1/+19
| | | | | We needed to turn some inline C functions and C macros into either real C functions or C-- macros.
* Fix PPC Mac OS X memory access problem in SMP.h (#1362)Thorkil Naur2007-05-181-1/+1
|
* cas(): modify assembly syntax to make it work everywhere (hopefully)Simon Marlow2006-11-211-1/+1
|
* use "lock cmpxchg" instead of "lock/cmpxchg"Simon Marlow2006-11-171-1/+1
| | | | | I'm not sure where the latter version came from, but it apparently doesn't generate a legal instruction on Solaris.
* rename spin lock functions, and use macros for non-THREADED_RTSSimon Marlow2006-10-261-9/+7
|
* add pure spin locksSimon Marlow2006-10-191-5/+134
|
* Add atomic SMP primitives for the SparcRoman Leshchinskiy2006-08-251-0/+18
|
* Fix unregisterised builds, and building on non-x86/amd64/powerpcIan Lynagh2006-08-251-8/+12
|
* fixes to PPC version of cas(), from David Kirkman <dkirkman@gmail.com>Simon Marlow2006-08-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | From David's email: The problem is that the inline assembler code was placing the result of an operation in a register that is used as input later in the code. At the bottom of this message I've extracted a short short code fragment that you can run through gcc (on a powerpc machine) to see the generated assembly output. The changes to fix the problem are fairly simple. The first adds an ampersand to the output list of the assembly fragment ("=r" (result) --> "=&r" (result)) The ampersand just tells gcc that result can not be placed in a register used for any of the input parameters (o, n, or p). Otherwise, it feels free to place output parameters in the same registers used by the inputs -- but because of the flow of control here we need everything in a distinct register. This change fixes the TVar program above. The second change adds a clobber list (the :"cc", "memory"). This tells gcc that the condition code (due to the compare) and memory (due to the store) might be changed during the asm execution. The lack of a clobber list did not seem to be causing any trouble, but without it gcc is free to assume that no state is changed during the execution.
* use the new "prim %write_barrier()" in .cmm instead of calls to wb()Simon Marlow2006-06-291-3/+3
|
* Asynchronous exception support for SMPSimon Marlow2006-06-161-0/+15
| | | | | | | | | | | | | | | | | This patch makes throwTo work with -threaded, and also refactors large parts of the concurrency support in the RTS to clean things up. We have some new files: RaiseAsync.{c,h} asynchronous exception support Threads.{c,h} general threading-related utils Some of the contents of these new files used to be in Schedule.c, which is smaller and cleaner as a result of the split. Asynchronous exception support in the presence of multiple running Haskell threads is rather tricky. In fact, to my annoyance there are still one or two bugs to track down, but the majority of the tests run now.
* Reorganisation of the source treeSimon Marlow2006-04-071-0/+160
Most of the other users of the fptools build system have migrated to Cabal, and with the move to darcs we can now flatten the source tree without losing history, so here goes. The main change is that the ghc/ subdir is gone, and most of what it contained is now at the top level. The build system now makes no pretense at being multi-project, it is just the GHC build system. No doubt this will break many things, and there will be a period of instability while we fix the dependencies. A straightforward build should work, but I haven't yet fixed binary/source distributions. Changes to the Building Guide will follow, too.