summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorIavor S. Diatchki <iavor.diatchki@gmail.com>2014-07-19 14:29:57 -0700
committerIavor S. Diatchki <iavor.diatchki@gmail.com>2014-07-19 14:29:57 -0700
commit524634641c61ab42c555452f6f87119b27f6c331 (patch)
treef78d17bb6b09fb3b2e22cb4d93c2a3d45accc2d9 /includes
parent79ad1d20c5500e17ce5daaf93b171131669bddad (diff)
parentc41b716d82b1722f909979d02a76e21e9b68886c (diff)
downloadhaskell-wip/ext-solver.tar.gz
Merge branch 'master' into wip/ext-solverwip/ext-solver
Diffstat (limited to 'includes')
-rw-r--r--includes/CodeGen.Platform.hs2
-rw-r--r--includes/rts/Constants.h28
-rw-r--r--includes/rts/EventLogFormat.h4
-rw-r--r--includes/rts/storage/ClosureMacros.h5
-rw-r--r--includes/stg/MiscClosures.h1
-rw-r--r--includes/stg/SMP.h42
6 files changed, 46 insertions, 36 deletions
diff --git a/includes/CodeGen.Platform.hs b/includes/CodeGen.Platform.hs
index 3d6dd41ae4..62708cc4cc 100644
--- a/includes/CodeGen.Platform.hs
+++ b/includes/CodeGen.Platform.hs
@@ -742,6 +742,8 @@ globalRegMaybe CurrentTSO = Just (RealRegSingle REG_CurrentTSO)
globalRegMaybe CurrentNursery = Just (RealRegSingle REG_CurrentNursery)
# endif
globalRegMaybe _ = Nothing
+#elif MACHREGS_NO_REGS
+globalRegMaybe _ = Nothing
#else
globalRegMaybe = panic "globalRegMaybe not defined for this platform"
#endif
diff --git a/includes/rts/Constants.h b/includes/rts/Constants.h
index 842c37b369..6fd0dc0dfc 100644
--- a/includes/rts/Constants.h
+++ b/includes/rts/Constants.h
@@ -202,32 +202,34 @@
*/
#define NotBlocked 0
#define BlockedOnMVar 1
-#define BlockedOnMVarRead 2
-#define BlockedOnBlackHole 3
-#define BlockedOnRead 4
-#define BlockedOnWrite 5
-#define BlockedOnDelay 6
-#define BlockedOnSTM 7
+#define BlockedOnMVarRead 14 /* TODO: renumber me, see #9003 */
+#define BlockedOnBlackHole 2
+#define BlockedOnRead 3
+#define BlockedOnWrite 4
+#define BlockedOnDelay 5
+#define BlockedOnSTM 6
/* Win32 only: */
-#define BlockedOnDoProc 8
+#define BlockedOnDoProc 7
/* Only relevant for PAR: */
/* blocked on a remote closure represented by a Global Address: */
-#define BlockedOnGA 9
+#define BlockedOnGA 8
/* same as above but without sending a Fetch message */
-#define BlockedOnGA_NoSend 10
+#define BlockedOnGA_NoSend 9
/* Only relevant for THREADED_RTS: */
-#define BlockedOnCCall 11
-#define BlockedOnCCall_Interruptible 12
+#define BlockedOnCCall 10
+#define BlockedOnCCall_Interruptible 11
/* same as above but permit killing the worker thread */
/* Involved in a message sent to tso->msg_cap */
-#define BlockedOnMsgThrowTo 13
+#define BlockedOnMsgThrowTo 12
/* The thread is not on any run queues, but can be woken up
by tryWakeupThread() */
-#define ThreadMigrating 14
+#define ThreadMigrating 13
+
+/* WARNING WARNING top number is BlockedOnMVarRead 14, not 13!! */
/*
* These constants are returned to the scheduler by a thread that has
diff --git a/includes/rts/EventLogFormat.h b/includes/rts/EventLogFormat.h
index e08a44996f..a1e038f823 100644
--- a/includes/rts/EventLogFormat.h
+++ b/includes/rts/EventLogFormat.h
@@ -162,6 +162,8 @@
#define EVENT_TASK_MIGRATE 56 /* (taskID, cap, new_cap) */
#define EVENT_TASK_DELETE 57 /* (taskID) */
#define EVENT_USER_MARKER 58 /* (marker_name) */
+#define EVENT_HACK_BUG_T9003 59 /* Hack: see trac #9003 */
+
/* Range 59 - 59 is available for new GHC and common events. */
/* Range 60 - 80 is used by eden for parallel tracing
@@ -177,7 +179,7 @@
* ranges higher than this are reserved but not currently emitted by ghc.
* This must match the size of the EventDesc[] array in EventLog.c
*/
-#define NUM_GHC_EVENT_TAGS 59
+#define NUM_GHC_EVENT_TAGS 60
#if 0 /* DEPRECATED EVENTS: */
/* we don't actually need to record the thread, it's implicit */
diff --git a/includes/rts/storage/ClosureMacros.h b/includes/rts/storage/ClosureMacros.h
index 92b78de6f7..3407b716c8 100644
--- a/includes/rts/storage/ClosureMacros.h
+++ b/includes/rts/storage/ClosureMacros.h
@@ -338,6 +338,11 @@ EXTERN_INLINE StgWord bco_sizeW ( StgBCO *bco );
EXTERN_INLINE StgWord bco_sizeW ( StgBCO *bco )
{ return bco->size; }
+/*
+ * TODO: Consider to switch return type from 'nat' to 'StgWord' #8742
+ *
+ * (Also for 'closure_sizeW' below)
+ */
EXTERN_INLINE nat closure_sizeW_ (StgClosure *p, StgInfoTable *info);
EXTERN_INLINE nat
closure_sizeW_ (StgClosure *p, StgInfoTable *info)
diff --git a/includes/stg/MiscClosures.h b/includes/stg/MiscClosures.h
index 0c4d2f9eaf..ee5a119aa1 100644
--- a/includes/stg/MiscClosures.h
+++ b/includes/stg/MiscClosures.h
@@ -348,7 +348,6 @@ RTS_FUN_DECL(stg_newByteArrayzh);
RTS_FUN_DECL(stg_newPinnedByteArrayzh);
RTS_FUN_DECL(stg_newAlignedPinnedByteArrayzh);
RTS_FUN_DECL(stg_casIntArrayzh);
-RTS_FUN_DECL(stg_fetchAddIntArrayzh);
RTS_FUN_DECL(stg_newArrayzh);
RTS_FUN_DECL(stg_newArrayArrayzh);
RTS_FUN_DECL(stg_copyArrayzh);
diff --git a/includes/stg/SMP.h b/includes/stg/SMP.h
index 01663dd86e..00608c707c 100644
--- a/includes/stg/SMP.h
+++ b/includes/stg/SMP.h
@@ -107,7 +107,10 @@ EXTERN_INLINE StgWord
xchg(StgPtr p, StgWord w)
{
StgWord result;
-#if i386_HOST_ARCH || x86_64_HOST_ARCH
+#if defined(NOSMP)
+ result = *p;
+ *p = w;
+#elif i386_HOST_ARCH || x86_64_HOST_ARCH
result = w;
__asm__ __volatile__ (
// NB: the xchg instruction is implicitly locked, so we do not
@@ -154,9 +157,6 @@ xchg(StgPtr p, StgWord w)
: "r" (w), "r" (p)
: "memory"
);
-#elif !defined(WITHSMP)
- result = *p;
- *p = w;
#else
#error xchg() unimplemented on this architecture
#endif
@@ -170,7 +170,14 @@ xchg(StgPtr p, StgWord w)
EXTERN_INLINE StgWord
cas(StgVolatilePtr p, StgWord o, StgWord n)
{
-#if i386_HOST_ARCH || x86_64_HOST_ARCH
+#if defined(NOSMP)
+ StgWord result;
+ result = *p;
+ if (result == o) {
+ *p = n;
+ }
+ return result;
+#elif i386_HOST_ARCH || x86_64_HOST_ARCH
__asm__ __volatile__ (
"lock\ncmpxchg %3,%1"
:"=a"(o), "+m" (*(volatile unsigned int *)p)
@@ -225,13 +232,6 @@ cas(StgVolatilePtr p, StgWord o, StgWord n)
: "cc","memory");
return result;
-#elif !defined(WITHSMP)
- StgWord result;
- result = *p;
- if (result == o) {
- *p = n;
- }
- return result;
#else
#error cas() unimplemented on this architecture
#endif
@@ -302,7 +302,9 @@ busy_wait_nop(void)
*/
EXTERN_INLINE void
write_barrier(void) {
-#if i386_HOST_ARCH || x86_64_HOST_ARCH
+#if defined(NOSMP)
+ return;
+#elif i386_HOST_ARCH || x86_64_HOST_ARCH
__asm__ __volatile__ ("" : : : "memory");
#elif powerpc_HOST_ARCH
__asm__ __volatile__ ("lwsync" : : : "memory");
@@ -313,8 +315,6 @@ write_barrier(void) {
__asm__ __volatile__ ("" : : : "memory");
#elif arm_HOST_ARCH && !defined(arm_HOST_ARCH_PRE_ARMv7)
__asm__ __volatile__ ("dmb st" : : : "memory");
-#elif !defined(WITHSMP)
- return;
#else
#error memory barriers unimplemented on this architecture
#endif
@@ -322,7 +322,9 @@ write_barrier(void) {
EXTERN_INLINE void
store_load_barrier(void) {
-#if i386_HOST_ARCH
+#if defined(NOSMP)
+ return;
+#elif i386_HOST_ARCH
__asm__ __volatile__ ("lock; addl $0,0(%%esp)" : : : "memory");
#elif x86_64_HOST_ARCH
__asm__ __volatile__ ("lock; addq $0,0(%%rsp)" : : : "memory");
@@ -332,8 +334,6 @@ store_load_barrier(void) {
__asm__ __volatile__ ("membar #StoreLoad" : : : "memory");
#elif arm_HOST_ARCH && !defined(arm_HOST_ARCH_PRE_ARMv7)
__asm__ __volatile__ ("dmb" : : : "memory");
-#elif !defined(WITHSMP)
- return;
#else
#error memory barriers unimplemented on this architecture
#endif
@@ -341,7 +341,9 @@ store_load_barrier(void) {
EXTERN_INLINE void
load_load_barrier(void) {
-#if i386_HOST_ARCH
+#if defined(NOSMP)
+ return;
+#elif i386_HOST_ARCH
__asm__ __volatile__ ("" : : : "memory");
#elif x86_64_HOST_ARCH
__asm__ __volatile__ ("" : : : "memory");
@@ -352,8 +354,6 @@ load_load_barrier(void) {
__asm__ __volatile__ ("" : : : "memory");
#elif arm_HOST_ARCH && !defined(arm_HOST_ARCH_PRE_ARMv7)
__asm__ __volatile__ ("dmb" : : : "memory");
-#elif !defined(WITHSMP)
- return;
#else
#error memory barriers unimplemented on this architecture
#endif