X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=ghc%2Fincludes%2FPrimOps.h;h=ecc82bc1c02d1957705085b59dabc0a136831357;hp=646f38413015bba5f357fc0c2ae6b4a357fa542d;hb=d89872a45b581ba3f086c636126a44d97ef45be6;hpb=2409537b90c4915174a67ea0f09b9389d9aad12f diff --git a/ghc/includes/PrimOps.h b/ghc/includes/PrimOps.h index 646f384..ecc82bc 100644 --- a/ghc/includes/PrimOps.h +++ b/ghc/includes/PrimOps.h @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: PrimOps.h,v 1.94 2002/06/03 11:31:55 simonmar Exp $ + * $Id: PrimOps.h,v 1.102 2003/06/19 10:42:24 simonmar Exp $ * * (c) The GHC Team, 1998-2000 * @@ -48,11 +48,11 @@ #if SIZEOF_VOID_P == 4 #ifdef WORDS_BIGENDIAN -#define C 0 -#define R 1 +#define RTS_CARRY_IDX__ 0 +#define RTS_REM_IDX__ 1 #else -#define C 1 -#define R 0 +#define RTS_CARRY_IDX__ 1 +#define RTS_REM_IDX__ 0 #endif typedef union { @@ -65,8 +65,8 @@ typedef union { StgInt32 r, c; \ long_long_u z; \ z.l = (StgInt64)a * (StgInt64)b; \ - r = z.i[R]; \ - c = z.i[C]; \ + r = z.i[RTS_REM_IDX__]; \ + c = z.i[RTS_CARRY_IDX__]; \ if (c == 0 || c == -1) { \ c = ((StgWord)((a^b) ^ r)) \ >> (BITS_IN (I_) - 1); \ @@ -78,9 +78,6 @@ typedef union { * you test it thoroughly after changing it. */ -#undef C -#undef R - #else #define HALF_INT (((I_)1) << (BITS_IN (I_) / 2)) @@ -221,7 +218,7 @@ extern StgInt isFloatNegativeZero(StgFloat f); -------------------------------------------------------------------------- */ EXTFUN_RTS(newMutVarzh_fast); - +EXTFUN_RTS(atomicModifyMutVarzh_fast); /* ----------------------------------------------------------------------------- MVar PrimOps. @@ -244,6 +241,10 @@ EXTFUN_RTS(tryPutMVarzh_fast); EXTFUN_RTS(waitReadzh_fast); EXTFUN_RTS(waitWritezh_fast); EXTFUN_RTS(delayzh_fast); +#ifdef mingw32_TARGET_OS +EXTFUN_RTS(asyncReadzh_fast); +EXTFUN_RTS(asyncWritezh_fast); +#endif /* ----------------------------------------------------------------------------- @@ -252,8 +253,9 @@ EXTFUN_RTS(delayzh_fast); EXTFUN_RTS(catchzh_fast); EXTFUN_RTS(raisezh_fast); +EXTFUN_RTS(raiseIOzh_fast); -extern void stg_exit(I_ n) __attribute__ ((noreturn)); +extern void stg_exit(int n) __attribute__ ((noreturn)); /* ----------------------------------------------------------------------------- @@ -279,10 +281,8 @@ EXTFUN_RTS(unblockAsyncExceptionszh_fast); EXTFUN_RTS(myThreadIdzh_fast); EXTFUN_RTS(labelThreadzh_fast); -extern int cmp_thread(const StgTSO *tso1, const StgTSO *tso2); -extern int rts_getThreadId(const StgTSO *tso); -extern void labelThread(StgTSO *tso, char *label); - +extern int cmp_thread(StgPtr tso1, StgPtr tso2); +extern int rts_getThreadId(StgPtr tso); /* ----------------------------------------------------------------------------- Weak Pointer PrimOps. @@ -319,22 +319,6 @@ EXTFUN_RTS(mkForeignObjzh_fast); EXTFUN_RTS(newBCOzh_fast); EXTFUN_RTS(mkApUpd0zh_fast); - -/* ----------------------------------------------------------------------------- - Signal handling. Not really primops, but called directly from Haskell. - -------------------------------------------------------------------------- */ - -#define STG_SIG_DFL (-1) -#define STG_SIG_IGN (-2) -#define STG_SIG_ERR (-3) -#define STG_SIG_HAN (-4) - -extern StgInt stg_sig_install (StgInt, StgInt, StgStablePtr, sigset_t *); -#define stg_sig_default(sig,mask) stg_sig_install(sig,STG_SIG_DFL,0,(sigset_t *)mask) -#define stg_sig_ignore(sig,mask) stg_sig_install(sig,STG_SIG_IGN,0,(sigset_t *)mask) -#define stg_sig_catch(sig,ptr,mask) stg_sig_install(sig,STG_SIG_HAN,ptr,(sigset_t *)mask) - - /* ------------------------------------------------------------------------ Parallel PrimOps