Commit 85046353 authored by simonmar's avatar simonmar

[project @ 2004-11-08 12:26:52 by simonmar]

Get rid of SUPPORTS_EMPTY_STRUCTS, and just avoid using empty struct
definitions.
parent 86e9447a
......@@ -1184,22 +1184,4 @@ AC_SUBST([GLUT_CFLAGS])
AC_SUBST([GLUT_LIBS])
])# FP_CHECK_GLUT
# FP_EMPTY_STRUCTS
# ----------------
# Define output variable SUPPORTS_EMPTY_STRUCTS if empty structs are accepted by
# CC.
dnl
AC_DEFUN(FP_EMPTY_STRUCTS,
[AC_CACHE_CHECK(empty struct support, fp_cv_empty_structs,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[typedef struct { /* empty */ } StgFoo;]],
[[int i;]])],
[fp_cv_empty_structs=yes],
[fp_cv_empty_structs=no])])
if test x"$fp_cv_empty_structs" = xyes; then
AC_DEFINE([SUPPORTS_EMPTY_STRUCTS], [1], [Define to 1 if C compiler supports declaration of empty structure types.])
fi
])
# LocalWords: fi
......@@ -1365,8 +1365,6 @@ esac
AC_SUBST(LdCmd)
FPTOOLS_LD_X
FP_EMPTY_STRUCTS
AC_CONFIG_FILES([mk/config.mk])
AC_CONFIG_COMMANDS([mk/stamp-h],[echo timestamp > mk/stamp-h])
AC_OUTPUT
# Initialise and check sanity.
AC_INIT([The Glorious Glasgow Haskell Compilation System], [6.3], [glasgow-haskell-bugs@haskell.org], [ghc])
AC_INIT([The Glorious Glasgow Haskell Compilation System], [6.3.20041107], [glasgow-haskell-bugs@haskell.org], [ghc])
AC_CONFIG_SRCDIR([ghc.spec.in])
FP_SETUP_PROJECT_INFO
......
/* ----------------------------------------------------------------------------
* $Id: InfoTables.h,v 1.34 2004/10/07 15:54:26 wolfgang Exp $
* $Id: InfoTables.h,v 1.35 2004/11/08 12:26:55 simonmar Exp $
*
* (c) The GHC Team, 1998-2002
*
......@@ -83,13 +83,9 @@ typedef struct {
/* -----------------------------------------------------------------------------
Ticky info
-------------------------------------------------------------------------- */
#if defined(SUPPORTS_EMPTY_STRUCTS)
typedef struct {
/* empty */
} StgTickyInfo;
#endif
There is no ticky-specific stuff in an info table at this time.
-------------------------------------------------------------------------- */
/* -----------------------------------------------------------------------------
Debugging info
......@@ -103,11 +99,7 @@ typedef struct {
#else /* !DEBUG_CLOSURE */
# if defined(SUPPORTS_EMPTY_STRUCTS)
typedef struct StgDebugInfo {
/* empty */
} StgDebugInfo;
# endif
// There is no DEBUG-specific stuff in an info table at this time.
#endif /* DEBUG_CLOSURE */
......@@ -259,10 +251,10 @@ typedef struct _StgInfoTable {
StgProfInfo prof;
#endif
#ifdef TICKY
MAYBE_EMPTY_STRUCT(StgTickyInfo,ticky)
// Ticky-specific stuff would go here.
#endif
#ifdef DEBUG_CLOSURE
MAYBE_EMPTY_STRUCT(StgDebugInfo,debug)
// Debug-specific stuff would go here.
#endif
StgClosureInfo layout; // closure layout info (one word)
......
......@@ -52,20 +52,6 @@ extern "C" {
#define STG_UNUSED GNUC3_ATTRIBUTE(__unused__)
/*
* Empty structures isn't supported by all, so to define
* empty structures, please protect the defn with an
* #if SUPPORTS_EMPTY_STRUCTS. Similarly for use,
* employ the macro MAYBE_EMPTY_STRUCT():
*
* MAYBE_EMPTY_STRUCT(structFoo, fieldName);
*/
#if SUPPORTS_EMPTY_STRUCTS
# define MAYBE_EMPTY_STRUCT(a,b) a b;
#else
# define MAYBE_EMPTY_STRUCT(a,b) /* empty */
#endif
/*
* We often want to know the size of something in units of an
* StgWord... (rounded up, of course!)
......
/*
Time-stamp: <Mon Mar 05 2001 22:39:27 Stardate: [-30]6284.72 hwloidl>
Time-stamp: <2004-11-08 12:17:01 simonmar>
RTS specific types.
*/
......@@ -41,6 +41,8 @@ typedef enum {
Types specific to the parallel runtime system.
*/
typedef ullong rtsTime;
#if defined(PAR)
/* types only needed in the parallel system */
typedef struct hashtable ParHashTable;
......@@ -50,7 +52,6 @@ typedef struct hashlist ParHashList;
// typedef W_ TIME;
// typedef GlobalTaskId Proc;
typedef int GlobalTaskId;
typedef ullong rtsTime;
typedef GlobalTaskId PEs;
typedef unsigned int rtsWeight;
typedef int rtsPacket;
......
/* -----------------------------------------------------------------------------
* $Id: TSO.h,v 1.36 2004/08/13 13:57:06 simonmar Exp $
* $Id: TSO.h,v 1.37 2004/11/08 12:26:57 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
......@@ -10,8 +10,6 @@
#ifndef TSO_H
#define TSO_H
#if defined(GRAN) || defined(PAR)
#if DEBUG
#define TSO_MAGIC 4321
#endif
......@@ -34,7 +32,16 @@ typedef struct {
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
......@@ -46,54 +53,25 @@ typedef struct {
/*
* PAR info in a TSO
*/
#ifdef PAR
typedef StgTSOStatBuf StgTSOParInfo;
#else
#ifdef SUPPORTS_EMPTY_STRUCTS
typedef struct {
/* empty */
} StgTSOParInfo;
#endif
#endif
/*
* DIST info in a TSO
*/
#ifdef DIST
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
*/
#ifdef GRAN
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.
......@@ -107,16 +85,6 @@ typedef StgWord32 StgThreadID;
*/
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)
/* results from an async I/O request + it's ID. */
typedef struct {
......@@ -170,15 +138,20 @@ typedef struct StgTSO_ {
struct StgMainThread_* main;
#ifdef TICKY_TICKY
MAYBE_EMPTY_STRUCT(StgTSOTickyInfo,ticky)
// TICKY-specific stuff would go here.
#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* */
......
......@@ -133,7 +133,7 @@
def_offset(str(s_type,field), OFFSET(s_type,field) - sizeof(StgHeader) - sizeof(StgTSOProfInfo));
#define tso_field_macro(str) \
printf("#define " str "(__ptr__) REP_" str "[__ptr__+SIZEOF_StgHeader+SIZEOF_OPT_StgTSOProfInfo+SIZEOF_OPT_StgTSOTickyInfo+SIZEOF_OPT_StgTSOParInfo+SIZEOF_OPT_StgTSOGranInfo+SIZEOF_OPT_StgTSODistInfo+OFFSET_" str "]\n");
printf("#define " str "(__ptr__) REP_" str "[__ptr__+SIZEOF_StgHeader+SIZEOF_OPT_StgTSOProfInfo+SIZEOF_OPT_StgTSOParInfo+SIZEOF_OPT_StgTSOGranInfo+SIZEOF_OPT_StgTSODistInfo+OFFSET_" str "]\n");
#define tso_field(s_type, field) \
tso_offset(s_type, field); \
......@@ -164,8 +164,9 @@ main(int argc, char *argv[])
printf("#define STD_ITBL_SIZE %d\n", sizeofW(StgInfoTable));
printf("#define RET_ITBL_SIZE %d\n", sizeofW(StgRetInfoTable) - sizeofW(StgInfoTable));
printf("#define PROF_ITBL_SIZE %d\n", sizeofW(StgProfInfo));
printf("#define GRAN_ITBL_SIZE %d\n", 0);
printf("#define TICKY_ITBL_SIZE %d\n", sizeofW(StgTickyInfo));
printf("#define TICKY_ITBL_SIZE %d\n", 0);
printf("#define BLOCK_SIZE %d\n", BLOCK_SIZE);
printf("#define MBLOCK_SIZE %d\n", MBLOCK_SIZE);
......@@ -258,13 +259,11 @@ main(int argc, char *argv[])
tso_field(StgTSO, stack_size);
struct_size(StgTSOProfInfo);
struct_size(StgTSOTickyInfo);
struct_size(StgTSOParInfo);
struct_size(StgTSOGranInfo);
struct_size(StgTSODistInfo);
opt_struct_size(StgTSOProfInfo,PROFILING);
opt_struct_size(StgTSOTickyInfo,TICKY_TICKY);
opt_struct_size(StgTSOParInfo,PAR);
opt_struct_size(StgTSOGranInfo,GRAN);
opt_struct_size(StgTSODistInfo,DIST);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment