projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[project @ 2005-01-28 12:55:17 by simonmar]
[ghc-hetmet.git]
/
ghc
/
includes
/
TSO.h
diff --git
a/ghc/includes/TSO.h
b/ghc/includes/TSO.h
index
87ea876
..
a0446b0
100644
(file)
--- a/
ghc/includes/TSO.h
+++ b/
ghc/includes/TSO.h
@@
-1,5
+1,5
@@
/* -----------------------------------------------------------------------------
/* -----------------------------------------------------------------------------
- * $Id: TSO.h,v 1.35 2004/08/13 13:09:40 simonmar Exp $
+ * $Id: TSO.h,v 1.40 2005/01/28 12:55:53 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
*
* (c) The GHC Team, 1998-1999
*
@@
-10,8
+10,6
@@
#ifndef TSO_H
#define TSO_H
#ifndef TSO_H
#define TSO_H
-#if defined(GRAN) || defined(PAR)
-
#if DEBUG
#define TSO_MAGIC 4321
#endif
#if DEBUG
#define TSO_MAGIC 4321
#endif
@@
-34,7
+32,16
@@
typedef struct {
StgInt localsparks;
rtsTime clock;
} StgTSOStatBuf;
StgInt localsparks;
rtsTime clock;
} StgTSOStatBuf;
-#endif
+
+/*
+ * GRAN: We distinguish between the various classes of threads in
+ * the system.
+ */
+typedef enum {
+ AdvisoryPriority,
+ MandatoryPriority,
+ RevalPriority
+} StgThreadPriority;
/*
* PROFILING info in a TSO
/*
* PROFILING info in a TSO
@@
-46,54
+53,25
@@
typedef struct {
/*
* PAR info in a TSO
*/
/*
* PAR info in a TSO
*/
-#ifdef PAR
typedef StgTSOStatBuf StgTSOParInfo;
typedef StgTSOStatBuf StgTSOParInfo;
-#else
-#ifdef SUPPORTS_EMPTY_STRUCTS
-typedef struct {
- /* empty */
-} StgTSOParInfo;
-#endif
-#endif
/*
* DIST info in a TSO
*/
/*
* DIST info in a TSO
*/
-#ifdef DIST
typedef struct {
StgThreadPriority priority;
StgInt revalTid; /* ToDo: merge both into 1 word */
StgInt revalSlot;
} StgTSODistInfo;
typedef struct {
StgThreadPriority priority;
StgInt revalTid; /* ToDo: merge both into 1 word */
StgInt revalSlot;
} StgTSODistInfo;
-#else
-#ifdef SUPPORTS_EMPTY_STRUCTS
-typedef struct {
- /* empty */
-} StgTSODistInfo;
-#endif
-#endif
/*
* GRAN info in a TSO
*/
/*
* GRAN info in a TSO
*/
-#ifdef GRAN
typedef StgTSOStatBuf StgTSOGranInfo;
typedef StgTSOStatBuf StgTSOGranInfo;
-#else
-#ifdef SUPPORTS_EMPTY_STRUCTS
-typedef struct {
- /* empty */
-} StgTSOGranInfo;
-#endif
-#endif
/*
/*
- * TICKY_TICKY info in a TSO
+ * There is no TICKY info in a TSO at this time.
*/
*/
-#ifdef SUPPORTS_EMPTY_STRUCTS
-typedef struct {
- /* empty */
-} StgTSOTickyInfo;
-#endif
/*
* Thread IDs are 32 bits.
/*
* Thread IDs are 32 bits.
@@
-107,17
+85,7
@@
typedef StgWord32 StgThreadID;
*/
typedef unsigned int StgThreadReturnCode;
*/
typedef unsigned int StgThreadReturnCode;
-/*
- * We distinguish between the various classes of threads in the system.
- */
-
-typedef enum {
- AdvisoryPriority,
- MandatoryPriority,
- RevalPriority
-} StgThreadPriority;
-
-#if defined(mingw32_TARGET_OS)
+#if defined(mingw32_HOST_OS)
/* results from an async I/O request + it's ID. */
typedef struct {
unsigned int reqID;
/* results from an async I/O request + it's ID. */
typedef struct {
unsigned int reqID;
@@
-129,11
+97,11
@@
typedef struct {
typedef union {
StgClosure *closure;
struct StgTSO_ *tso;
typedef union {
StgClosure *closure;
struct StgTSO_ *tso;
- int fd;
-#if defined(mingw32_TARGET_OS)
+ StgInt fd; // StgInt instead of int, so that it's the same size as the ptrs
+#if defined(mingw32_HOST_OS)
StgAsyncIOResult* async_result;
#endif
StgAsyncIOResult* async_result;
#endif
- unsigned int target;
+ StgWord target;
} StgTSOBlockInfo;
/*
} StgTSOBlockInfo;
/*
@@
-167,17
+135,24
@@
typedef struct StgTSO_ {
struct StgTSO_* blocked_exceptions;
StgThreadID id;
int saved_errno;
struct StgTSO_* blocked_exceptions;
StgThreadID id;
int saved_errno;
+ struct StgMainThread_* main;
+ struct StgTRecHeader_ *trec; // STM transaction record
#ifdef TICKY_TICKY
#ifdef TICKY_TICKY
- MAYBE_EMPTY_STRUCT(StgTSOTickyInfo,ticky)
+ // TICKY-specific stuff would go here.
#endif
#ifdef PROFILING
StgTSOProfInfo prof;
#endif
#endif
#ifdef PROFILING
StgTSOProfInfo prof;
#endif
-
- MAYBE_EMPTY_STRUCT(StgTSOParInfo,par);
- MAYBE_EMPTY_STRUCT(StgTSOGranInfo,gran);
- MAYBE_EMPTY_STRUCT(StgTSODistInfo,dist);
+#ifdef PAR
+ StgTSOParInfo par;
+#endif
+#ifdef GRAN
+ StgTSOGranInfo gran;
+#endif
+#ifdef DIST
+ StgTSODistInfo dist;
+#endif
/* The thread stack... */
StgWord stack_size; /* stack size in *words* */
/* The thread stack... */
StgWord stack_size; /* stack size in *words* */
@@
-209,6
+184,8
@@
typedef struct StgTSO_ {
BlockedOnBlackHole the BLACKHOLE_BQ the BLACKHOLE_BQ's queue
BlockedOnMVar the MVAR the MVAR's queue
BlockedOnBlackHole the BLACKHOLE_BQ the BLACKHOLE_BQ's queue
BlockedOnMVar the MVAR the MVAR's queue
+
+ BlockedOnSTM END_TSO_QUEUE STM wait queue(s)
BlockedOnException the TSO TSO->blocked_exception
BlockedOnException the TSO TSO->blocked_exception