summaryrefslogtreecommitdiff
path: root/rts/win32
diff options
context:
space:
mode:
authorTamar Christina <tamar@zhox.com>2016-12-05 21:27:23 +0000
committerTamar Christina <tamar@zhox.com>2016-12-06 07:01:23 +0000
commitb82f71b96660400b4b9fa7f3ccef9df7532bb2d7 (patch)
treec9dce3ffb9744f9af91bf07288442040309d0b26 /rts/win32
parent847d229346431483b99adcff12e46c7bf6af15da (diff)
downloadhaskell-b82f71b96660400b4b9fa7f3ccef9df7532bb2d7.tar.gz
Fix x86 Windows build and testsuite
Summary: Fix issues preventing x86 GHC to build on Windows and fix segfault in the testsuite. Test Plan: ./validate Reviewers: austin, erikd, simonmar, bgamari Reviewed By: bgamari Subscribers: #ghc_windows_task_force, thomie Differential Revision: https://phabricator.haskell.org/D2789
Diffstat (limited to 'rts/win32')
-rw-r--r--rts/win32/OSMem.c6
-rw-r--r--rts/win32/OSThreads.c18
2 files changed, 12 insertions, 12 deletions
diff --git a/rts/win32/OSMem.c b/rts/win32/OSMem.c
index b6b97a7199..2a542351ab 100644
--- a/rts/win32/OSMem.c
+++ b/rts/win32/OSMem.c
@@ -518,9 +518,9 @@ uint32_t osNumaNodes(void)
return numNumaNodes;
}
-StgWord osNumaMask(void)
+uint64_t osNumaMask(void)
{
- StgWord numaMask;
+ uint64_t numaMask;
if (!GetNumaNodeProcessorMask(0, &numaMask))
{
return 1;
@@ -561,7 +561,7 @@ void osBindMBlocksToNode(
}
else {
sysErrorBelch(
- "osBindMBlocksToNode: VirtualAllocExNuma MEM_RESERVE %llu bytes "
+ "osBindMBlocksToNode: VirtualAllocExNuma MEM_RESERVE %" FMT_Word " bytes "
"at address %p bytes failed",
size, addr);
}
diff --git a/rts/win32/OSThreads.c b/rts/win32/OSThreads.c
index 652ba13b4f..d2f867ccc7 100644
--- a/rts/win32/OSThreads.c
+++ b/rts/win32/OSThreads.c
@@ -328,6 +328,7 @@ getNumberOfProcessorsGroups (void)
return n_groups;
}
+#if x86_64_HOST_ARCH
static uint8_t*
getProcessorsDistribution (void)
{
@@ -342,7 +343,6 @@ getProcessorsDistribution (void)
cpuGroupDistCache = malloc(n_groups * sizeof(uint8_t));
memset(cpuGroupDistCache, MAXIMUM_PROCESSORS, n_groups * sizeof(uint8_t));
-#if x86_64_HOST_ARCH
/* We still support Windows Vista. Which means we can't rely
on the API being available. So we'll have to resolve manually. */
HMODULE kernel = GetModuleHandleW(L"kernel32");
@@ -357,11 +357,11 @@ getProcessorsDistribution (void)
IF_DEBUG(scheduler, debugBelch("[*] Number of active processors in group %u detected: %u\n", i, cpuGroupDistCache[i]));
}
}
-#endif
}
return cpuGroupDistCache;
}
+#endif
static uint32_t*
getProcessorsCumulativeSum(void)
@@ -376,10 +376,10 @@ getProcessorsCumulativeSum(void)
uint8_t n_groups = getNumberOfProcessorsGroups();
cpuGroupCumulativeCache = malloc(n_groups * sizeof(uint32_t));
memset(cpuGroupCumulativeCache, 0, n_groups * sizeof(uint32_t));
- uint8_t* proc_dist = getProcessorsDistribution();
- uint32_t cum_num_proc = 0;
#if x86_64_HOST_ARCH
+ uint8_t* proc_dist = getProcessorsDistribution();
+ uint32_t cum_num_proc = 0;
for (int i = 0; i < n_groups; i++)
{
cpuGroupCumulativeCache[i] = cum_num_proc;
@@ -593,11 +593,11 @@ void releaseThreadNode (void)
{
if (osNumaAvailable())
{
- StgWord processMask;
- StgWord systemMask;
+ PDWORD_PTR processMask = NULL;
+ PDWORD_PTR systemMask = NULL;
if (!GetProcessAffinityMask(GetCurrentProcess(),
- &processMask,
- &systemMask))
+ processMask,
+ systemMask))
{
sysErrorBelch(
"releaseThreadNode: Error resetting affinity of thread: %lu",
@@ -605,7 +605,7 @@ void releaseThreadNode (void)
stg_exit(EXIT_FAILURE);
}
- if (!SetThreadAffinityMask(GetCurrentThread(), processMask))
+ if (!SetThreadAffinityMask(GetCurrentThread(), *processMask))
{
sysErrorBelch(
"releaseThreadNode: Error reseting NUMA affinity mask of thread: %lu.",