summaryrefslogtreecommitdiff
path: root/rts/win32
Commit message (Collapse)AuthorAgeFilesLines
* Rename _closure to _static_closure, apply naming consistently.Edward Z. Yang2014-10-011-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: In preparation for indirecting all references to closures, we rename _closure to _static_closure to ensure any old code will get an undefined symbol error. In order to reference a closure foobar_closure (which is now undefined), you should instead use STATIC_CLOSURE(foobar). For convenience, a number of these old identifiers are macro'd. Across C-- and C (Windows and otherwise), there were differing conventions on whether or not foobar_closure or &foobar_closure was the address of the closure. Now, all foobar_closure references are addresses, and no & is necessary. CHARLIKE/INTLIKE were not changed, simply alpha-renamed. Part of remove HEAP_ALLOCED patch set (#8199) Depends on D265 Signed-off-by: Edward Z. Yang <ezyang@mit.edu> Test Plan: validate Reviewers: simonmar, austin Subscribers: simonmar, ezyang, carter, thomie Differential Revision: https://phabricator.haskell.org/D267 GHC Trac Issues: #8199
* Revert "rts: add Emacs 'Local Variables' to every .c file"Simon Marlow2014-09-2917-136/+0
| | | | This reverts commit 39b5c1cbd8950755de400933cecca7b8deb4ffcd.
* Fix cppcheck warningsBoris Egorov2014-09-161-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Cppcheck found a few defects in win32 IOManager and a typo in rts testsuite. This commit fixes them. Cppcheck 1.54 founds three possible null pointer dereferences of ioMan pointer. It is dereferenced and checked for NULL after that. testheapalloced.c contains typo in printf statement, which should print percent sign but treated as parameter placement by compiler. To properly print percent sign one need to use "%%" string. FYI: Cppcheck 1.66 cannot find possible null pointer dereferences in mentioned places, mistakenly thinking that some memory leaking instead. I probably fill a regression bug to Cppcheck. Test Plan: Build project, run 'make fulltest'. It finished with 28 unexpected failures. I don't know if they are related to my fix. Unexpected results from: TEST="T3500b T7891 tc124 T7653 T5321FD T5030 T4801 T6048 T5631 T5837 T5642 T9020 T3064 parsing001 T1969 T5321Fun T783 T3294" OVERALL SUMMARY for test run started at Tue Sep 9 16:46:27 2014 NOVT 4:23:24 spent to go through 4101 total tests, which gave rise to 16075 test cases, of which 3430 were skipped 315 had missing libraries 12154 expected passes 145 expected failures 3 caused framework failures 0 unexpected passes 28 unexpected failures Unexpected failures: ../../libraries/base/tests T7653 [bad exit code] (ghci,threaded1,threaded2) perf/compiler T1969 [stat not good enough] (normal) perf/compiler T3064 [stat not good enough] (normal) perf/compiler T3294 [stat not good enough] (normal) perf/compiler T4801 [stat not good enough] (normal) perf/compiler T5030 [stat not good enough] (normal) perf/compiler T5321FD [stat not good enough] (normal) perf/compiler T5321Fun [stat not good enough] (normal) perf/compiler T5631 [stat not good enough] (normal) perf/compiler T5642 [stat not good enough] (normal) perf/compiler T5837 [stat not good enough] (normal) perf/compiler T6048 [stat not good enough] (optasm) perf/compiler T783 [stat not good enough] (normal) perf/compiler T9020 [stat not good enough] (optasm) perf/compiler parsing001 [stat not good enough] (normal) typecheck/should_compile T7891 [exit code non-0] (hpc,optasm,optllvm) typecheck/should_compile tc124 [exit code non-0] (hpc,optasm,optllvm) typecheck/should_run T3500b [exit code non-0] (hpc,optasm,threaded2,dyn,optllvm) Reviewers: austin Reviewed By: austin Subscribers: simonmar, ezyang, carter Differential Revision: https://phabricator.haskell.org/D203
* Fix variable name typo from commit 3021fbNiklas Larsson2014-07-301-1/+1
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* rts: Detab OSThreads.cAustin Seipp2014-07-281-1/+1
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* rts: add Emacs 'Local Variables' to every .c fileAustin Seipp2014-07-2817-0/+136
| | | | | | | | This will hopefully help ensure some basic consistency in the forward by overriding buffer variables. In particular, it sets the wrap length, the offset to 4, and turns off tabs. Signed-off-by: Austin Seipp <austin@well-typed.com>
* rts: delint/detab/dewhitespace win32/WorkQueue.cAustin Seipp2014-07-281-26/+27
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* rts: delint/detab/dewhitespace win32/WorkQueue.hAustin Seipp2014-07-281-1/+1
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* rts: delint/detab/dewhitespace win32/ThrIOManager.cAustin Seipp2014-07-281-7/+7
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* rts: delint/detab/dewhitespace win32/OSThreads.cAustin Seipp2014-07-281-1/+2
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* rts: delint/detab/dewhitespace win32/OSMem.cAustin Seipp2014-07-281-15/+21
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* rts: delint/detab/dewhitespace win32/IOManager.cAustin Seipp2014-07-281-259/+286
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* rts: delint/detab/dewhitespace win32/IOManager.hAustin Seipp2014-07-281-26/+26
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* rts: delint/detab/dewhitespace win32/GetTime.cAustin Seipp2014-07-281-8/+8
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* rts: delint/detab/dewhitespace win32/GetEnv.cAustin Seipp2014-07-281-1/+1
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* rts: delint/detab/dewhitespace win32/ConsoleHandler.cAustin Seipp2014-07-281-87/+88
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* rts: delint/detab/dewhitespace win32/AwaitEvent.cAustin Seipp2014-07-281-3/+3
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* rts: delint/detab/dewhitespace win32/AsyncIO.hAustin Seipp2014-07-281-4/+4
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* rts: delint/detab/dewhitespace win32/AsyncIO.cAustin Seipp2014-07-281-150/+166
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* Raise exceptions when blocked in bad FDs (fixes Trac #4934)Sergei Trofimovich2014-06-081-2/+1
| | | | | | | | | | | | | | | Before the patch any call to 'select()' with 'bad_fd' led to: - unblocking of all threads - hiding exception for 'threadWaitRead bad_fd' The patch fixes both cases in this way: after 'select()' failure we iterate over each blocked descriptor and poll individually to see it's actual status, which is: - READY (move to run queue) - BLOCKED (leave in blocked queue) - INVALID (send an IOErrror exception) Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* Revert "Per-thread allocation counters and limits"Simon Marlow2014-05-041-1/+0
| | | | | | | | Problems were found on 32-bit platforms, I'll commit again when I have a fix. This reverts the following commits: 54b31f744848da872c7c6366dea840748e01b5cf b0534f78a73f972e279eed4447a5687bd6a8308e
* fix rts exported symbols base_GHCziIOziException_allocationLimitExceeded_closureSergei Trofimovich2014-05-031-0/+1
| | | | | | | | | | | | | | | | Commit b0534f78a73f972e279eed4447a5687bd6a8308e added new exported rts symbols, but slightly misspelled them. Observer on first compiled program: > Linking dist/build/haskell-updater/haskell-updater ... > /usr/lib64/ghc-7.9.20140503/rts-1.0/libHSrts.a(Schedule.o): In function `scheduleWaitThread': > (.text+0xc4c): undefined reference to `base_GHCziIOziException_allocationLimitExceeded_closure' > /usr/lib64/ghc-7.9.20140503/rts-1.0/libHSrts.a(RtsStartup.o): In function `hs_init_ghc': > (.text+0x2fa): undefined reference to `base_GHCziIOziException_allocationLimitExceeded_closure' > collect2: error: ld returned 1 exit status CC: Simon Marlow <marlowsd@gmail.com> Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* Untabify and delete trailing whitespace.Austin Seipp2013-10-261-23/+23
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* Fix Windows build.Austin Seipp2013-10-263-3/+5
| | | | | | | | | GlobalMemoryStatusEx actually requires _WIN32_WINNT to be defined as 0x0501 (Windows XP) for availability. For completeness, I bumped WIN32_WINNT in Ticker and OSThreads as well. Signed-off-by: Austin Seipp <austin@well-typed.com>
* rts: Add getPhysicalMemorySizeBen Gamari2013-10-251-0/+18
|
* Simplify some code; patch from Bill TuttIan Lynagh2013-02-171-1/+1
|
* Fix line endings in rts/win32/ThrIOManager.cIan Lynagh2013-02-171-159/+159
|
* Small refactoring; patch from nusIan Lynagh2013-02-161-9/+1
|
* Build fix for dyn way on Windows; patch from nusIan Lynagh2013-02-161-0/+1
|
* commentsSimon Marlow2013-02-071-1/+11
|
* Fix threadDelay on Windows; fixes ThreadDelay001 failuresIan Lynagh2013-02-061-2/+24
| | | | | | | | MSDN says of Sleep: If dwMilliseconds is greater than one tick but less than two, the wait can be anywhere between one and two ticks, and so on. so we need to add (milliseconds-per-tick - 1) to the amount of time we sleep for.
* Use usecs rather than msecs for microsecondsIan Lynagh2013-02-054-10/+10
| | | | We were using "us" elsewhere, so this was inconsistent.
* More OS X build fixesIan Lynagh2012-09-141-1/+1
|
* Deprecate lnat, and use StgWord insteadSimon Marlow2012-09-071-15/+15
| | | | | | | | | | | | lnat was originally "long unsigned int" but we were using it when we wanted a 64-bit type on a 64-bit machine. This broke on Windows x64, where long == int == 32 bits. Using types of unspecified size is bad, but what we really wanted was a type with N bits on an N-bit machine. StgWord is exactly that. lnat was mentioned in some APIs that clients might be using (e.g. StackOverflowHook()), so we leave it defined but with a comment to say that it's deprecated.
* New functions to get kernel thread Id + serialisable task IdDuncan Coutts2012-07-071-1/+7
| | | | | | | | | | | | | | | | | | | | On most platforms the userspace thread type (e.g. pthread_t) and kernel thread id are different. Normally we don't care about kernel thread Ids, but some system tools for tracing/profiling etc report kernel ids. For example Solaris and OSX's DTrace and Linux's perf tool report kernel thread ids. To be able to match these up with RTS's OSThread we need a way to get at the kernel thread, so we add a new function for to do just that (the implementation is system-dependent). Additionally, strictly speaking the OSThreadId type, used as task ids, is not a serialisable representation. On unix OSThreadId is a typedef for pthread_t, but pthread_t is not guaranteed to be a numeric type. Indeed on some systems pthread_t is a pointer and in principle it could be a structure type. So we add another new function to get a serialisable representation of an OSThreadId. This is only for use in log files. We use the function to serialise an id of a task, with the extra feature that it works in non-threaded builds by always returning 1.
* Fix the dynlib build on WindowsIan Lynagh2012-06-021-0/+1
| | | | | I have no idea why this worked when Word was in base, but doesn't after it moved to ghc-prim.
* Follow the move of the Word type to ghc-primIan Lynagh2012-05-221-1/+0
|
* Move getMonotonicUSec from base to the RTS.Paolo Capriotti2012-05-081-27/+47
|
* Fix RTS DLL references on Win64Ian Lynagh2012-05-061-0/+4
|
* Working towards fixing DLLs on Win64Ian Lynagh2012-05-061-1/+1
|
* Use lnats to avoid overflowing when allocating large amountsIan Lynagh2012-05-051-8/+8
| | | | Stops outofmem segfaulting on Win64
* Fix warnings on Win64Ian Lynagh2012-04-262-3/+3
| | | | | | Mostly this meant getting pointer<->int conversions to use the right sizes. lnat is now size_t, rather than unsigned long, as that seems a better match for how it's used.
* Fix the Win32 build: A CPP symbol name was wrongIan Lynagh2012-03-201-1/+1
|
* Fixes for the threaded RTS on Win64Ian Lynagh2012-03-181-1/+1
|
* For now, turn off the SEH code on Win64Ian Lynagh2012-03-161-1/+4
|
* Remove an unused variable; fixes a warning on Win64Ian Lynagh2012-03-161-3/+1
|
* Fix a real bug, exposed by my recent change to the rts_evalIO() API. Yay!Simon Marlow2011-12-091-2/+2
|
* Fix Windows buildSimon Marlow2011-12-091-1/+1
|
* Define getNumberOfProcessors() even when !THREADED_RTSSimon Marlow2011-12-071-0/+5
|
* Time handling overhaulSimon Marlow2011-11-252-147/+62
| | | | | | | | | | | | | | | | | | | | | Terminology cleanup: the type "Ticks" has been renamed "Time", which is an StgWord64 in units of TIME_RESOLUTION (currently nanoseconds). The terminology "tick" is now used consistently to mean the interval between timer signals. The ticker now always ticks in realtime (actually CLOCK_MONOTONIC if we have it). Before it used CPU time in the non-threaded RTS and realtime in the threaded RTS, but I've discovered that the CPU timer has terrible resolution (at least on Linux) and isn't much use for profiling. So now we always use realtime. This should also fix The default tick interval is now 10ms, except when profiling where we drop it to 1ms. This gives more accurate profiles without affecting runtime too much (<1%). Lots of cleanups - the resolution of Time is now in one place only (Rts.h) rather than having calculations that depend on the resolution scattered all over the RTS. I hope I found them all.