Porting GHC to Barrelfish: rts.patch

File rts.patch, 105.1 KB (added by rmcilroy, 5 years ago)

Patch for the base runtime system and compiler

  • aclocal.m4

    Wed Aug 11 10:54:01 BST 2010  [email protected]
      * Checkpoint GHC on Barrelfish work
      
      Now at the stage where we can build and run a helloworld Haskell application on Barrelfish.
      
    Mon Aug  9 13:42:43 BST 2010  [email protected]
      * missing files from previous checkpoint of barrelfish port
    Mon Aug  9 10:49:02 BST 2010  [email protected]
      * Checkpoint Barrelfish compatability changes
    Thu Jul 29 14:53:26 BST 2010  [email protected]
      * Changes to get ghc building against Barrelfish
    diff -rN -u old-ghc_bf/aclocal.m4 new-ghc_bf-2/aclocal.m4
    old new  
    10451045AC_DEFUN([FP_CHECK_TIMER_CREATE],
    10461046  [AC_CACHE_CHECK([for a working timer_create(CLOCK_REALTIME)],
    10471047    [fptools_cv_timer_create_works],
    1048     [AC_TRY_RUN([
     1048    [AC_RUN_IFELSE([
    10491049#include <stdio.h>
    10501050#ifdef HAVE_STDLIB_H
    10511051#include <stdlib.h>
     
    11601160}
    11611161     ],
    11621162     [fptools_cv_timer_create_works=yes],
     1163     [fptools_cv_timer_create_works=no],
    11631164     [fptools_cv_timer_create_works=no])
    11641165  ])
    11651166case $fptools_cv_timer_create_works in
     
    13441345    $2="linux"
    13451346    ;;
    13461347  # As far as I'm aware, none of these have relevant variants
    1347   freebsd|netbsd|openbsd|dragonfly|osf1|osf3|hpux|linuxaout|kfreebsdgnu|freebsd2|solaris2|cygwin32|mingw32|darwin|gnu|nextstep2|nextstep3|sunos4|ultrix|irix|aix|haiku)
     1348  freebsd|netbsd|openbsd|dragonfly|osf1|osf3|hpux|linuxaout|kfreebsdgnu|freebsd2|solaris2|cygwin32|mingw32|darwin|gnu|nextstep2|nextstep3|sunos4|ultrix|irix|aix|haiku|barrelfish)
    13481349    $2="$1"
    13491350    ;;
    13501351  *)
  • compiler/main/DriverPipeline.hs

    diff -rN -u old-ghc_bf/compiler/main/DriverPipeline.hs new-ghc_bf-2/compiler/main/DriverPipeline.hs
    old new  
    15511551
    15521552    let
    15531553        thread_opts | WayThreaded `elem` ways = [
    1554 #if !defined(mingw32_TARGET_OS) && !defined(freebsd_TARGET_OS) && !defined(haiku_TARGET_OS)
     1554#if !defined(mingw32_TARGET_OS) && !defined(freebsd_TARGET_OS) && !defined(haiku_TARGET_OS) && !defined(barrelfish_TARGET_OS)
    15551555                        "-lpthread"
    15561556#endif
    15571557#if defined(osf3_TARGET_OS)
  • config.sub

    diff -rN -u old-ghc_bf/config.sub new-ghc_bf-2/config.sub
    old new  
    44#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
    55#   Free Software Foundation, Inc.
    66
    7 timestamp='2008-09-08'
     7timestamp='2010-07-22'
    88
    99# This file is (in principle) common to ALL GNU software.
    1010# The presence of a machine in this file suggests that SOME GNU software
     
    14071407        -dicos*)
    14081408                os=-dicos
    14091409                ;;
     1410        -barrelfish*)
     1411                os=-barrelfish
     1412                ;;
    14101413        -none)
    14111414                ;;
    14121415        *)
  • configure.ac

    diff -rN -u old-ghc_bf/configure.ac new-ghc_bf-2/configure.ac
    old new  
    351351
    352352checkOS() {
    353353    case $1 in
    354     linux|freebsd|netbsd|openbsd|dragonfly|osf1|osf3|hpux|linuxaout|kfreebsdgnu|freebsd2|solaris2|cygwin32|mingw32|darwin|gnu|nextstep2|nextstep3|sunos4|ultrix|irix|aix|haiku)
     354    linux|freebsd|netbsd|openbsd|dragonfly|osf1|osf3|hpux|linuxaout|kfreebsdgnu|freebsd2|solaris2|cygwin32|mingw32|darwin|gnu|nextstep2|nextstep3|sunos4|ultrix|irix|aix|haiku|barrelfish)
    355355        ;;
    356356    *)
    357357        echo "Unknown OS '$1'"
     
    746746dnl ** The following have been verified to be used in ghc/, but might be used somewhere else, too.
    747747AC_CHECK_FUNCS([getclock getrusage gettimeofday setitimer siginterrupt sysconf times ctime_r sched_setaffinity setlocale])
    748748
    749 AC_TRY_RUN([
     749AC_RUN_IFELSE([
    750750#include <sys/types.h>
    751751#include <sys/time.h>
    752752int main(void) {
     
    756756  tval.it_interval = tval.it_value;
    757757  return setitimer(ITIMER_VIRTUAL, &tval, (void*)0) != 0;
    758758}
    759 ],[AC_DEFINE([HAVE_SETITIMER_VIRTUAL], [1], [Define to 1 if setitimer accepts ITIMER_VIRTUAL, 0 else.])])
     759],[AC_DEFINE([HAVE_SETITIMER_VIRTUAL], [1], [Define to 1 if setitimer accepts ITIMER_VIRTUAL, 0 else.])],[AC_DEFINE([HAVE_SETITIMER_VIRTUAL], [0], [Define to 1 if setitimer accepts ITIMER_VIRTUAL, 0 else.])],[AC_DEFINE([HAVE_SETITIMER_VIRTUAL], [0], [Define to 1 if setitimer accepts ITIMER_VIRTUAL, 0 else.])])
    760760
    761761dnl ** On OS X 10.4 (at least), time.h doesn't declare ctime_r if
    762762dnl ** _POSIX_C_SOURCE is defined
  • configure.bf

    diff -rN -u old-ghc_bf/configure.bf new-ghc_bf-2/configure.bf
    old new  
     1#! /bin/bash
     2
     3./configure --build=x86_64-unknown-linux --host=x86_64-unknown-barrelfish --target=x86_64-unknown-barrelfish --x-includes=/home/rmcilroy/barrelfish.ghc/include/ --x-libraries=/home/rmcilroy/barrelfish.ghc/build/x86_64/lib/ CFLAGS="-fno-builtin -nostdinc -m64 -mno-red-zone -fPIE -fno-stack-protector -U__linux__ -imacros ${BF_ROOT}/include/deputy/nodeputy.h -DBARRELFISH -DMAX_CPUS=64 -DCONFIG_INTERCONNECT_DRIVER_LMP -DCONFIG_INTERCONNECT_DRIVER_UMP -DCONFIG_FLOUNDER_BACKEND_LMP -DCONFIG_FLOUNDER_BACKEND_UMP -g  -I${BF_ROOT}/include -I${BF_ROOT}/include/arch/x86_64 -I${BF_BUILD_DIR}/include " CPPFLAGS="-fno-builtin -nostdinc -m64 -mno-red-zone -fPIE -fno-stack-protector -U__linux__ -imacros ${BF_ROOT}/include/deputy/nodeputy.h -DBARRELFISH -DMAX_CPUS=64 -DCONFIG_INTERCONNECT_DRIVER_LMP -DCONFIG_INTERCONNECT_DRIVER_UMP -DCONFIG_FLOUNDER_BACKEND_LMP -DCONFIG_FLOUNDER_BACKEND_UMP -g  -I${BF_ROOT}/include -I${BF_ROOT}/include/arch/x86_64 -I${BF_BUILD_DIR}/include " LDFLAGS="${BF_BUILD_DIR}/lib/crt0.o  ${BF_BUILD_DIR}/errors/errno.o -Wl,-section-start,.data.rel.ro=0x800000 -Wl,-z,max-page-size=0x1000 -fno-builtin -nostdlib -m64 -L${BF_BUILD_DIR}/lib/ -Wl,--start-group -lmsun -lposixcompat -lvfs -lnfs -llwip -ltimer -lbarrelfish -lc"
  • ghc/ghc.mk

    diff -rN -u old-ghc_bf/ghc/ghc.mk new-ghc_bf-2/ghc/ghc.mk
    old new  
    7070ghc_stage1_HC_OPTS += -package $(compiler_PACKAGE)-$(compiler_stage1_VERSION)
    7171ghc_stage2_HC_OPTS += -package $(compiler_PACKAGE)-$(compiler_stage2_VERSION)
    7272ghc_stage3_HC_OPTS += -package $(compiler_PACKAGE)-$(compiler_stage3_VERSION)
     73ifneq "$(HostOS_CPP)" "barrelfish"
    7374ghc_stage2_HC_OPTS += -package haskeline
    7475ghc_stage3_HC_OPTS += -package haskeline
     76endif
    7577
    7678ghc_language_extension_flags = -XCPP \
    7779                               -XPatternGuards \
  • ghc/ghc.wrapper

    diff -rN -u old-ghc_bf/ghc/ghc.wrapper new-ghc_bf-2/ghc/ghc.wrapper
    old new  
    1 exec "$executablename" -B"$topdir" -pgmc "$pgmgcc" ${1+"$@"}
     1exec "$executablename" -B"$topdir" -pgmc "$pgmgcc" $builtInArgs ${1+"$@"}
  • ghc.mk

    diff -rN -u old-ghc_bf/ghc.mk new-ghc_bf-2/ghc.mk
    old new  
    338338$(eval $(call addPackage,utf8-string))
    339339$(eval $(call addPackage,xhtml))
    340340
     341ifneq "$(HostOS_CPP)" "barrelfish"
    341342$(eval $(call addPackage,terminfo,($$(Windows),NO)))
    342343
    343344$(eval $(call addPackage,haskeline))
     345endif
    344346
    345347$(foreach pkg,$(EXTRA_PACKAGES),$(eval $(call addPackage,$(pkg))))
    346348
  • includes/DerivedConstants.h.bf

    diff -rN -u old-ghc_bf/includes/DerivedConstants.h.bf new-ghc_bf-2/includes/DerivedConstants.h.bf
    old new  
     1/* This file is created automatically.  Do not edit by hand.*/
     2
     3#define STD_HDR_SIZE   1
     4#define PROF_HDR_SIZE  2
     5#define BLOCK_SIZE   4096
     6#define MBLOCK_SIZE   1048576
     7
     8
     9#define OFFSET_StgRegTable_rR1 0
     10#define OFFSET_StgRegTable_rR2 8
     11#define OFFSET_StgRegTable_rR3 16
     12#define OFFSET_StgRegTable_rR4 24
     13#define OFFSET_StgRegTable_rR5 32
     14#define OFFSET_StgRegTable_rR6 40
     15#define OFFSET_StgRegTable_rR7 48
     16#define OFFSET_StgRegTable_rR8 56
     17#define OFFSET_StgRegTable_rR9 64
     18#define OFFSET_StgRegTable_rR10 72
     19#define OFFSET_StgRegTable_rF1 80
     20#define OFFSET_StgRegTable_rF2 84
     21#define OFFSET_StgRegTable_rF3 88
     22#define OFFSET_StgRegTable_rF4 92
     23#define OFFSET_StgRegTable_rD1 96
     24#define OFFSET_StgRegTable_rD2 104
     25#define OFFSET_StgRegTable_rL1 112
     26#define OFFSET_StgRegTable_rSp 120
     27#define OFFSET_StgRegTable_rSpLim 128
     28#define OFFSET_StgRegTable_rHp 136
     29#define OFFSET_StgRegTable_rHpLim 144
     30#define OFFSET_StgRegTable_rCurrentTSO 152
     31#define OFFSET_StgRegTable_rCurrentNursery 168
     32#define OFFSET_StgRegTable_rHpAlloc 184
     33#define OFFSET_StgRegTable_rRet 192
     34#define REP_StgRegTable_rRet b64
     35#define StgRegTable_rRet(__ptr__)  REP_StgRegTable_rRet[__ptr__+OFFSET_StgRegTable_rRet]
     36#define OFFSET_StgRegTable_rNursery 160
     37#define REP_StgRegTable_rNursery b64
     38#define StgRegTable_rNursery(__ptr__)  REP_StgRegTable_rNursery[__ptr__+OFFSET_StgRegTable_rNursery]
     39#define OFFSET_stgEagerBlackholeInfo 18446744073709551592
     40#define OFFSET_stgGCEnter1 18446744073709551600
     41#define OFFSET_stgGCFun 18446744073709551608
     42#define OFFSET_Capability_r 24
     43#define OFFSET_Capability_lock 312
     44#define OFFSET_Capability_mut_lists 272
     45#define REP_Capability_mut_lists b64
     46#define Capability_mut_lists(__ptr__)  REP_Capability_mut_lists[__ptr__+OFFSET_Capability_mut_lists]
     47#define OFFSET_Capability_context_switch 296
     48#define REP_Capability_context_switch b32
     49#define Capability_context_switch(__ptr__)  REP_Capability_context_switch[__ptr__+OFFSET_Capability_context_switch]
     50#define OFFSET_Capability_sparks 368
     51#define REP_Capability_sparks b64
     52#define Capability_sparks(__ptr__)  REP_Capability_sparks[__ptr__+OFFSET_Capability_sparks]
     53#define OFFSET_bdescr_start 0
     54#define REP_bdescr_start b64
     55#define bdescr_start(__ptr__)  REP_bdescr_start[__ptr__+OFFSET_bdescr_start]
     56#define OFFSET_bdescr_free 8
     57#define REP_bdescr_free b64
     58#define bdescr_free(__ptr__)  REP_bdescr_free[__ptr__+OFFSET_bdescr_free]
     59#define OFFSET_bdescr_blocks 48
     60#define REP_bdescr_blocks b32
     61#define bdescr_blocks(__ptr__)  REP_bdescr_blocks[__ptr__+OFFSET_bdescr_blocks]
     62#define OFFSET_bdescr_gen_no 52
     63#define REP_bdescr_gen_no b16
     64#define bdescr_gen_no(__ptr__)  REP_bdescr_gen_no[__ptr__+OFFSET_bdescr_gen_no]
     65#define OFFSET_bdescr_link 16
     66#define REP_bdescr_link b64
     67#define bdescr_link(__ptr__)  REP_bdescr_link[__ptr__+OFFSET_bdescr_link]
     68#define SIZEOF_generation 312
     69#define OFFSET_generation_mut_list 48
     70#define REP_generation_mut_list b64
     71#define generation_mut_list(__ptr__)  REP_generation_mut_list[__ptr__+OFFSET_generation_mut_list]
     72#define OFFSET_generation_n_new_large_blocks 36
     73#define REP_generation_n_new_large_blocks b32
     74#define generation_n_new_large_blocks(__ptr__)  REP_generation_n_new_large_blocks[__ptr__+OFFSET_generation_n_new_large_blocks]
     75#define SIZEOF_CostCentreStack 88
     76#define OFFSET_CostCentreStack_ccsID 0
     77#define REP_CostCentreStack_ccsID b64
     78#define CostCentreStack_ccsID(__ptr__)  REP_CostCentreStack_ccsID[__ptr__+OFFSET_CostCentreStack_ccsID]
     79#define OFFSET_CostCentreStack_mem_alloc 56
     80#define REP_CostCentreStack_mem_alloc b64
     81#define CostCentreStack_mem_alloc(__ptr__)  REP_CostCentreStack_mem_alloc[__ptr__+OFFSET_CostCentreStack_mem_alloc]
     82#define OFFSET_CostCentreStack_scc_count 32
     83#define REP_CostCentreStack_scc_count b64
     84#define CostCentreStack_scc_count(__ptr__)  REP_CostCentreStack_scc_count[__ptr__+OFFSET_CostCentreStack_scc_count]
     85#define OFFSET_CostCentreStack_prevStack 16
     86#define REP_CostCentreStack_prevStack b64
     87#define CostCentreStack_prevStack(__ptr__)  REP_CostCentreStack_prevStack[__ptr__+OFFSET_CostCentreStack_prevStack]
     88#define OFFSET_CostCentre_ccID 0
     89#define REP_CostCentre_ccID b64
     90#define CostCentre_ccID(__ptr__)  REP_CostCentre_ccID[__ptr__+OFFSET_CostCentre_ccID]
     91#define OFFSET_CostCentre_link 48
     92#define REP_CostCentre_link b64
     93#define CostCentre_link(__ptr__)  REP_CostCentre_link[__ptr__+OFFSET_CostCentre_link]
     94#define OFFSET_StgHeader_info 0
     95#define REP_StgHeader_info b64
     96#define StgHeader_info(__ptr__)  REP_StgHeader_info[__ptr__+OFFSET_StgHeader_info]
     97#define OFFSET_StgHeader_ccs 8
     98#define REP_StgHeader_ccs b64
     99#define StgHeader_ccs(__ptr__)  REP_StgHeader_ccs[__ptr__+OFFSET_StgHeader_ccs]
     100#define OFFSET_StgHeader_ldvw 16
     101#define REP_StgHeader_ldvw b64
     102#define StgHeader_ldvw(__ptr__)  REP_StgHeader_ldvw[__ptr__+OFFSET_StgHeader_ldvw]
     103#define SIZEOF_StgSMPThunkHeader 8
     104#define OFFSET_StgClosure_payload 0
     105#define StgClosure_payload(__ptr__,__ix__)  W_[__ptr__+SIZEOF_StgHeader+OFFSET_StgClosure_payload + WDS(__ix__)]
     106#define OFFSET_StgEntCounter_allocs 48
     107#define REP_StgEntCounter_allocs b64
     108#define StgEntCounter_allocs(__ptr__)  REP_StgEntCounter_allocs[__ptr__+OFFSET_StgEntCounter_allocs]
     109#define OFFSET_StgEntCounter_registeredp 0
     110#define REP_StgEntCounter_registeredp b64
     111#define StgEntCounter_registeredp(__ptr__)  REP_StgEntCounter_registeredp[__ptr__+OFFSET_StgEntCounter_registeredp]
     112#define OFFSET_StgEntCounter_link 56
     113#define REP_StgEntCounter_link b64
     114#define StgEntCounter_link(__ptr__)  REP_StgEntCounter_link[__ptr__+OFFSET_StgEntCounter_link]
     115#define OFFSET_StgEntCounter_entry_count 40
     116#define REP_StgEntCounter_entry_count b64
     117#define StgEntCounter_entry_count(__ptr__)  REP_StgEntCounter_entry_count[__ptr__+OFFSET_StgEntCounter_entry_count]
     118#define SIZEOF_StgUpdateFrame_NoHdr 8
     119#define SIZEOF_StgUpdateFrame (SIZEOF_StgHeader+8)
     120#define SIZEOF_StgCatchFrame_NoHdr 16
     121#define SIZEOF_StgCatchFrame (SIZEOF_StgHeader+16)
     122#define SIZEOF_StgStopFrame_NoHdr 0
     123#define SIZEOF_StgStopFrame (SIZEOF_StgHeader+0)
     124#define SIZEOF_StgMutArrPtrs_NoHdr 16
     125#define SIZEOF_StgMutArrPtrs (SIZEOF_StgHeader+16)
     126#define OFFSET_StgMutArrPtrs_ptrs 0
     127#define REP_StgMutArrPtrs_ptrs b64
     128#define StgMutArrPtrs_ptrs(__ptr__)  REP_StgMutArrPtrs_ptrs[__ptr__+SIZEOF_StgHeader+OFFSET_StgMutArrPtrs_ptrs]
     129#define OFFSET_StgMutArrPtrs_size 8
     130#define REP_StgMutArrPtrs_size b64
     131#define StgMutArrPtrs_size(__ptr__)  REP_StgMutArrPtrs_size[__ptr__+SIZEOF_StgHeader+OFFSET_StgMutArrPtrs_size]
     132#define SIZEOF_StgArrWords_NoHdr 8
     133#define SIZEOF_StgArrWords (SIZEOF_StgHeader+8)
     134#define OFFSET_StgArrWords_bytes 0
     135#define REP_StgArrWords_bytes b64
     136#define StgArrWords_bytes(__ptr__)  REP_StgArrWords_bytes[__ptr__+SIZEOF_StgHeader+OFFSET_StgArrWords_bytes]
     137#define OFFSET_StgArrWords_payload 8
     138#define StgArrWords_payload(__ptr__,__ix__)  W_[__ptr__+SIZEOF_StgHeader+OFFSET_StgArrWords_payload + WDS(__ix__)]
     139#define OFFSET_StgTSO__link 0
     140#define REP_StgTSO__link b64
     141#define StgTSO__link(__ptr__)  REP_StgTSO__link[__ptr__+SIZEOF_StgHeader+OFFSET_StgTSO__link]
     142#define OFFSET_StgTSO_global_link 8
     143#define REP_StgTSO_global_link b64
     144#define StgTSO_global_link(__ptr__)  REP_StgTSO_global_link[__ptr__+SIZEOF_StgHeader+OFFSET_StgTSO_global_link]
     145#define OFFSET_StgTSO_what_next 24
     146#define REP_StgTSO_what_next b16
     147#define StgTSO_what_next(__ptr__)  REP_StgTSO_what_next[__ptr__+SIZEOF_StgHeader+OFFSET_StgTSO_what_next]
     148#define OFFSET_StgTSO_why_blocked 26
     149#define REP_StgTSO_why_blocked b16
     150#define StgTSO_why_blocked(__ptr__)  REP_StgTSO_why_blocked[__ptr__+SIZEOF_StgHeader+OFFSET_StgTSO_why_blocked]
     151#define OFFSET_StgTSO_block_info 32
     152#define REP_StgTSO_block_info b64
     153#define StgTSO_block_info(__ptr__)  REP_StgTSO_block_info[__ptr__+SIZEOF_StgHeader+OFFSET_StgTSO_block_info]
     154#define OFFSET_StgTSO_blocked_exceptions 72
     155#define REP_StgTSO_blocked_exceptions b64
     156#define StgTSO_blocked_exceptions(__ptr__)  REP_StgTSO_blocked_exceptions[__ptr__+SIZEOF_StgHeader+OFFSET_StgTSO_blocked_exceptions]
     157#define OFFSET_StgTSO_id 40
     158#define REP_StgTSO_id b32
     159#define StgTSO_id(__ptr__)  REP_StgTSO_id[__ptr__+SIZEOF_StgHeader+OFFSET_StgTSO_id]
     160#define OFFSET_StgTSO_cap 56
     161#define REP_StgTSO_cap b64
     162#define StgTSO_cap(__ptr__)  REP_StgTSO_cap[__ptr__+SIZEOF_StgHeader+OFFSET_StgTSO_cap]
     163#define OFFSET_StgTSO_saved_errno 44
     164#define REP_StgTSO_saved_errno b32
     165#define StgTSO_saved_errno(__ptr__)  REP_StgTSO_saved_errno[__ptr__+SIZEOF_StgHeader+OFFSET_StgTSO_saved_errno]
     166#define OFFSET_StgTSO_trec 64
     167#define REP_StgTSO_trec b64
     168#define StgTSO_trec(__ptr__)  REP_StgTSO_trec[__ptr__+SIZEOF_StgHeader+OFFSET_StgTSO_trec]
     169#define OFFSET_StgTSO_flags 28
     170#define REP_StgTSO_flags b32
     171#define StgTSO_flags(__ptr__)  REP_StgTSO_flags[__ptr__+SIZEOF_StgHeader+OFFSET_StgTSO_flags]
     172#define OFFSET_StgTSO_dirty 16
     173#define REP_StgTSO_dirty b64
     174#define StgTSO_dirty(__ptr__)  REP_StgTSO_dirty[__ptr__+SIZEOF_StgHeader+OFFSET_StgTSO_dirty]
     175#define OFFSET_StgTSO_bq 80
     176#define REP_StgTSO_bq b64
     177#define StgTSO_bq(__ptr__)  REP_StgTSO_bq[__ptr__+SIZEOF_StgHeader+OFFSET_StgTSO_bq]
     178#define OFFSET_StgTSO_CCCS 88
     179#define REP_StgTSO_CCCS b64
     180#define StgTSO_CCCS(__ptr__)  REP_StgTSO_CCCS[__ptr__+SIZEOF_StgHeader+OFFSET_StgTSO_CCCS]
     181#define REP_StgTSO_sp b64
     182#define OFFSET_StgTSO_sp 96
     183#define TSO_OFFSET_StgTSO_sp (SIZEOF_StgHeader+SIZEOF_OPT_StgTSOProfInfo+OFFSET_StgTSO_sp)
     184#define StgTSO_sp(__ptr__)  REP_StgTSO_sp[__ptr__+TSO_OFFSET_StgTSO_sp]
     185#define OFFSET_StgTSO_stack 104
     186#define TSO_OFFSET_StgTSO_stack (SIZEOF_StgHeader+SIZEOF_OPT_StgTSOProfInfo+OFFSET_StgTSO_stack)
     187#define REP_StgTSO_stack_size b32
     188#define OFFSET_StgTSO_stack_size 88
     189#define TSO_OFFSET_StgTSO_stack_size (SIZEOF_StgHeader+SIZEOF_OPT_StgTSOProfInfo+OFFSET_StgTSO_stack_size)
     190#define StgTSO_stack_size(__ptr__)  REP_StgTSO_stack_size[__ptr__+TSO_OFFSET_StgTSO_stack_size]
     191#define SIZEOF_StgTSOProfInfo 8
     192#ifdef PROFILING
     193#define SIZEOF_OPT_StgTSOProfInfo SIZEOF_StgTSOProfInfo
     194#else
     195#define SIZEOF_OPT_StgTSOProfInfo 0
     196#endif
     197
     198#define OFFSET_StgUpdateFrame_updatee 0
     199#define REP_StgUpdateFrame_updatee b64
     200#define StgUpdateFrame_updatee(__ptr__)  REP_StgUpdateFrame_updatee[__ptr__+SIZEOF_StgHeader+OFFSET_StgUpdateFrame_updatee]
     201#define OFFSET_StgCatchFrame_handler 8
     202#define REP_StgCatchFrame_handler b64
     203#define StgCatchFrame_handler(__ptr__)  REP_StgCatchFrame_handler[__ptr__+SIZEOF_StgHeader+OFFSET_StgCatchFrame_handler]
     204#define OFFSET_StgCatchFrame_exceptions_blocked 0
     205#define REP_StgCatchFrame_exceptions_blocked b64
     206#define StgCatchFrame_exceptions_blocked(__ptr__)  REP_StgCatchFrame_exceptions_blocked[__ptr__+SIZEOF_StgHeader+OFFSET_StgCatchFrame_exceptions_blocked]
     207#define SIZEOF_StgPAP_NoHdr 16
     208#define SIZEOF_StgPAP (SIZEOF_StgHeader+16)
     209#define OFFSET_StgPAP_n_args 4
     210#define REP_StgPAP_n_args b32
     211#define StgPAP_n_args(__ptr__)  REP_StgPAP_n_args[__ptr__+SIZEOF_StgHeader+OFFSET_StgPAP_n_args]
     212#define OFFSET_StgPAP_fun 8
     213#define REP_StgPAP_fun gcptr
     214#define StgPAP_fun(__ptr__)  REP_StgPAP_fun[__ptr__+SIZEOF_StgHeader+OFFSET_StgPAP_fun]
     215#define OFFSET_StgPAP_arity 0
     216#define REP_StgPAP_arity b32
     217#define StgPAP_arity(__ptr__)  REP_StgPAP_arity[__ptr__+SIZEOF_StgHeader+OFFSET_StgPAP_arity]
     218#define OFFSET_StgPAP_payload 16
     219#define StgPAP_payload(__ptr__,__ix__)  W_[__ptr__+SIZEOF_StgHeader+OFFSET_StgPAP_payload + WDS(__ix__)]
     220#define SIZEOF_StgAP_NoThunkHdr 16
     221#define SIZEOF_StgAP_NoHdr 24
     222#define SIZEOF_StgAP (SIZEOF_StgHeader+24)
     223#define OFFSET_StgAP_n_args 12
     224#define REP_StgAP_n_args b32
     225#define StgAP_n_args(__ptr__)  REP_StgAP_n_args[__ptr__+SIZEOF_StgHeader+OFFSET_StgAP_n_args]
     226#define OFFSET_StgAP_fun 16
     227#define REP_StgAP_fun gcptr
     228#define StgAP_fun(__ptr__)  REP_StgAP_fun[__ptr__+SIZEOF_StgHeader+OFFSET_StgAP_fun]
     229#define OFFSET_StgAP_payload 24
     230#define StgAP_payload(__ptr__,__ix__)  W_[__ptr__+SIZEOF_StgHeader+OFFSET_StgAP_payload + WDS(__ix__)]
     231#define SIZEOF_StgAP_STACK_NoThunkHdr 16
     232#define SIZEOF_StgAP_STACK_NoHdr 24
     233#define SIZEOF_StgAP_STACK (SIZEOF_StgHeader+24)
     234#define OFFSET_StgAP_STACK_size 8
     235#define REP_StgAP_STACK_size b64
     236#define StgAP_STACK_size(__ptr__)  REP_StgAP_STACK_size[__ptr__+SIZEOF_StgHeader+OFFSET_StgAP_STACK_size]
     237#define OFFSET_StgAP_STACK_fun 16
     238#define REP_StgAP_STACK_fun gcptr
     239#define StgAP_STACK_fun(__ptr__)  REP_StgAP_STACK_fun[__ptr__+SIZEOF_StgHeader+OFFSET_StgAP_STACK_fun]
     240#define OFFSET_StgAP_STACK_payload 24
     241#define StgAP_STACK_payload(__ptr__,__ix__)  W_[__ptr__+SIZEOF_StgHeader+OFFSET_StgAP_STACK_payload + WDS(__ix__)]
     242#define SIZEOF_StgSelector_NoThunkHdr 8
     243#define SIZEOF_StgSelector_NoHdr 16
     244#define SIZEOF_StgSelector (SIZEOF_StgHeader+16)
     245#define OFFSET_StgInd_indirectee 0
     246#define REP_StgInd_indirectee gcptr
     247#define StgInd_indirectee(__ptr__)  REP_StgInd_indirectee[__ptr__+SIZEOF_StgHeader+OFFSET_StgInd_indirectee]
     248#define SIZEOF_StgMutVar_NoHdr 8
     249#define SIZEOF_StgMutVar (SIZEOF_StgHeader+8)
     250#define OFFSET_StgMutVar_var 0
     251#define REP_StgMutVar_var b64
     252#define StgMutVar_var(__ptr__)  REP_StgMutVar_var[__ptr__+SIZEOF_StgHeader+OFFSET_StgMutVar_var]
     253#define SIZEOF_StgAtomicallyFrame_NoHdr 24
     254#define SIZEOF_StgAtomicallyFrame (SIZEOF_StgHeader+24)
     255#define OFFSET_StgAtomicallyFrame_code 0
     256#define REP_StgAtomicallyFrame_code b64
     257#define StgAtomicallyFrame_code(__ptr__)  REP_StgAtomicallyFrame_code[__ptr__+SIZEOF_StgHeader+OFFSET_StgAtomicallyFrame_code]
     258#define OFFSET_StgAtomicallyFrame_next_invariant_to_check 8
     259#define REP_StgAtomicallyFrame_next_invariant_to_check b64
     260#define StgAtomicallyFrame_next_invariant_to_check(__ptr__)  REP_StgAtomicallyFrame_next_invariant_to_check[__ptr__+SIZEOF_StgHeader+OFFSET_StgAtomicallyFrame_next_invariant_to_check]
     261#define OFFSET_StgAtomicallyFrame_result 16
     262#define REP_StgAtomicallyFrame_result b64
     263#define StgAtomicallyFrame_result(__ptr__)  REP_StgAtomicallyFrame_result[__ptr__+SIZEOF_StgHeader+OFFSET_StgAtomicallyFrame_result]
     264#define OFFSET_StgInvariantCheckQueue_invariant 0
     265#define REP_StgInvariantCheckQueue_invariant b64
     266#define StgInvariantCheckQueue_invariant(__ptr__)  REP_StgInvariantCheckQueue_invariant[__ptr__+SIZEOF_StgHeader+OFFSET_StgInvariantCheckQueue_invariant]
     267#define OFFSET_StgInvariantCheckQueue_my_execution 8
     268#define REP_StgInvariantCheckQueue_my_execution b64
     269#define StgInvariantCheckQueue_my_execution(__ptr__)  REP_StgInvariantCheckQueue_my_execution[__ptr__+SIZEOF_StgHeader+OFFSET_StgInvariantCheckQueue_my_execution]
     270#define OFFSET_StgInvariantCheckQueue_next_queue_entry 16
     271#define REP_StgInvariantCheckQueue_next_queue_entry b64
     272#define StgInvariantCheckQueue_next_queue_entry(__ptr__)  REP_StgInvariantCheckQueue_next_queue_entry[__ptr__+SIZEOF_StgHeader+OFFSET_StgInvariantCheckQueue_next_queue_entry]
     273#define OFFSET_StgAtomicInvariant_code 0
     274#define REP_StgAtomicInvariant_code b64
     275#define StgAtomicInvariant_code(__ptr__)  REP_StgAtomicInvariant_code[__ptr__+SIZEOF_StgHeader+OFFSET_StgAtomicInvariant_code]
     276#define OFFSET_StgTRecHeader_enclosing_trec 0
     277#define REP_StgTRecHeader_enclosing_trec b64
     278#define StgTRecHeader_enclosing_trec(__ptr__)  REP_StgTRecHeader_enclosing_trec[__ptr__+SIZEOF_StgHeader+OFFSET_StgTRecHeader_enclosing_trec]
     279#define SIZEOF_StgCatchSTMFrame_NoHdr 16
     280#define SIZEOF_StgCatchSTMFrame (SIZEOF_StgHeader+16)
     281#define OFFSET_StgCatchSTMFrame_handler 8
     282#define REP_StgCatchSTMFrame_handler b64
     283#define StgCatchSTMFrame_handler(__ptr__)  REP_StgCatchSTMFrame_handler[__ptr__+SIZEOF_StgHeader+OFFSET_StgCatchSTMFrame_handler]
     284#define OFFSET_StgCatchSTMFrame_code 0
     285#define REP_StgCatchSTMFrame_code b64
     286#define StgCatchSTMFrame_code(__ptr__)  REP_StgCatchSTMFrame_code[__ptr__+SIZEOF_StgHeader+OFFSET_StgCatchSTMFrame_code]
     287#define SIZEOF_StgCatchRetryFrame_NoHdr 24
     288#define SIZEOF_StgCatchRetryFrame (SIZEOF_StgHeader+24)
     289#define OFFSET_StgCatchRetryFrame_running_alt_code 0
     290#define REP_StgCatchRetryFrame_running_alt_code b32
     291#define StgCatchRetryFrame_running_alt_code(__ptr__)  REP_StgCatchRetryFrame_running_alt_code[__ptr__+SIZEOF_StgHeader+OFFSET_StgCatchRetryFrame_running_alt_code]
     292#define OFFSET_StgCatchRetryFrame_first_code 8
     293#define REP_StgCatchRetryFrame_first_code b64
     294#define StgCatchRetryFrame_first_code(__ptr__)  REP_StgCatchRetryFrame_first_code[__ptr__+SIZEOF_StgHeader+OFFSET_StgCatchRetryFrame_first_code]
     295#define OFFSET_StgCatchRetryFrame_alt_code 16
     296#define REP_StgCatchRetryFrame_alt_code b64
     297#define StgCatchRetryFrame_alt_code(__ptr__)  REP_StgCatchRetryFrame_alt_code[__ptr__+SIZEOF_StgHeader+OFFSET_StgCatchRetryFrame_alt_code]
     298#define OFFSET_StgTVarWatchQueue_closure 0
     299#define REP_StgTVarWatchQueue_closure b64
     300#define StgTVarWatchQueue_closure(__ptr__)  REP_StgTVarWatchQueue_closure[__ptr__+SIZEOF_StgHeader+OFFSET_StgTVarWatchQueue_closure]
     301#define OFFSET_StgTVarWatchQueue_next_queue_entry 8
     302#define REP_StgTVarWatchQueue_next_queue_entry b64
     303#define StgTVarWatchQueue_next_queue_entry(__ptr__)  REP_StgTVarWatchQueue_next_queue_entry[__ptr__+SIZEOF_StgHeader+OFFSET_StgTVarWatchQueue_next_queue_entry]
     304#define OFFSET_StgTVarWatchQueue_prev_queue_entry 16
     305#define REP_StgTVarWatchQueue_prev_queue_entry b64
     306#define StgTVarWatchQueue_prev_queue_entry(__ptr__)  REP_StgTVarWatchQueue_prev_queue_entry[__ptr__+SIZEOF_StgHeader+OFFSET_StgTVarWatchQueue_prev_queue_entry]
     307#define OFFSET_StgTVar_current_value 0
     308#define REP_StgTVar_current_value b64
     309#define StgTVar_current_value(__ptr__)  REP_StgTVar_current_value[__ptr__+SIZEOF_StgHeader+OFFSET_StgTVar_current_value]
     310#define SIZEOF_StgWeak_NoHdr 40
     311#define SIZEOF_StgWeak (SIZEOF_StgHeader+40)
     312#define OFFSET_StgWeak_link 32
     313#define REP_StgWeak_link b64
     314#define StgWeak_link(__ptr__)  REP_StgWeak_link[__ptr__+SIZEOF_StgHeader+OFFSET_StgWeak_link]
     315#define OFFSET_StgWeak_key 8
     316#define REP_StgWeak_key b64
     317#define StgWeak_key(__ptr__)  REP_StgWeak_key[__ptr__+SIZEOF_StgHeader+OFFSET_StgWeak_key]
     318#define OFFSET_StgWeak_value 16
     319#define REP_StgWeak_value b64
     320#define StgWeak_value(__ptr__)  REP_StgWeak_value[__ptr__+SIZEOF_StgHeader+OFFSET_StgWeak_value]
     321#define OFFSET_StgWeak_finalizer 24
     322#define REP_StgWeak_finalizer b64
     323#define StgWeak_finalizer(__ptr__)  REP_StgWeak_finalizer[__ptr__+SIZEOF_StgHeader+OFFSET_StgWeak_finalizer]
     324#define OFFSET_StgWeak_cfinalizer 0
     325#define REP_StgWeak_cfinalizer b64
     326#define StgWeak_cfinalizer(__ptr__)  REP_StgWeak_cfinalizer[__ptr__+SIZEOF_StgHeader+OFFSET_StgWeak_cfinalizer]
     327#define SIZEOF_StgDeadWeak_NoHdr 8
     328#define SIZEOF_StgDeadWeak (SIZEOF_StgHeader+8)
     329#define OFFSET_StgDeadWeak_link 0
     330#define REP_StgDeadWeak_link b64
     331#define StgDeadWeak_link(__ptr__)  REP_StgDeadWeak_link[__ptr__+SIZEOF_StgHeader+OFFSET_StgDeadWeak_link]
     332#define SIZEOF_StgMVar_NoHdr 24
     333#define SIZEOF_StgMVar (SIZEOF_StgHeader+24)
     334#define OFFSET_StgMVar_head 0
     335#define REP_StgMVar_head b64
     336#define StgMVar_head(__ptr__)  REP_StgMVar_head[__ptr__+SIZEOF_StgHeader+OFFSET_StgMVar_head]
     337#define OFFSET_StgMVar_tail 8
     338#define REP_StgMVar_tail b64
     339#define StgMVar_tail(__ptr__)  REP_StgMVar_tail[__ptr__+SIZEOF_StgHeader+OFFSET_StgMVar_tail]
     340#define OFFSET_StgMVar_value 16
     341#define REP_StgMVar_value b64
     342#define StgMVar_value(__ptr__)  REP_StgMVar_value[__ptr__+SIZEOF_StgHeader+OFFSET_StgMVar_value]
     343#define SIZEOF_StgMVarTSOQueue_NoHdr 16
     344#define SIZEOF_StgMVarTSOQueue (SIZEOF_StgHeader+16)
     345#define OFFSET_StgMVarTSOQueue_link 0
     346#define REP_StgMVarTSOQueue_link b64
     347#define StgMVarTSOQueue_link(__ptr__)  REP_StgMVarTSOQueue_link[__ptr__+SIZEOF_StgHeader+OFFSET_StgMVarTSOQueue_link]
     348#define OFFSET_StgMVarTSOQueue_tso 8
     349#define REP_StgMVarTSOQueue_tso b64
     350#define StgMVarTSOQueue_tso(__ptr__)  REP_StgMVarTSOQueue_tso[__ptr__+SIZEOF_StgHeader+OFFSET_StgMVarTSOQueue_tso]
     351#define SIZEOF_StgBCO_NoHdr 32
     352#define SIZEOF_StgBCO (SIZEOF_StgHeader+32)
     353#define OFFSET_StgBCO_instrs 0
     354#define REP_StgBCO_instrs b64
     355#define StgBCO_instrs(__ptr__)  REP_StgBCO_instrs[__ptr__+SIZEOF_StgHeader+OFFSET_StgBCO_instrs]
     356#define OFFSET_StgBCO_literals 8
     357#define REP_StgBCO_literals b64
     358#define StgBCO_literals(__ptr__)  REP_StgBCO_literals[__ptr__+SIZEOF_StgHeader+OFFSET_StgBCO_literals]
     359#define OFFSET_StgBCO_ptrs 16
     360#define REP_StgBCO_ptrs b64
     361#define StgBCO_ptrs(__ptr__)  REP_StgBCO_ptrs[__ptr__+SIZEOF_StgHeader+OFFSET_StgBCO_ptrs]
     362#define OFFSET_StgBCO_arity 24
     363#define REP_StgBCO_arity b32
     364#define StgBCO_arity(__ptr__)  REP_StgBCO_arity[__ptr__+SIZEOF_StgHeader+OFFSET_StgBCO_arity]
     365#define OFFSET_StgBCO_size 28
     366#define REP_StgBCO_size b32
     367#define StgBCO_size(__ptr__)  REP_StgBCO_size[__ptr__+SIZEOF_StgHeader+OFFSET_StgBCO_size]
     368#define OFFSET_StgBCO_bitmap 32
     369#define StgBCO_bitmap(__ptr__,__ix__)  W_[__ptr__+SIZEOF_StgHeader+OFFSET_StgBCO_bitmap + WDS(__ix__)]
     370#define SIZEOF_StgStableName_NoHdr 8
     371#define SIZEOF_StgStableName (SIZEOF_StgHeader+8)
     372#define OFFSET_StgStableName_sn 0
     373#define REP_StgStableName_sn b64
     374#define StgStableName_sn(__ptr__)  REP_StgStableName_sn[__ptr__+SIZEOF_StgHeader+OFFSET_StgStableName_sn]
     375#define SIZEOF_StgBlockingQueue_NoHdr 32
     376#define SIZEOF_StgBlockingQueue (SIZEOF_StgHeader+32)
     377#define OFFSET_StgBlockingQueue_bh 8
     378#define REP_StgBlockingQueue_bh b64
     379#define StgBlockingQueue_bh(__ptr__)  REP_StgBlockingQueue_bh[__ptr__+SIZEOF_StgHeader+OFFSET_StgBlockingQueue_bh]
     380#define OFFSET_StgBlockingQueue_owner 16
     381#define REP_StgBlockingQueue_owner b64
     382#define StgBlockingQueue_owner(__ptr__)  REP_StgBlockingQueue_owner[__ptr__+SIZEOF_StgHeader+OFFSET_StgBlockingQueue_owner]
     383#define OFFSET_StgBlockingQueue_queue 24
     384#define REP_StgBlockingQueue_queue b64
     385#define StgBlockingQueue_queue(__ptr__)  REP_StgBlockingQueue_queue[__ptr__+SIZEOF_StgHeader+OFFSET_StgBlockingQueue_queue]
     386#define OFFSET_StgBlockingQueue_link 0
     387#define REP_StgBlockingQueue_link b64
     388#define StgBlockingQueue_link(__ptr__)  REP_StgBlockingQueue_link[__ptr__+SIZEOF_StgHeader+OFFSET_StgBlockingQueue_link]
     389#define SIZEOF_MessageBlackHole_NoHdr 24
     390#define SIZEOF_MessageBlackHole (SIZEOF_StgHeader+24)
     391#define OFFSET_MessageBlackHole_link 0
     392#define REP_MessageBlackHole_link b64
     393#define MessageBlackHole_link(__ptr__)  REP_MessageBlackHole_link[__ptr__+SIZEOF_StgHeader+OFFSET_MessageBlackHole_link]
     394#define OFFSET_MessageBlackHole_tso 8
     395#define REP_MessageBlackHole_tso b64
     396#define MessageBlackHole_tso(__ptr__)  REP_MessageBlackHole_tso[__ptr__+SIZEOF_StgHeader+OFFSET_MessageBlackHole_tso]
     397#define OFFSET_MessageBlackHole_bh 16
     398#define REP_MessageBlackHole_bh b64
     399#define MessageBlackHole_bh(__ptr__)  REP_MessageBlackHole_bh[__ptr__+SIZEOF_StgHeader+OFFSET_MessageBlackHole_bh]
     400#define OFFSET_RtsFlags_ProfFlags_showCCSOnException 224
     401#define REP_RtsFlags_ProfFlags_showCCSOnException b32
     402#define RtsFlags_ProfFlags_showCCSOnException(__ptr__)  REP_RtsFlags_ProfFlags_showCCSOnException[__ptr__+OFFSET_RtsFlags_ProfFlags_showCCSOnException]
     403#define OFFSET_RtsFlags_DebugFlags_apply 176
     404#define REP_RtsFlags_DebugFlags_apply b32
     405#define RtsFlags_DebugFlags_apply(__ptr__)  REP_RtsFlags_DebugFlags_apply[__ptr__+OFFSET_RtsFlags_DebugFlags_apply]
     406#define OFFSET_RtsFlags_DebugFlags_sanity 160
     407#define REP_RtsFlags_DebugFlags_sanity b32
     408#define RtsFlags_DebugFlags_sanity(__ptr__)  REP_RtsFlags_DebugFlags_sanity[__ptr__+OFFSET_RtsFlags_DebugFlags_sanity]
     409#define OFFSET_RtsFlags_DebugFlags_weak 144
     410#define REP_RtsFlags_DebugFlags_weak b32
     411#define RtsFlags_DebugFlags_weak(__ptr__)  REP_RtsFlags_DebugFlags_weak[__ptr__+OFFSET_RtsFlags_DebugFlags_weak]
     412#define OFFSET_RtsFlags_GcFlags_initialStkSize 16
     413#define REP_RtsFlags_GcFlags_initialStkSize b32
     414#define RtsFlags_GcFlags_initialStkSize(__ptr__)  REP_RtsFlags_GcFlags_initialStkSize[__ptr__+OFFSET_RtsFlags_GcFlags_initialStkSize]
     415#define OFFSET_RtsFlags_MiscFlags_tickInterval 112
     416#define REP_RtsFlags_MiscFlags_tickInterval b32
     417#define RtsFlags_MiscFlags_tickInterval(__ptr__)  REP_RtsFlags_MiscFlags_tickInterval[__ptr__+OFFSET_RtsFlags_MiscFlags_tickInterval]
     418#define SIZEOF_StgFunInfoExtraFwd 32
     419#define OFFSET_StgFunInfoExtraFwd_slow_apply 24
     420#define REP_StgFunInfoExtraFwd_slow_apply b64
     421#define StgFunInfoExtraFwd_slow_apply(__ptr__)  REP_StgFunInfoExtraFwd_slow_apply[__ptr__+OFFSET_StgFunInfoExtraFwd_slow_apply]
     422#define OFFSET_StgFunInfoExtraFwd_fun_type 0
     423#define REP_StgFunInfoExtraFwd_fun_type b32
     424#define StgFunInfoExtraFwd_fun_type(__ptr__)  REP_StgFunInfoExtraFwd_fun_type[__ptr__+OFFSET_StgFunInfoExtraFwd_fun_type]
     425#define OFFSET_StgFunInfoExtraFwd_arity 4
     426#define REP_StgFunInfoExtraFwd_arity b32
     427#define StgFunInfoExtraFwd_arity(__ptr__)  REP_StgFunInfoExtraFwd_arity[__ptr__+OFFSET_StgFunInfoExtraFwd_arity]
     428#define OFFSET_StgFunInfoExtraFwd_bitmap 16
     429#define REP_StgFunInfoExtraFwd_bitmap b64
     430#define StgFunInfoExtraFwd_bitmap(__ptr__)  REP_StgFunInfoExtraFwd_bitmap[__ptr__+OFFSET_StgFunInfoExtraFwd_bitmap]
     431#define SIZEOF_StgFunInfoExtraRev 32
     432#define OFFSET_StgFunInfoExtraRev_slow_apply_offset 0
     433#define REP_StgFunInfoExtraRev_slow_apply_offset b32
     434#define StgFunInfoExtraRev_slow_apply_offset(__ptr__)  REP_StgFunInfoExtraRev_slow_apply_offset[__ptr__+OFFSET_StgFunInfoExtraRev_slow_apply_offset]
     435#define OFFSET_StgFunInfoExtraRev_fun_type 24
     436#define REP_StgFunInfoExtraRev_fun_type b32
     437#define StgFunInfoExtraRev_fun_type(__ptr__)  REP_StgFunInfoExtraRev_fun_type[__ptr__+OFFSET_StgFunInfoExtraRev_fun_type]
     438#define OFFSET_StgFunInfoExtraRev_arity 28
     439#define REP_StgFunInfoExtraRev_arity b32
     440#define StgFunInfoExtraRev_arity(__ptr__)  REP_StgFunInfoExtraRev_arity[__ptr__+OFFSET_StgFunInfoExtraRev_arity]
     441#define OFFSET_StgFunInfoExtraRev_bitmap 8
     442#define REP_StgFunInfoExtraRev_bitmap b64
     443#define StgFunInfoExtraRev_bitmap(__ptr__)  REP_StgFunInfoExtraRev_bitmap[__ptr__+OFFSET_StgFunInfoExtraRev_bitmap]
     444#define OFFSET_StgLargeBitmap_size 0
     445#define REP_StgLargeBitmap_size b64
     446#define StgLargeBitmap_size(__ptr__)  REP_StgLargeBitmap_size[__ptr__+OFFSET_StgLargeBitmap_size]
     447#define OFFSET_StgLargeBitmap_bitmap 8
     448#define SIZEOF_snEntry 32
     449#define OFFSET_snEntry_sn_obj 24
     450#define REP_snEntry_sn_obj b64
     451#define snEntry_sn_obj(__ptr__)  REP_snEntry_sn_obj[__ptr__+OFFSET_snEntry_sn_obj]
     452#define OFFSET_snEntry_addr 0
     453#define REP_snEntry_addr b64
     454#define snEntry_addr(__ptr__)  REP_snEntry_addr[__ptr__+OFFSET_snEntry_addr]
  • includes/GHCConstants.h.bf

    diff -rN -u old-ghc_bf/includes/GHCConstants.h.bf new-ghc_bf-2/includes/GHCConstants.h.bf
    old new  
     1oFFSET_StgRegTable_rR1 :: Int
     2oFFSET_StgRegTable_rR1 = 0
     3oFFSET_StgRegTable_rR2 :: Int
     4oFFSET_StgRegTable_rR2 = 8
     5oFFSET_StgRegTable_rR3 :: Int
     6oFFSET_StgRegTable_rR3 = 16
     7oFFSET_StgRegTable_rR4 :: Int
     8oFFSET_StgRegTable_rR4 = 24
     9oFFSET_StgRegTable_rR5 :: Int
     10oFFSET_StgRegTable_rR5 = 32
     11oFFSET_StgRegTable_rR6 :: Int
     12oFFSET_StgRegTable_rR6 = 40
     13oFFSET_StgRegTable_rR7 :: Int
     14oFFSET_StgRegTable_rR7 = 48
     15oFFSET_StgRegTable_rR8 :: Int
     16oFFSET_StgRegTable_rR8 = 56
     17oFFSET_StgRegTable_rR9 :: Int
     18oFFSET_StgRegTable_rR9 = 64
     19oFFSET_StgRegTable_rR10 :: Int
     20oFFSET_StgRegTable_rR10 = 72
     21oFFSET_StgRegTable_rF1 :: Int
     22oFFSET_StgRegTable_rF1 = 80
     23oFFSET_StgRegTable_rF2 :: Int
     24oFFSET_StgRegTable_rF2 = 84
     25oFFSET_StgRegTable_rF3 :: Int
     26oFFSET_StgRegTable_rF3 = 88
     27oFFSET_StgRegTable_rF4 :: Int
     28oFFSET_StgRegTable_rF4 = 92
     29oFFSET_StgRegTable_rD1 :: Int
     30oFFSET_StgRegTable_rD1 = 96
     31oFFSET_StgRegTable_rD2 :: Int
     32oFFSET_StgRegTable_rD2 = 104
     33oFFSET_StgRegTable_rL1 :: Int
     34oFFSET_StgRegTable_rL1 = 112
     35oFFSET_StgRegTable_rSp :: Int
     36oFFSET_StgRegTable_rSp = 120
     37oFFSET_StgRegTable_rSpLim :: Int
     38oFFSET_StgRegTable_rSpLim = 128
     39oFFSET_StgRegTable_rHp :: Int
     40oFFSET_StgRegTable_rHp = 136
     41oFFSET_StgRegTable_rHpLim :: Int
     42oFFSET_StgRegTable_rHpLim = 144
     43oFFSET_StgRegTable_rCurrentTSO :: Int
     44oFFSET_StgRegTable_rCurrentTSO = 152
     45oFFSET_StgRegTable_rCurrentNursery :: Int
     46oFFSET_StgRegTable_rCurrentNursery = 168
     47oFFSET_StgRegTable_rHpAlloc :: Int
     48oFFSET_StgRegTable_rHpAlloc = 184
     49oFFSET_StgRegTable_rRet :: Int
     50oFFSET_StgRegTable_rRet = 192
     51#define StgRegTable_rRet(__ptr__)  REP_StgRegTable_rRet[__ptr__+OFFSET_StgRegTable_rRet]
     52oFFSET_StgRegTable_rNursery :: Int
     53oFFSET_StgRegTable_rNursery = 160
     54#define StgRegTable_rNursery(__ptr__)  REP_StgRegTable_rNursery[__ptr__+OFFSET_StgRegTable_rNursery]
     55oFFSET_stgEagerBlackholeInfo :: Int
     56oFFSET_stgEagerBlackholeInfo = 18446744073709551592
     57oFFSET_stgGCEnter1 :: Int
     58oFFSET_stgGCEnter1 = 18446744073709551600
     59oFFSET_stgGCFun :: Int
     60oFFSET_stgGCFun = 18446744073709551608
     61oFFSET_Capability_r :: Int
     62oFFSET_Capability_r = 24
     63oFFSET_Capability_lock :: Int
     64oFFSET_Capability_lock = 312
     65oFFSET_Capability_mut_lists :: Int
     66oFFSET_Capability_mut_lists = 272
     67#define Capability_mut_lists(__ptr__)  REP_Capability_mut_lists[__ptr__+OFFSET_Capability_mut_lists]
     68oFFSET_Capability_context_switch :: Int
     69oFFSET_Capability_context_switch = 296
     70#define Capability_context_switch(__ptr__)  REP_Capability_context_switch[__ptr__+OFFSET_Capability_context_switch]
     71oFFSET_Capability_sparks :: Int
     72oFFSET_Capability_sparks = 368
     73#define Capability_sparks(__ptr__)  REP_Capability_sparks[__ptr__+OFFSET_Capability_sparks]
     74oFFSET_bdescr_start :: Int
     75oFFSET_bdescr_start = 0
     76#define bdescr_start(__ptr__)  REP_bdescr_start[__ptr__+OFFSET_bdescr_start]
     77oFFSET_bdescr_free :: Int
     78oFFSET_bdescr_free = 8
     79#define bdescr_free(__ptr__)  REP_bdescr_free[__ptr__+OFFSET_bdescr_free]
     80oFFSET_bdescr_blocks :: Int
     81oFFSET_bdescr_blocks = 48
     82#define bdescr_blocks(__ptr__)  REP_bdescr_blocks[__ptr__+OFFSET_bdescr_blocks]
     83oFFSET_bdescr_gen_no :: Int
     84oFFSET_bdescr_gen_no = 52
     85#define bdescr_gen_no(__ptr__)  REP_bdescr_gen_no[__ptr__+OFFSET_bdescr_gen_no]
     86oFFSET_bdescr_link :: Int
     87oFFSET_bdescr_link = 16
     88#define bdescr_link(__ptr__)  REP_bdescr_link[__ptr__+OFFSET_bdescr_link]
     89sIZEOF_generation :: Int
     90sIZEOF_generation = 312
     91oFFSET_generation_mut_list :: Int
     92oFFSET_generation_mut_list = 48
     93#define generation_mut_list(__ptr__)  REP_generation_mut_list[__ptr__+OFFSET_generation_mut_list]
     94oFFSET_generation_n_new_large_blocks :: Int
     95oFFSET_generation_n_new_large_blocks = 36
     96#define generation_n_new_large_blocks(__ptr__)  REP_generation_n_new_large_blocks[__ptr__+OFFSET_generation_n_new_large_blocks]
     97sIZEOF_CostCentreStack :: Int
     98sIZEOF_CostCentreStack = 88
     99oFFSET_CostCentreStack_ccsID :: Int
     100oFFSET_CostCentreStack_ccsID = 0
     101#define CostCentreStack_ccsID(__ptr__)  REP_CostCentreStack_ccsID[__ptr__+OFFSET_CostCentreStack_ccsID]
     102oFFSET_CostCentreStack_mem_alloc :: Int
     103oFFSET_CostCentreStack_mem_alloc = 56
     104#define CostCentreStack_mem_alloc(__ptr__)  REP_CostCentreStack_mem_alloc[__ptr__+OFFSET_CostCentreStack_mem_alloc]
     105oFFSET_CostCentreStack_scc_count :: Int
     106oFFSET_CostCentreStack_scc_count = 32
     107#define CostCentreStack_scc_count(__ptr__)  REP_CostCentreStack_scc_count[__ptr__+OFFSET_CostCentreStack_scc_count]
     108oFFSET_CostCentreStack_prevStack :: Int
     109oFFSET_CostCentreStack_prevStack = 16
     110#define CostCentreStack_prevStack(__ptr__)  REP_CostCentreStack_prevStack[__ptr__+OFFSET_CostCentreStack_prevStack]
     111oFFSET_CostCentre_ccID :: Int
     112oFFSET_CostCentre_ccID = 0
     113#define CostCentre_ccID(__ptr__)  REP_CostCentre_ccID[__ptr__+OFFSET_CostCentre_ccID]
     114oFFSET_CostCentre_link :: Int
     115oFFSET_CostCentre_link = 48
     116#define CostCentre_link(__ptr__)  REP_CostCentre_link[__ptr__+OFFSET_CostCentre_link]
     117oFFSET_StgHeader_info :: Int
     118oFFSET_StgHeader_info = 0
     119#define StgHeader_info(__ptr__)  REP_StgHeader_info[__ptr__+OFFSET_StgHeader_info]
     120oFFSET_StgHeader_ccs :: Int
     121oFFSET_StgHeader_ccs = 8
     122#define StgHeader_ccs(__ptr__)  REP_StgHeader_ccs[__ptr__+OFFSET_StgHeader_ccs]
     123oFFSET_StgHeader_ldvw :: Int
     124oFFSET_StgHeader_ldvw = 16
     125#define StgHeader_ldvw(__ptr__)  REP_StgHeader_ldvw[__ptr__+OFFSET_StgHeader_ldvw]
     126sIZEOF_StgSMPThunkHeader :: Int
     127sIZEOF_StgSMPThunkHeader = 8
     128oFFSET_StgClosure_payload :: Int
     129oFFSET_StgClosure_payload = 0
     130#define StgClosure_payload(__ptr__,__ix__)  W_[__ptr__+SIZEOF_StgHeader+OFFSET_StgClosure_payload + WDS(__ix__)]
     131oFFSET_StgEntCounter_allocs :: Int
     132oFFSET_StgEntCounter_allocs = 48
     133#define StgEntCounter_allocs(__ptr__)  REP_StgEntCounter_allocs[__ptr__+OFFSET_StgEntCounter_allocs]
     134oFFSET_StgEntCounter_registeredp :: Int
     135oFFSET_StgEntCounter_registeredp = 0
     136#define StgEntCounter_registeredp(__ptr__)  REP_StgEntCounter_registeredp[__ptr__+OFFSET_StgEntCounter_registeredp]
     137oFFSET_StgEntCounter_link :: Int
     138oFFSET_StgEntCounter_link = 56
     139#define StgEntCounter_link(__ptr__)  REP_StgEntCounter_link[__ptr__+OFFSET_StgEntCounter_link]
     140oFFSET_StgEntCounter_entry_count :: Int
     141oFFSET_StgEntCounter_entry_count = 40
     142#define StgEntCounter_entry_count(__ptr__)  REP_StgEntCounter_entry_count[__ptr__+OFFSET_StgEntCounter_entry_count]
     143sIZEOF_StgUpdateFrame_NoHdr :: Int
     144sIZEOF_StgUpdateFrame_NoHdr = 8
     145sIZEOF_StgCatchFrame_NoHdr :: Int
     146sIZEOF_StgCatchFrame_NoHdr = 16
     147sIZEOF_StgStopFrame_NoHdr :: Int
     148sIZEOF_StgStopFrame_NoHdr = 0
     149sIZEOF_StgMutArrPtrs_NoHdr :: Int
     150sIZEOF_StgMutArrPtrs_NoHdr = 16
     151oFFSET_StgMutArrPtrs_ptrs :: Int
     152oFFSET_StgMutArrPtrs_ptrs = 0
     153#define StgMutArrPtrs_ptrs(__ptr__)  REP_StgMutArrPtrs_ptrs[__ptr__+SIZEOF_StgHeader+OFFSET_StgMutArrPtrs_ptrs]
     154oFFSET_StgMutArrPtrs_size :: Int
     155oFFSET_StgMutArrPtrs_size = 8
     156#define StgMutArrPtrs_size(__ptr__)  REP_StgMutArrPtrs_size[__ptr__+SIZEOF_StgHeader+OFFSET_StgMutArrPtrs_size]
     157sIZEOF_StgArrWords_NoHdr :: Int
     158sIZEOF_StgArrWords_NoHdr = 8
     159oFFSET_StgArrWords_bytes :: Int
     160oFFSET_StgArrWords_bytes = 0
     161#define StgArrWords_bytes(__ptr__)  REP_StgArrWords_bytes[__ptr__+SIZEOF_StgHeader+OFFSET_StgArrWords_bytes]
     162oFFSET_StgArrWords_payload :: Int
     163oFFSET_StgArrWords_payload = 8
     164#define StgArrWords_payload(__ptr__,__ix__)  W_[__ptr__+SIZEOF_StgHeader+OFFSET_StgArrWords_payload + WDS(__ix__)]
     165oFFSET_StgTSO__link :: Int
     166oFFSET_StgTSO__link = 0
     167#define StgTSO__link(__ptr__)  REP_StgTSO__link[__ptr__+SIZEOF_StgHeader+OFFSET_StgTSO__link]
     168oFFSET_StgTSO_global_link :: Int
     169oFFSET_StgTSO_global_link = 8
     170#define StgTSO_global_link(__ptr__)  REP_StgTSO_global_link[__ptr__+SIZEOF_StgHeader+OFFSET_StgTSO_global_link]
     171oFFSET_StgTSO_what_next :: Int
     172oFFSET_StgTSO_what_next = 24
     173#define StgTSO_what_next(__ptr__)  REP_StgTSO_what_next[__ptr__+SIZEOF_StgHeader+OFFSET_StgTSO_what_next]
     174oFFSET_StgTSO_why_blocked :: Int
     175oFFSET_StgTSO_why_blocked = 26
     176#define StgTSO_why_blocked(__ptr__)  REP_StgTSO_why_blocked[__ptr__+SIZEOF_StgHeader+OFFSET_StgTSO_why_blocked]
     177oFFSET_StgTSO_block_info :: Int
     178oFFSET_StgTSO_block_info = 32
     179#define StgTSO_block_info(__ptr__)  REP_StgTSO_block_info[__ptr__+SIZEOF_StgHeader+OFFSET_StgTSO_block_info]
     180oFFSET_StgTSO_blocked_exceptions :: Int
     181oFFSET_StgTSO_blocked_exceptions = 72
     182#define StgTSO_blocked_exceptions(__ptr__)  REP_StgTSO_blocked_exceptions[__ptr__+SIZEOF_StgHeader+OFFSET_StgTSO_blocked_exceptions]
     183oFFSET_StgTSO_id :: Int
     184oFFSET_StgTSO_id = 40
     185#define StgTSO_id(__ptr__)  REP_StgTSO_id[__ptr__+SIZEOF_StgHeader+OFFSET_StgTSO_id]
     186oFFSET_StgTSO_cap :: Int
     187oFFSET_StgTSO_cap = 56
     188#define StgTSO_cap(__ptr__)  REP_StgTSO_cap[__ptr__+SIZEOF_StgHeader+OFFSET_StgTSO_cap]
     189oFFSET_StgTSO_saved_errno :: Int
     190oFFSET_StgTSO_saved_errno = 44
     191#define StgTSO_saved_errno(__ptr__)  REP_StgTSO_saved_errno[__ptr__+SIZEOF_StgHeader+OFFSET_StgTSO_saved_errno]
     192oFFSET_StgTSO_trec :: Int
     193oFFSET_StgTSO_trec = 64
     194#define StgTSO_trec(__ptr__)  REP_StgTSO_trec[__ptr__+SIZEOF_StgHeader+OFFSET_StgTSO_trec]
     195oFFSET_StgTSO_flags :: Int
     196oFFSET_StgTSO_flags = 28
     197#define StgTSO_flags(__ptr__)  REP_StgTSO_flags[__ptr__+SIZEOF_StgHeader+OFFSET_StgTSO_flags]
     198oFFSET_StgTSO_dirty :: Int
     199oFFSET_StgTSO_dirty = 16
     200#define StgTSO_dirty(__ptr__)  REP_StgTSO_dirty[__ptr__+SIZEOF_StgHeader+OFFSET_StgTSO_dirty]
     201oFFSET_StgTSO_bq :: Int
     202oFFSET_StgTSO_bq = 80
     203#define StgTSO_bq(__ptr__)  REP_StgTSO_bq[__ptr__+SIZEOF_StgHeader+OFFSET_StgTSO_bq]
     204oFFSET_StgTSO_CCCS :: Int
     205oFFSET_StgTSO_CCCS = 88
     206#define StgTSO_CCCS(__ptr__)  REP_StgTSO_CCCS[__ptr__+SIZEOF_StgHeader+OFFSET_StgTSO_CCCS]
     207oFFSET_StgTSO_sp :: Int
     208oFFSET_StgTSO_sp = 96
     209#define TSO_OFFSET_StgTSO_sp (SIZEOF_StgHeader+SIZEOF_OPT_StgTSOProfInfo+OFFSET_StgTSO_sp)
     210#define StgTSO_sp(__ptr__)  REP_StgTSO_sp[__ptr__+TSO_OFFSET_StgTSO_sp]
     211oFFSET_StgTSO_stack :: Int
     212oFFSET_StgTSO_stack = 104
     213#define TSO_OFFSET_StgTSO_stack (SIZEOF_StgHeader+SIZEOF_OPT_StgTSOProfInfo+OFFSET_StgTSO_stack)
     214oFFSET_StgTSO_stack_size :: Int
     215oFFSET_StgTSO_stack_size = 88
     216#define TSO_OFFSET_StgTSO_stack_size (SIZEOF_StgHeader+SIZEOF_OPT_StgTSOProfInfo+OFFSET_StgTSO_stack_size)
     217#define StgTSO_stack_size(__ptr__)  REP_StgTSO_stack_size[__ptr__+TSO_OFFSET_StgTSO_stack_size]
     218sIZEOF_StgTSOProfInfo :: Int
     219sIZEOF_StgTSOProfInfo = 8
     220#ifdef PROFILING
     221#define SIZEOF_OPT_StgTSOProfInfo SIZEOF_StgTSOProfInfo
     222#else
     223#define SIZEOF_OPT_StgTSOProfInfo 0
     224#endif
     225
     226oFFSET_StgUpdateFrame_updatee :: Int
     227oFFSET_StgUpdateFrame_updatee = 0
     228#define StgUpdateFrame_updatee(__ptr__)  REP_StgUpdateFrame_updatee[__ptr__+SIZEOF_StgHeader+OFFSET_StgUpdateFrame_updatee]
     229oFFSET_StgCatchFrame_handler :: Int
     230oFFSET_StgCatchFrame_handler = 8
     231#define StgCatchFrame_handler(__ptr__)  REP_StgCatchFrame_handler[__ptr__+SIZEOF_StgHeader+OFFSET_StgCatchFrame_handler]
     232oFFSET_StgCatchFrame_exceptions_blocked :: Int
     233oFFSET_StgCatchFrame_exceptions_blocked = 0
     234#define StgCatchFrame_exceptions_blocked(__ptr__)  REP_StgCatchFrame_exceptions_blocked[__ptr__+SIZEOF_StgHeader+OFFSET_StgCatchFrame_exceptions_blocked]
     235sIZEOF_StgPAP_NoHdr :: Int
     236sIZEOF_StgPAP_NoHdr = 16
     237oFFSET_StgPAP_n_args :: Int
     238oFFSET_StgPAP_n_args = 4
     239#define StgPAP_n_args(__ptr__)  REP_StgPAP_n_args[__ptr__+SIZEOF_StgHeader+OFFSET_StgPAP_n_args]
     240oFFSET_StgPAP_fun :: Int
     241oFFSET_StgPAP_fun = 8
     242#define StgPAP_fun(__ptr__)  REP_StgPAP_fun[__ptr__+SIZEOF_StgHeader+OFFSET_StgPAP_fun]
     243oFFSET_StgPAP_arity :: Int
     244oFFSET_StgPAP_arity = 0
     245#define StgPAP_arity(__ptr__)  REP_StgPAP_arity[__ptr__+SIZEOF_StgHeader+OFFSET_StgPAP_arity]
     246oFFSET_StgPAP_payload :: Int
     247oFFSET_StgPAP_payload = 16
     248#define StgPAP_payload(__ptr__,__ix__)  W_[__ptr__+SIZEOF_StgHeader+OFFSET_StgPAP_payload + WDS(__ix__)]
     249sIZEOF_StgAP_NoThunkHdr :: Int
     250sIZEOF_StgAP_NoThunkHdr = 16
     251sIZEOF_StgAP_NoHdr :: Int
     252sIZEOF_StgAP_NoHdr = 24
     253oFFSET_StgAP_n_args :: Int
     254oFFSET_StgAP_n_args = 12
     255#define StgAP_n_args(__ptr__)  REP_StgAP_n_args[__ptr__+SIZEOF_StgHeader+OFFSET_StgAP_n_args]
     256oFFSET_StgAP_fun :: Int
     257oFFSET_StgAP_fun = 16
     258#define StgAP_fun(__ptr__)  REP_StgAP_fun[__ptr__+SIZEOF_StgHeader+OFFSET_StgAP_fun]
     259oFFSET_StgAP_payload :: Int
     260oFFSET_StgAP_payload = 24
     261#define StgAP_payload(__ptr__,__ix__)  W_[__ptr__+SIZEOF_StgHeader+OFFSET_StgAP_payload + WDS(__ix__)]
     262sIZEOF_StgAP_STACK_NoThunkHdr :: Int
     263sIZEOF_StgAP_STACK_NoThunkHdr = 16
     264sIZEOF_StgAP_STACK_NoHdr :: Int
     265sIZEOF_StgAP_STACK_NoHdr = 24
     266oFFSET_StgAP_STACK_size :: Int
     267oFFSET_StgAP_STACK_size = 8
     268#define StgAP_STACK_size(__ptr__)  REP_StgAP_STACK_size[__ptr__+SIZEOF_StgHeader+OFFSET_StgAP_STACK_size]
     269oFFSET_StgAP_STACK_fun :: Int
     270oFFSET_StgAP_STACK_fun = 16
     271#define StgAP_STACK_fun(__ptr__)  REP_StgAP_STACK_fun[__ptr__+SIZEOF_StgHeader+OFFSET_StgAP_STACK_fun]
     272oFFSET_StgAP_STACK_payload :: Int
     273oFFSET_StgAP_STACK_payload = 24
     274#define StgAP_STACK_payload(__ptr__,__ix__)  W_[__ptr__+SIZEOF_StgHeader+OFFSET_StgAP_STACK_payload + WDS(__ix__)]
     275sIZEOF_StgSelector_NoThunkHdr :: Int
     276sIZEOF_StgSelector_NoThunkHdr = 8
     277sIZEOF_StgSelector_NoHdr :: Int
     278sIZEOF_StgSelector_NoHdr = 16
     279oFFSET_StgInd_indirectee :: Int
     280oFFSET_StgInd_indirectee = 0
     281#define StgInd_indirectee(__ptr__)  REP_StgInd_indirectee[__ptr__+SIZEOF_StgHeader+OFFSET_StgInd_indirectee]
     282sIZEOF_StgMutVar_NoHdr :: Int
     283sIZEOF_StgMutVar_NoHdr = 8
     284oFFSET_StgMutVar_var :: Int
     285oFFSET_StgMutVar_var = 0
     286#define StgMutVar_var(__ptr__)  REP_StgMutVar_var[__ptr__+SIZEOF_StgHeader+OFFSET_StgMutVar_var]
     287sIZEOF_StgAtomicallyFrame_NoHdr :: Int
     288sIZEOF_StgAtomicallyFrame_NoHdr = 24
     289oFFSET_StgAtomicallyFrame_code :: Int
     290oFFSET_StgAtomicallyFrame_code = 0
     291#define StgAtomicallyFrame_code(__ptr__)  REP_StgAtomicallyFrame_code[__ptr__+SIZEOF_StgHeader+OFFSET_StgAtomicallyFrame_code]
     292oFFSET_StgAtomicallyFrame_next_invariant_to_check :: Int
     293oFFSET_StgAtomicallyFrame_next_invariant_to_check = 8
     294#define StgAtomicallyFrame_next_invariant_to_check(__ptr__)  REP_StgAtomicallyFrame_next_invariant_to_check[__ptr__+SIZEOF_StgHeader+OFFSET_StgAtomicallyFrame_next_invariant_to_check]
     295oFFSET_StgAtomicallyFrame_result :: Int
     296oFFSET_StgAtomicallyFrame_result = 16
     297#define StgAtomicallyFrame_result(__ptr__)  REP_StgAtomicallyFrame_result[__ptr__+SIZEOF_StgHeader+OFFSET_StgAtomicallyFrame_result]
     298oFFSET_StgInvariantCheckQueue_invariant :: Int
     299oFFSET_StgInvariantCheckQueue_invariant = 0
     300#define StgInvariantCheckQueue_invariant(__ptr__)  REP_StgInvariantCheckQueue_invariant[__ptr__+SIZEOF_StgHeader+OFFSET_StgInvariantCheckQueue_invariant]
     301oFFSET_StgInvariantCheckQueue_my_execution :: Int
     302oFFSET_StgInvariantCheckQueue_my_execution = 8
     303#define StgInvariantCheckQueue_my_execution(__ptr__)  REP_StgInvariantCheckQueue_my_execution[__ptr__+SIZEOF_StgHeader+OFFSET_StgInvariantCheckQueue_my_execution]
     304oFFSET_StgInvariantCheckQueue_next_queue_entry :: Int
     305oFFSET_StgInvariantCheckQueue_next_queue_entry = 16
     306#define StgInvariantCheckQueue_next_queue_entry(__ptr__)  REP_StgInvariantCheckQueue_next_queue_entry[__ptr__+SIZEOF_StgHeader+OFFSET_StgInvariantCheckQueue_next_queue_entry]
     307oFFSET_StgAtomicInvariant_code :: Int
     308oFFSET_StgAtomicInvariant_code = 0
     309#define StgAtomicInvariant_code(__ptr__)  REP_StgAtomicInvariant_code[__ptr__+SIZEOF_StgHeader+OFFSET_StgAtomicInvariant_code]
     310oFFSET_StgTRecHeader_enclosing_trec :: Int
     311oFFSET_StgTRecHeader_enclosing_trec = 0
     312#define StgTRecHeader_enclosing_trec(__ptr__)  REP_StgTRecHeader_enclosing_trec[__ptr__+SIZEOF_StgHeader+OFFSET_StgTRecHeader_enclosing_trec]
     313sIZEOF_StgCatchSTMFrame_NoHdr :: Int
     314sIZEOF_StgCatchSTMFrame_NoHdr = 16
     315oFFSET_StgCatchSTMFrame_handler :: Int
     316oFFSET_StgCatchSTMFrame_handler = 8
     317#define StgCatchSTMFrame_handler(__ptr__)  REP_StgCatchSTMFrame_handler[__ptr__+SIZEOF_StgHeader+OFFSET_StgCatchSTMFrame_handler]
     318oFFSET_StgCatchSTMFrame_code :: Int
     319oFFSET_StgCatchSTMFrame_code = 0
     320#define StgCatchSTMFrame_code(__ptr__)  REP_StgCatchSTMFrame_code[__ptr__+SIZEOF_StgHeader+OFFSET_StgCatchSTMFrame_code]
     321sIZEOF_StgCatchRetryFrame_NoHdr :: Int
     322sIZEOF_StgCatchRetryFrame_NoHdr = 24
     323oFFSET_StgCatchRetryFrame_running_alt_code :: Int
     324oFFSET_StgCatchRetryFrame_running_alt_code = 0
     325#define StgCatchRetryFrame_running_alt_code(__ptr__)  REP_StgCatchRetryFrame_running_alt_code[__ptr__+SIZEOF_StgHeader+OFFSET_StgCatchRetryFrame_running_alt_code]
     326oFFSET_StgCatchRetryFrame_first_code :: Int
     327oFFSET_StgCatchRetryFrame_first_code = 8
     328#define StgCatchRetryFrame_first_code(__ptr__)  REP_StgCatchRetryFrame_first_code[__ptr__+SIZEOF_StgHeader+OFFSET_StgCatchRetryFrame_first_code]
     329oFFSET_StgCatchRetryFrame_alt_code :: Int
     330oFFSET_StgCatchRetryFrame_alt_code = 16
     331#define StgCatchRetryFrame_alt_code(__ptr__)  REP_StgCatchRetryFrame_alt_code[__ptr__+SIZEOF_StgHeader+OFFSET_StgCatchRetryFrame_alt_code]
     332oFFSET_StgTVarWatchQueue_closure :: Int
     333oFFSET_StgTVarWatchQueue_closure = 0
     334#define StgTVarWatchQueue_closure(__ptr__)  REP_StgTVarWatchQueue_closure[__ptr__+SIZEOF_StgHeader+OFFSET_StgTVarWatchQueue_closure]
     335oFFSET_StgTVarWatchQueue_next_queue_entry :: Int
     336oFFSET_StgTVarWatchQueue_next_queue_entry = 8
     337#define StgTVarWatchQueue_next_queue_entry(__ptr__)  REP_StgTVarWatchQueue_next_queue_entry[__ptr__+SIZEOF_StgHeader+OFFSET_StgTVarWatchQueue_next_queue_entry]
     338oFFSET_StgTVarWatchQueue_prev_queue_entry :: Int
     339oFFSET_StgTVarWatchQueue_prev_queue_entry = 16
     340#define StgTVarWatchQueue_prev_queue_entry(__ptr__)  REP_StgTVarWatchQueue_prev_queue_entry[__ptr__+SIZEOF_StgHeader+OFFSET_StgTVarWatchQueue_prev_queue_entry]
     341oFFSET_StgTVar_current_value :: Int
     342oFFSET_StgTVar_current_value = 0
     343#define StgTVar_current_value(__ptr__)  REP_StgTVar_current_value[__ptr__+SIZEOF_StgHeader+OFFSET_StgTVar_current_value]
     344sIZEOF_StgWeak_NoHdr :: Int
     345sIZEOF_StgWeak_NoHdr = 40
     346oFFSET_StgWeak_link :: Int
     347oFFSET_StgWeak_link = 32
     348#define StgWeak_link(__ptr__)  REP_StgWeak_link[__ptr__+SIZEOF_StgHeader+OFFSET_StgWeak_link]
     349oFFSET_StgWeak_key :: Int
     350oFFSET_StgWeak_key = 8
     351#define StgWeak_key(__ptr__)  REP_StgWeak_key[__ptr__+SIZEOF_StgHeader+OFFSET_StgWeak_key]
     352oFFSET_StgWeak_value :: Int
     353oFFSET_StgWeak_value = 16
     354#define StgWeak_value(__ptr__)  REP_StgWeak_value[__ptr__+SIZEOF_StgHeader+OFFSET_StgWeak_value]
     355oFFSET_StgWeak_finalizer :: Int
     356oFFSET_StgWeak_finalizer = 24
     357#define StgWeak_finalizer(__ptr__)  REP_StgWeak_finalizer[__ptr__+SIZEOF_StgHeader+OFFSET_StgWeak_finalizer]
     358oFFSET_StgWeak_cfinalizer :: Int
     359oFFSET_StgWeak_cfinalizer = 0
     360#define StgWeak_cfinalizer(__ptr__)  REP_StgWeak_cfinalizer[__ptr__+SIZEOF_StgHeader+OFFSET_StgWeak_cfinalizer]
     361sIZEOF_StgDeadWeak_NoHdr :: Int
     362sIZEOF_StgDeadWeak_NoHdr = 8
     363oFFSET_StgDeadWeak_link :: Int
     364oFFSET_StgDeadWeak_link = 0
     365#define StgDeadWeak_link(__ptr__)  REP_StgDeadWeak_link[__ptr__+SIZEOF_StgHeader+OFFSET_StgDeadWeak_link]
     366sIZEOF_StgMVar_NoHdr :: Int
     367sIZEOF_StgMVar_NoHdr = 24
     368oFFSET_StgMVar_head :: Int
     369oFFSET_StgMVar_head = 0
     370#define StgMVar_head(__ptr__)  REP_StgMVar_head[__ptr__+SIZEOF_StgHeader+OFFSET_StgMVar_head]
     371oFFSET_StgMVar_tail :: Int
     372oFFSET_StgMVar_tail = 8
     373#define StgMVar_tail(__ptr__)  REP_StgMVar_tail[__ptr__+SIZEOF_StgHeader+OFFSET_StgMVar_tail]
     374oFFSET_StgMVar_value :: Int
     375oFFSET_StgMVar_value = 16
     376#define StgMVar_value(__ptr__)  REP_StgMVar_value[__ptr__+SIZEOF_StgHeader+OFFSET_StgMVar_value]
     377sIZEOF_StgMVarTSOQueue_NoHdr :: Int
     378sIZEOF_StgMVarTSOQueue_NoHdr = 16
     379oFFSET_StgMVarTSOQueue_link :: Int
     380oFFSET_StgMVarTSOQueue_link = 0
     381#define StgMVarTSOQueue_link(__ptr__)  REP_StgMVarTSOQueue_link[__ptr__+SIZEOF_StgHeader+OFFSET_StgMVarTSOQueue_link]
     382oFFSET_StgMVarTSOQueue_tso :: Int
     383oFFSET_StgMVarTSOQueue_tso = 8
     384#define StgMVarTSOQueue_tso(__ptr__)  REP_StgMVarTSOQueue_tso[__ptr__+SIZEOF_StgHeader+OFFSET_StgMVarTSOQueue_tso]
     385sIZEOF_StgBCO_NoHdr :: Int
     386sIZEOF_StgBCO_NoHdr = 32
     387oFFSET_StgBCO_instrs :: Int
     388oFFSET_StgBCO_instrs = 0
     389#define StgBCO_instrs(__ptr__)  REP_StgBCO_instrs[__ptr__+SIZEOF_StgHeader+OFFSET_StgBCO_instrs]
     390oFFSET_StgBCO_literals :: Int
     391oFFSET_StgBCO_literals = 8
     392#define StgBCO_literals(__ptr__)  REP_StgBCO_literals[__ptr__+SIZEOF_StgHeader+OFFSET_StgBCO_literals]
     393oFFSET_StgBCO_ptrs :: Int
     394oFFSET_StgBCO_ptrs = 16
     395#define StgBCO_ptrs(__ptr__)  REP_StgBCO_ptrs[__ptr__+SIZEOF_StgHeader+OFFSET_StgBCO_ptrs]
     396oFFSET_StgBCO_arity :: Int
     397oFFSET_StgBCO_arity = 24
     398#define StgBCO_arity(__ptr__)  REP_StgBCO_arity[__ptr__+SIZEOF_StgHeader+OFFSET_StgBCO_arity]
     399oFFSET_StgBCO_size :: Int
     400oFFSET_StgBCO_size = 28
     401#define StgBCO_size(__ptr__)  REP_StgBCO_size[__ptr__+SIZEOF_StgHeader+OFFSET_StgBCO_size]
     402oFFSET_StgBCO_bitmap :: Int
     403oFFSET_StgBCO_bitmap = 32
     404#define StgBCO_bitmap(__ptr__,__ix__)  W_[__ptr__+SIZEOF_StgHeader+OFFSET_StgBCO_bitmap + WDS(__ix__)]
     405sIZEOF_StgStableName_NoHdr :: Int
     406sIZEOF_StgStableName_NoHdr = 8
     407oFFSET_StgStableName_sn :: Int
     408oFFSET_StgStableName_sn = 0
     409#define StgStableName_sn(__ptr__)  REP_StgStableName_sn[__ptr__+SIZEOF_StgHeader+OFFSET_StgStableName_sn]
     410sIZEOF_StgBlockingQueue_NoHdr :: Int
     411sIZEOF_StgBlockingQueue_NoHdr = 32
     412oFFSET_StgBlockingQueue_bh :: Int
     413oFFSET_StgBlockingQueue_bh = 8
     414#define StgBlockingQueue_bh(__ptr__)  REP_StgBlockingQueue_bh[__ptr__+SIZEOF_StgHeader+OFFSET_StgBlockingQueue_bh]
     415oFFSET_StgBlockingQueue_owner :: Int
     416oFFSET_StgBlockingQueue_owner = 16
     417#define StgBlockingQueue_owner(__ptr__)  REP_StgBlockingQueue_owner[__ptr__+SIZEOF_StgHeader+OFFSET_StgBlockingQueue_owner]
     418oFFSET_StgBlockingQueue_queue :: Int
     419oFFSET_StgBlockingQueue_queue = 24
     420#define StgBlockingQueue_queue(__ptr__)  REP_StgBlockingQueue_queue[__ptr__+SIZEOF_StgHeader+OFFSET_StgBlockingQueue_queue]
     421oFFSET_StgBlockingQueue_link :: Int
     422oFFSET_StgBlockingQueue_link = 0
     423#define StgBlockingQueue_link(__ptr__)  REP_StgBlockingQueue_link[__ptr__+SIZEOF_StgHeader+OFFSET_StgBlockingQueue_link]
     424sIZEOF_MessageBlackHole_NoHdr :: Int
     425sIZEOF_MessageBlackHole_NoHdr = 24
     426oFFSET_MessageBlackHole_link :: Int
     427oFFSET_MessageBlackHole_link = 0
     428#define MessageBlackHole_link(__ptr__)  REP_MessageBlackHole_link[__ptr__+SIZEOF_StgHeader+OFFSET_MessageBlackHole_link]
     429oFFSET_MessageBlackHole_tso :: Int
     430oFFSET_MessageBlackHole_tso = 8
     431#define MessageBlackHole_tso(__ptr__)  REP_MessageBlackHole_tso[__ptr__+SIZEOF_StgHeader+OFFSET_MessageBlackHole_tso]
     432oFFSET_MessageBlackHole_bh :: Int
     433oFFSET_MessageBlackHole_bh = 16
     434#define MessageBlackHole_bh(__ptr__)  REP_MessageBlackHole_bh[__ptr__+SIZEOF_StgHeader+OFFSET_MessageBlackHole_bh]
     435oFFSET_RtsFlags_ProfFlags_showCCSOnException :: Int
     436oFFSET_RtsFlags_ProfFlags_showCCSOnException = 224
     437#define RtsFlags_ProfFlags_showCCSOnException(__ptr__)  REP_RtsFlags_ProfFlags_showCCSOnException[__ptr__+OFFSET_RtsFlags_ProfFlags_showCCSOnException]
     438oFFSET_RtsFlags_DebugFlags_apply :: Int
     439oFFSET_RtsFlags_DebugFlags_apply = 176
     440#define RtsFlags_DebugFlags_apply(__ptr__)  REP_RtsFlags_DebugFlags_apply[__ptr__+OFFSET_RtsFlags_DebugFlags_apply]
     441oFFSET_RtsFlags_DebugFlags_sanity :: Int
     442oFFSET_RtsFlags_DebugFlags_sanity = 160
     443#define RtsFlags_DebugFlags_sanity(__ptr__)  REP_RtsFlags_DebugFlags_sanity[__ptr__+OFFSET_RtsFlags_DebugFlags_sanity]
     444oFFSET_RtsFlags_DebugFlags_weak :: Int
     445oFFSET_RtsFlags_DebugFlags_weak = 144
     446#define RtsFlags_DebugFlags_weak(__ptr__)  REP_RtsFlags_DebugFlags_weak[__ptr__+OFFSET_RtsFlags_DebugFlags_weak]
     447oFFSET_RtsFlags_GcFlags_initialStkSize :: Int
     448oFFSET_RtsFlags_GcFlags_initialStkSize = 16
     449#define RtsFlags_GcFlags_initialStkSize(__ptr__)  REP_RtsFlags_GcFlags_initialStkSize[__ptr__+OFFSET_RtsFlags_GcFlags_initialStkSize]
     450oFFSET_RtsFlags_MiscFlags_tickInterval :: Int
     451oFFSET_RtsFlags_MiscFlags_tickInterval = 112
     452#define RtsFlags_MiscFlags_tickInterval(__ptr__)  REP_RtsFlags_MiscFlags_tickInterval[__ptr__+OFFSET_RtsFlags_MiscFlags_tickInterval]
     453sIZEOF_StgFunInfoExtraFwd :: Int
     454sIZEOF_StgFunInfoExtraFwd = 32
     455oFFSET_StgFunInfoExtraFwd_slow_apply :: Int
     456oFFSET_StgFunInfoExtraFwd_slow_apply = 24
     457#define StgFunInfoExtraFwd_slow_apply(__ptr__)  REP_StgFunInfoExtraFwd_slow_apply[__ptr__+OFFSET_StgFunInfoExtraFwd_slow_apply]
     458oFFSET_StgFunInfoExtraFwd_fun_type :: Int
     459oFFSET_StgFunInfoExtraFwd_fun_type = 0
     460#define StgFunInfoExtraFwd_fun_type(__ptr__)  REP_StgFunInfoExtraFwd_fun_type[__ptr__+OFFSET_StgFunInfoExtraFwd_fun_type]
     461oFFSET_StgFunInfoExtraFwd_arity :: Int
     462oFFSET_StgFunInfoExtraFwd_arity = 4
     463#define StgFunInfoExtraFwd_arity(__ptr__)  REP_StgFunInfoExtraFwd_arity[__ptr__+OFFSET_StgFunInfoExtraFwd_arity]
     464oFFSET_StgFunInfoExtraFwd_bitmap :: Int
     465oFFSET_StgFunInfoExtraFwd_bitmap = 16
     466#define StgFunInfoExtraFwd_bitmap(__ptr__)  REP_StgFunInfoExtraFwd_bitmap[__ptr__+OFFSET_StgFunInfoExtraFwd_bitmap]
     467sIZEOF_StgFunInfoExtraRev :: Int
     468sIZEOF_StgFunInfoExtraRev = 32
     469oFFSET_StgFunInfoExtraRev_slow_apply_offset :: Int
     470oFFSET_StgFunInfoExtraRev_slow_apply_offset = 0
     471#define StgFunInfoExtraRev_slow_apply_offset(__ptr__)  REP_StgFunInfoExtraRev_slow_apply_offset[__ptr__+OFFSET_StgFunInfoExtraRev_slow_apply_offset]
     472oFFSET_StgFunInfoExtraRev_fun_type :: Int
     473oFFSET_StgFunInfoExtraRev_fun_type = 24
     474#define StgFunInfoExtraRev_fun_type(__ptr__)  REP_StgFunInfoExtraRev_fun_type[__ptr__+OFFSET_StgFunInfoExtraRev_fun_type]
     475oFFSET_StgFunInfoExtraRev_arity :: Int
     476oFFSET_StgFunInfoExtraRev_arity = 28
     477#define StgFunInfoExtraRev_arity(__ptr__)  REP_StgFunInfoExtraRev_arity[__ptr__+OFFSET_StgFunInfoExtraRev_arity]
     478oFFSET_StgFunInfoExtraRev_bitmap :: Int
     479oFFSET_StgFunInfoExtraRev_bitmap = 8
     480#define StgFunInfoExtraRev_bitmap(__ptr__)  REP_StgFunInfoExtraRev_bitmap[__ptr__+OFFSET_StgFunInfoExtraRev_bitmap]
     481oFFSET_StgLargeBitmap_size :: Int
     482oFFSET_StgLargeBitmap_size = 0
     483#define StgLargeBitmap_size(__ptr__)  REP_StgLargeBitmap_size[__ptr__+OFFSET_StgLargeBitmap_size]
     484oFFSET_StgLargeBitmap_bitmap :: Int
     485oFFSET_StgLargeBitmap_bitmap = 8
     486sIZEOF_snEntry :: Int
     487sIZEOF_snEntry = 32
     488oFFSET_snEntry_sn_obj :: Int
     489oFFSET_snEntry_sn_obj = 24
     490#define snEntry_sn_obj(__ptr__)  REP_snEntry_sn_obj[__ptr__+OFFSET_snEntry_sn_obj]
     491oFFSET_snEntry_addr :: Int
     492oFFSET_snEntry_addr = 0
     493#define snEntry_addr(__ptr__)  REP_snEntry_addr[__ptr__+OFFSET_snEntry_addr]
  • includes/ghc.mk

    diff -rN -u old-ghc_bf/includes/ghc.mk new-ghc_bf-2/includes/ghc.mk
    old new  
    126126
    127127includes_dist-derivedconstants_C_SRCS = mkDerivedConstants.c
    128128includes_dist-derivedconstants_PROG   = mkDerivedConstants$(exeext)
     129ifeq "$(HOSTPLATFORM)" "x86_64-unknown-barrelfish"
     130includes_dist-derivedconstants_LD_OPTS = -lbarrelfish -lc
     131endif
    129132
    130133$(eval $(call build-prog,includes,dist-derivedconstants,1))
    131134
     
    133136includes/dist-derivedconstants/build/mkDerivedConstants.o : $(includes_H_CONFIG) $(includes_H_PLATFORM)
    134137
    135138ifneq "$(BINDIST)" "YES"
     139ifeq "$(HOSTPLATFORM)" "x86_64-unknown-barrelfish"
     140$(includes_DERIVEDCONSTANTS) : $(INPLACE_BIN)/mkDerivedConstants$(exeext)       
     141        $(if $(includes_DERIVEDCONSTANTS),touch $(includes_DERIVEDCONSTANTS), @echo "Compiling for Barrelfish - please run mkDerivedConstants in Barrelfish and copy result to includes/DerivedConstants.h"; @exit 1)
     142else
    136143$(includes_DERIVEDCONSTANTS) : $(INPLACE_BIN)/mkDerivedConstants$(exeext)
    137144        ./$< >$@
    138145endif
     146endif
    139147
    140148endif
    141149
     
    155163includes_dist-ghcconstants_C_SRCS = mkDerivedConstants.c
    156164includes_dist-ghcconstants_PROG   = mkGHCConstants$(exeext)
    157165includes_dist-ghcconstants_CC_OPTS = -DGEN_HASKELL
     166ifeq "$(HOSTPLATFORM)" "x86_64-unknown-barrelfish"
     167includes_dist-ghcconstants_LD_OPTS = -lbarrelfish -lc
     168endif
    158169
    159170$(eval $(call build-prog,includes,dist-ghcconstants,1))
    160171
     
    163174
    164175includes/dist-ghcconstants/build/mkDerivedConstants.o : $(includes_H_CONFIG) $(includes_H_PLATFORM)
    165176
     177ifeq "$(HOSTPLATFORM)" "x86_64-unknown-barrelfish"
     178$(includes_GHCCONSTANTS) : $(INPLACE_BIN)/mkGHCConstants$(exeext)       
     179        $(if $(includes_GHCCONSTANTS), touch $(includes_GHCCONSTANTS), @echo "Compiling for Barrelfish - please run mkGHCConstants in Barrelfish and copy result to includes/GHCConstants.h"; @exit 1)
     180else
    166181$(includes_GHCCONSTANTS) : $(INPLACE_BIN)/mkGHCConstants$(exeext)
    167182        ./$< >$@
    168183endif
     184endif
    169185
    170186endif
    171187
  • includes/rts/Config.h

    diff -rN -u old-ghc_bf/includes/rts/Config.h new-ghc_bf-2/includes/rts/Config.h
    old new  
    3838   Signals - supported on non-PAR versions of the runtime.  See RtsSignals.h.
    3939   -------------------------------------------------------------------------- */
    4040
     41#ifndef BARRELFISH
    4142#define RTS_USER_SIGNALS 1
     43#endif
    4244
    4345/* Profile spin locks */
    4446
  • includes/rts/FileLock.h

    diff -rN -u old-ghc_bf/includes/rts/FileLock.h new-ghc_bf-2/includes/rts/FileLock.h
    old new  
    1818#include <sys/types.h>
    1919#endif
    2020
     21#ifndef barrelfish_HOST_OS
     22
    2123int  lockFile(int fd, dev_t dev, ino_t ino, int for_writing);
    2224int  unlockFile(int fd);
    2325
     26#endif
     27
    2428#endif /* RTS_FILELOCK_H */
  • includes/rts/OSThreads.h

    diff -rN -u old-ghc_bf/includes/rts/OSThreads.h new-ghc_bf-2/includes/rts/OSThreads.h
    old new  
    1717
    1818#if defined(THREADED_RTS) /* to the end */
    1919
    20 # if defined(HAVE_PTHREAD_H) && !defined(WANT_NATIVE_WIN32_THREADS)
     20# if defined(barrelfish_HOST_OS)
     21
     22#if CMINUSMINUS
     23
     24#define ACQUIRE_LOCK(mutex) foreign "C" thread_mutex_lock(mutex)
     25#define RELEASE_LOCK(mutex) foreign "C" thread_mutex_unlock(mutex)
     26#define ASSERT_LOCK_HELD(mutex) /* nothing */
     27
     28#else
     29
     30#include <barrelfish/barrelfish.h>
     31#include <barrelfish/threads.h>
     32#include <errno.h>
     33
     34typedef struct thread_cond    Condition;
     35typedef struct thread_mutex   Mutex;
     36typedef struct thread *       OSThreadId;
     37typedef int                   ThreadLocalKey;
     38
     39#define OSThreadProcAttr /* nothing */
     40
     41#define OSThreadNullId NULL
     42
     43#define INIT_COND_VAR       THREAD_COND_INITIALIZER
     44
     45#ifdef LOCK_DEBUG
     46#define LOCK_DEBUG_BELCH(what, mutex) \
     47  debugBelch("%s(0x%p) %s %d\n", what, mutex, __FILE__, __LINE__)
     48#else
     49#define LOCK_DEBUG_BELCH(what, mutex) /* nothing */
     50#endif
     51
     52/* Always check the result of lock and unlock. */
     53#define ACQUIRE_LOCK(mutex) \
     54  LOCK_DEBUG_BELCH("ACQUIRE_LOCK", mutex); \
     55  thread_mutex_lock(mutex)
     56
     57#define RELEASE_LOCK(mutex) \
     58  LOCK_DEBUG_BELCH("RELEASE_LOCK", mutex); \
     59  thread_mutex_unlock(mutex)
     60
     61// Can't do this yet as pthreads in BF don't return anything yet
     62#define ASSERT_LOCK_HELD(mutex)
     63
     64#endif // CMINUSMINUS
     65
     66# elif defined(HAVE_PTHREAD_H) && !defined(WANT_NATIVE_WIN32_THREADS)
    2167
    2268#if CMINUSMINUS
    2369
     
    3783
    3884#define OSThreadProcAttr /* nothing */
    3985
     86#define OSThreadNullId 0
     87
    4088#define INIT_COND_VAR       PTHREAD_COND_INITIALIZER
    4189
    4290#ifdef LOCK_DEBUG
     
    59107    barf("RELEASE_LOCK: I do not own this lock: %s %d", __FILE__,__LINE__); \
    60108  }
    61109
    62 // Note: this assertion calls pthread_mutex_lock() on a mutex that
    63 // is already held by the calling thread.  The mutex should therefore
    64 // have been created with PTHREAD_MUTEX_ERRORCHECK, otherwise this
    65 // assertion will hang.  We always initialise mutexes with
    66 // PTHREAD_MUTEX_ERRORCHECK when DEBUG is on (see rts/posix/OSThreads.h).
    67 #define ASSERT_LOCK_HELD(mutex) ASSERT(pthread_mutex_lock(mutex) == EDEADLK)
     110#define ASSERT_LOCK_HELD(mutex) /* can't do this on barrelfish yet */
    68111
    69112#endif // CMINUSMINUS
    70113
     
    91134
    92135#define OSThreadProcAttr __stdcall
    93136
     137#define OSThreadNullId
     138
    94139#define INIT_COND_VAR  0
    95140
    96141// We have a choice for implementing Mutexes on Windows.  Standard
  • includes/Rts.h

    diff -rN -u old-ghc_bf/includes/Rts.h new-ghc_bf-2/includes/Rts.h
    old new  
    223223
    224224void stg_exit(int n) GNU_ATTRIBUTE(__noreturn__);
    225225
    226 #ifndef mingw32_HOST_OS
     226#if !defined(mingw32_HOST_OS) && !defined(barrelfish_HOST_OS)
    227227int stg_sig_install (int, int, void *);
    228228#endif
    229229
  • libffi/bfish.patch

    diff -rN -u old-ghc_bf/libffi/bfish.patch new-ghc_bf-2/libffi/bfish.patch
    old new  
     1diff -Nur build_old/src/closures.c build/src/closures.c
     2--- build_old/src/closures.c    2010-08-03 11:41:04.924917426 +0100
     3+++ build/src/closures.c        2010-08-03 12:33:32.397267337 +0100
     4@@ -99,14 +100,16 @@
     5 
     6 #include <sys/types.h>
     7 #include <sys/stat.h>
     8+#ifndef BARRELFISH
     9 #include <fcntl.h>
     10+#endif
     11 #include <errno.h>
     12 #ifndef _MSC_VER
     13 #include <unistd.h>
     14 #endif
     15 #include <string.h>
     16 #include <stdio.h>
     17-#if !defined(X86_WIN32) && !defined(X86_WIN64)
     18+#if !defined(X86_WIN32) && !defined(X86_WIN64) && !defined(BARRELFISH)
     19 #ifdef HAVE_MNTENT
     20 #include <mntent.h>
     21 #endif /* HAVE_MNTENT */
     22@@ -116,6 +119,7 @@
     23 /* We don't want sys/mman.h to be included after we redefine mmap and
     24    dlmunmap.  */
     25 #include <sys/mman.h>
     26+
     27 #define LACKS_SYS_MMAN_H 1
     28 
     29 #if FFI_MMAP_EXEC_SELINUX
     30@@ -193,7 +197,7 @@
     31 static size_t dlmalloc_usable_size(void*) MAYBE_UNUSED;
     32 static void dlmalloc_stats(void) MAYBE_UNUSED;
     33 
     34-#if !(defined(X86_WIN32) || defined(X86_WIN64)) || defined (__CYGWIN__)
     35+#if !(defined(X86_WIN32) || defined(X86_WIN64) || defined(BARRELFISH)) || defined (__CYGWIN__)
     36 /* Use these for mmap and munmap within dlmalloc.c.  */
     37 static void *dlmmap(void *, size_t, int, int, int, off_t);
     38 static int dlmunmap(void *, size_t);
     39@@ -487,6 +491,9 @@
     40        int flags, int fd, off_t offset)
     41 {
     42   
     43+#ifdef BARRELFISH
     44+    return NULL;
     45+#else
     46   assert (start == NULL && length % malloc_getpagesize == 0
     47          && prot == (PROT_READ | PROT_WRITE)
     48          && flags == (MAP_PRIVATE | MAP_ANONYMOUS)
     49@@ -497,6 +504,7 @@
     50 #endif
     51   
     52   return mmap (start, length, prot | PROT_EXEC, flags, fd, offset);
     53+#endif
     54 }
     55 
     56 #endif
     57diff -Nur build_old/src/dlmalloc.c build/src/dlmalloc.c
     58--- build_old/src/dlmalloc.c    2010-08-03 11:41:04.936929160 +0100
     59+++ build/src/dlmalloc.c        2010-08-03 12:20:30.873310373 +0100
     60@@ -459,6 +459,18 @@
     61 #define MMAP_CLEARS 0 /* WINCE and some others apparently don't clear */
     62 #endif  /* WIN32 */
     63 
     64+#ifdef BARRELFISH
     65+#define HAVE_MMAP 0
     66+#define HAVE_MORECORE 1
     67+#define LACKS_UNISTD_H
     68+#define LACKS_SYS_PARAM_H
     69+#define LACKS_SYS_MMAN_H
     70+#define LACKS_STRING_H
     71+#define LACKS_STRINGS_H
     72+#define LACKS_SYS_TYPES_H
     73+#define LACKS_ERRNO_H
     74+#endif
     75+
     76 #if defined(DARWIN) || defined(_DARWIN)
     77 /* Mac OSX docs advise not to use sbrk; it seems better to use mmap */
     78 #ifndef HAVE_MORECORE
     79@@ -1387,7 +1399,28 @@
     80     unique mparams values are initialized only once.
     81 */
     82 
     83-#ifndef WIN32
     84+#ifdef BARRELFISH
     85+#include <barrelfish/barrelfish.h>
     86+#define MLOCK_T struct thread_mutex
     87+static inline int thread_mutex_lock_wrapper(struct thread_mutex* l) {
     88+    thread_mutex_lock(l);
     89+    return 0;
     90+}
     91+static inline int thread_mutex_unlock_wrapper(struct thread_mutex* l) {
     92+    thread_mutex_unlock(l);
     93+    return 0;
     94+}
     95+#define INITIAL_LOCK(l)      thread_mutex_init(l)
     96+#define ACQUIRE_LOCK(l)      thread_mutex_lock_wrapper(l)
     97+#define RELEASE_LOCK(l)      thread_mutex_unlock_wrapper(l)
     98+
     99+#if HAVE_MORECORE
     100+static MLOCK_T morecore_mutex = THREAD_MUTEX_INITIALIZER;
     101+#endif /* HAVE_MORECORE */
     102+
     103+static MLOCK_T magic_init_mutex = THREAD_MUTEX_INITIALIZER;
     104+
     105+#elif !defined(WIN32)
     106 /* By default use posix locks */
     107 #include <pthread.h>
     108 #define MLOCK_T pthread_mutex_t
  • libffi/ghc.mk

    diff -rN -u old-ghc_bf/libffi/ghc.mk new-ghc_bf-2/libffi/ghc.mk
    old new  
    3434#
    3535# We use libffi's own configuration stuff.
    3636
    37 PLATFORM := $(shell echo $(HOSTPLATFORM) | sed 's/i[567]86/i486/g')
     37FFI_BUILDPLATFORM := $(shell echo $(BUILDPLATFORM) | sed 's/i[567]86/i486/g')
     38FFI_HOSTPLATFORM := $(shell echo $(HOSTPLATFORM) | sed 's/i[567]86/i486/g')
    3839
    3940# 2007-07-05
    4041# Passing
     
    105106        cat ghc-tarballs/libffi/libffi*.tar.gz | $(GZIP_CMD) -d | { cd libffi && $(TAR_CMD) -xf - ; }
    106107        mv libffi/libffi-* libffi/build
    107108        chmod +x libffi/ln
     109ifeq "$(HostOS_CPP)" "barrelfish"
     110        cp config.sub libffi/build/config.sub
     111        (cd libffi; patch -p0  < bfish.patch)
     112endif
    108113
    109114# Because -Werror may be in SRC_CC_OPTS/SRC_LD_OPTS, we need to turn
    110115# warnings off or the compilation of libffi might fail due to warnings
     
    116121            LD=$(LD) \
    117122            AR=$(AR) \
    118123            NM=$(NM) \
    119         CFLAGS="$(SRC_CC_OPTS) $(CONF_CC_OPTS) -w" \
    120         LDFLAGS="$(SRC_LD_OPTS) $(CONF_LD_OPTS) -w" \
     124        CFLAGS="$(SRC_CC_OPTS) $(CONF_CC_OPTS) $(STAGE_1_CC_OPTS)  -w" \
     125        LDFLAGS="$(SRC_LD_OPTS) $(CONF_LD_OPTS) $(LIBFFI_LD_OPTS) -w" \
    121126        "$(SHELL)" configure \
    122127                  --enable-static=yes \
    123                   --enable-shared=$(libffi_EnableShared) \
    124                   --host=$(PLATFORM) --build=$(PLATFORM)
     128                  --enable-shared=no \
     129                  --host=$(FFI_HOSTPLATFORM) --build=$(FFI_BUILDPLATFORM)
    125130
    126131        # libffi.so needs to be built with the correct soname.
    127132        # NOTE: this builds libffi_convience.so with the incorrect
  • mk/build.mk.bf

    diff -rN -u old-ghc_bf/mk/build.mk.bf new-ghc_bf-2/mk/build.mk.bf
    old new  
     1# -----------------------------------------------------------------------------
     2# A Sample build.mk
     3#
     4# Uncomment one of the following BuildFlavour settings to get the desired
     5# overall build type, and then tweak the options in the relevant section
     6# below.
     7
     8# Uncomment one of these to select a build profile below:
     9
     10# Fast build with barrelfish support
     11BuildFlavour = bf
     12
     13
     14# -------- A Fast build with optimised libs ----------------------------------
     15
     16ifeq "$(BuildFlavour)" "bf"
     17
     18# TODO - Not hard code these...
     19BF_ROOT            = ${HOME}/barrelfish.ghc/
     20BF_BUILD_DIR       = ${BF_ROOT}/build/x86_64/
     21
     22STAGE_1_CC_OPTS    = -fno-builtin -nostdinc -m64 -mno-red-zone -fPIE -fno-stack-protector -U__linux__ -imacros ${BF_ROOT}/include/deputy/nodeputy.h -DBARRELFISH -DMAX_CPUS=64 -DCONFIG_INTERCONNECT_DRIVER_LMP -DCONFIG_INTERCONNECT_DRIVER_UMP -DCONFIG_FLOUNDER_BACKEND_LMP -DCONFIG_FLOUNDER_BACKEND_UMP -g  -I${BF_ROOT}/include -I${BF_ROOT}/include/arch/x86_64 -I${BF_BUILD_DIR}/include
     23STAGE_2_CC_OPTS    = ${STAGE_1_CC_OPTS}
     24
     25STAGE_1_LD_OPTS    = -static ${BF_BUILD_DIR}/lib/crt0.o  ${BF_BUILD_DIR}/errors/errno.o -Wl,-section-start,.data.rel.ro=0x800000 -Wl,-z,max-page-size=0x1000 -fno-builtin -nostdlib -m64 -L${BF_BUILD_DIR}/lib/ -Wl,--start-group -lmsun -lposixcompat -lvfs -lnfs -llwip -ltimer -lbarrelfish -lc
     26#endif
     27STAGE_2_LD_OPTS    = ${STAGE_1_LD_OPTS}
     28
     29LIBFFI_LD_OPTS     = -static -Wl,-section-start,.data.rel.ro=0x800000 -Wl,-z,max-page-size=0x1000 -fno-builtin -nostdlib -m64 -L${BF_BUILD_DIR}/lib/ -lbarrelfish -lc
     30
     31BUILTIN_HC_OPTS    = $(addprefix -optc, $(STAGE_1_CC_OPTS)) $(addprefix -optl, $(STAGE_1_LD_OPTS)) -opta-m64
     32
     33SRC_HC_OPTS        = -H64m -O0 -fasm
     34GhcStage1HcOpts    = -O -fasm
     35GhcLibHcOpts       = -O -fasm
     36GhcLibWays         = v
     37GhcRTSWays         = v thr
     38SplitObjs          = NO
     39HADDOCK_DOCS       = NO
     40BUILD_DOCBOOK_HTML = NO
     41BUILD_DOCBOOK_PS   = NO
     42BUILD_DOCBOOK_PDF  = NO
     43INTEGER_LIBRARY    = integer-simple
     44
     45endif
     46
     47# NoFib settings
     48NoFibWays =
     49STRIP_CMD = :
  • mk/project.mk.in

    diff -rN -u old-ghc_bf/mk/project.mk.in new-ghc_bf-2/mk/project.mk.in
    old new  
    135135Windows=NO
    136136endif
    137137
     138ifneq "$(findstring $(HostOS_CPP), barrelfish)" ""
     139Barrelfish=YES
     140else
     141Barrelfish=NO
     142endif
     143
  • rts/barrelfish/GetTime.c

    diff -rN -u old-ghc_bf/rts/barrelfish/GetTime.c new-ghc_bf-2/rts/barrelfish/GetTime.c
    old new  
     1/* -----------------------------------------------------------------------------
     2 *
     3 * (c) The GHC Team 2005
     4 *
     5 * Machine-dependent time measurement functions
     6 *
     7 * ---------------------------------------------------------------------------*/
     8
     9// Not POSIX, due to use of ru_majflt in getPageFaults()
     10// #include "PosixSource.h"
     11
     12#include "Rts.h"
     13#include "GetTime.h"
     14
     15Ticks getProcessCPUTime(void)
     16{
     17    printf("NYI getProcessCPUTime\n");
     18    return -1;
     19}
     20
     21Ticks getProcessElapsedTime(void)
     22{
     23    printf("NYI getProcessElapsedTime\n");
     24    return -1;
     25}
     26
     27void getProcessTimes(Ticks *user, Ticks *elapsed)
     28{
     29    *user    = getProcessCPUTime();
     30    *elapsed = getProcessElapsedTime();
     31}
     32
     33Ticks getThreadCPUTime(void)
     34{
     35    return getProcessCPUTime();
     36}
     37nat
     38getPageFaults(void)
     39{
     40    return 0;
     41}
     42
  • rts/barrelfish/Itimer.c

    diff -rN -u old-ghc_bf/rts/barrelfish/Itimer.c new-ghc_bf-2/rts/barrelfish/Itimer.c
    old new  
     1/* -----------------------------------------------------------------------------
     2 *
     3 * (c) The GHC Team, 1995-2007
     4 *
     5 * Interval timer for profiling and pre-emptive scheduling.
     6 *
     7 * ---------------------------------------------------------------------------*/
     8
     9#include "Rts.h"
     10
     11#include "Ticker.h"
     12
     13/* TODO */
     14
     15void
     16initTicker (nat ms, TickProc handle_tick)
     17{
     18}
     19
     20void
     21startTicker(void)
     22{
     23}
     24
     25void
     26stopTicker(void)
     27{
     28}
     29
     30void
     31exitTicker (rtsBool wait STG_UNUSED)
     32{
     33}
     34
  • rts/barrelfish/OSMem.c

    diff -rN -u old-ghc_bf/rts/barrelfish/OSMem.c new-ghc_bf-2/rts/barrelfish/OSMem.c
    old new  
     1/* -----------------------------------------------------------------------------
     2 *
     3 * (c) The University of Glasgow 2006-2007
     4 *
     5 * OS-specific memory management
     6 *
     7 * ---------------------------------------------------------------------------*/
     8
     9// This is non-posix compliant.
     10// #include "PosixSource.h"
     11
     12#include "Rts.h"
     13#include "barrelfish/barrelfish.h"
     14
     15#include "RtsUtils.h"
     16#include "sm/OSMem.h"
     17
     18#include <errno.h>
     19
     20#define MAP_FLAGS VREGION_FLAGS_READ | VREGION_FLAGS_WRITE | VREGION_FLAGS_EXECUTE
     21
     22/* alloc_rec keeps the info we need to have matching mmap and unmap calls. */
     23typedef struct alloc_rec_ {
     24    char* base;     /* non-aligned base address, directly from mmap */
     25    int size;       /* Size in bytes */
     26    struct alloc_rec_* next;
     27} alloc_rec;
     28
     29typedef struct block_rec_ {
     30    char* base;         /* base address, non-MBLOCK-aligned */
     31    int size;           /* size in bytes */
     32    struct block_rec_* next;
     33} block_rec;
     34
     35static alloc_rec* allocs = NULL;
     36static block_rec* free_blocks = NULL;
     37
     38void
     39osMemInit(void)
     40{
     41    allocs = NULL;
     42    free_blocks = NULL;
     43}
     44
     45static
     46alloc_rec*
     47allocNew(nat n) {
     48    alloc_rec* rec;
     49    rec = (alloc_rec*)stgMallocBytes(sizeof(alloc_rec),"getMBlocks: allocNew");
     50    rec->size = (n+1)*MBLOCK_SIZE;
     51    struct capref frame;
     52
     53    errval_t err = frame_alloc(&frame, rec->size, NULL);
     54    if(err_is_fail(err)) {
     55        DEBUG_ERR(err, "OS_Mem, frame create");
     56        exit(-1);
     57    }
     58
     59    struct memobj * memobj;
     60    struct vregion * vregion;
     61    err = vspace_map_one_frame_attr(
     62                                    (void **)&rec->base, rec->size, frame,
     63                        MAP_FLAGS, &memobj, &vregion);
     64    if(err_is_fail(err) || rec->base==0) {
     65        stgFree((void*)rec);
     66        rec=0;
     67        DEBUG_ERR(err, "OS_Mem, map one frame");
     68        errorBelch("vspace_map_one_frame failed");
     69    } else {
     70        alloc_rec temp;
     71        temp.base=0; temp.size=0; temp.next=allocs;
     72
     73        alloc_rec* it;
     74        it=&temp;
     75        for(; it->next!=0 && it->next->base<rec->base; it=it->next) ;
     76        rec->next=it->next;
     77        it->next=rec;
     78        allocs=temp.next;
     79    }
     80    return rec;
     81}
     82
     83static
     84void
     85insertFree(char* alloc_base, int alloc_size) {
     86    block_rec temp;
     87    block_rec* it;
     88    block_rec* prev;
     89
     90    temp.base=0; temp.size=0; temp.next=free_blocks;
     91    it = free_blocks;
     92    prev = &temp;
     93    for( ; it!=0 && it->base<alloc_base; prev=it, it=it->next) {}
     94
     95    if(it!=0 && alloc_base+alloc_size == it->base) {
     96        if(prev->base + prev->size == alloc_base) {        /* Merge it, alloc, prev */
     97            prev->size += alloc_size + it->size;
     98            prev->next = it->next;
     99            stgFree(it);
     100        } else {                                            /* Merge it, alloc */
     101            it->base = alloc_base;
     102            it->size += alloc_size;
     103        }
     104    } else if(prev->base + prev->size == alloc_base) {     /* Merge alloc, prev */
     105        prev->size += alloc_size;
     106    } else {                                                /* Merge none */
     107        block_rec* rec;
     108        rec = (block_rec*)stgMallocBytes(sizeof(block_rec),"getMBlocks: insertFree");
     109        rec->base=alloc_base;
     110        rec->size=alloc_size;
     111        rec->next = it;
     112        prev->next=rec;
     113    }
     114    free_blocks=temp.next;
     115}
     116
     117static
     118void*
     119findFreeBlocks(nat n) {
     120    void* ret=0;
     121    block_rec* it;
     122    block_rec temp;
     123    block_rec* prev;
     124
     125    int required_size;
     126    it=free_blocks;
     127    required_size = n*MBLOCK_SIZE;
     128    temp.next=free_blocks; temp.base=0; temp.size=0;
     129    prev=&temp;
     130    /* TODO: Don't just take first block, find smallest sufficient block */
     131    for( ; it!=0 && it->size<required_size; prev=it, it=it->next ) {}
     132    if(it!=0) {
     133        if( (((unsigned long)it->base) & MBLOCK_MASK) == 0) { /* MBlock aligned */
     134            ret = (void*)it->base;
     135            if(it->size==required_size) {
     136                prev->next=it->next;
     137                stgFree(it);
     138            } else {
     139                it->base += required_size;
     140                it->size -=required_size;
     141            }
     142        } else {
     143            char* need_base;
     144            block_rec* next;
     145            int new_size;
     146            need_base = (char*)(((unsigned long)it->base) & ((unsigned long)~MBLOCK_MASK)) + MBLOCK_SIZE;
     147            next = (block_rec*)stgMallocBytes(
     148                    sizeof(block_rec)
     149                    , "getMBlocks: findFreeBlocks: splitting");
     150            new_size = need_base - it->base;
     151            next->base = need_base +required_size;
     152            next->size = it->size - (new_size+required_size);
     153            it->size = new_size;
     154            next->next = it->next;
     155            it->next = next;
     156            ret=(void*)need_base;
     157        }
     158    }
     159    free_blocks=temp.next;
     160    return ret;
     161}
     162
     163void *
     164osGetMBlocks(nat n) {
     165    void* ret;
     166    ret = findFreeBlocks(n);
     167    if(ret==0) {
     168        alloc_rec* alloc;
     169        alloc = allocNew(n);
     170        /* We already belch in allocNew if it fails */
     171        if (alloc == 0) {
     172            stg_exit(EXIT_FAILURE);
     173        } else {
     174            insertFree(alloc->base, alloc->size);
     175            ret = findFreeBlocks(n);
     176        }
     177    }
     178
     179    return ret;
     180}
     181
     182void
     183osFreeAllMBlocks(void)
     184{
     185    {
     186        block_rec* next;
     187        block_rec* it;
     188        next=0;
     189        it = free_blocks;
     190        for(; it!=0; ) {
     191            next = it->next;
     192            stgFree(it);
     193            it=next;
     194        }
     195    }
     196    {
     197        alloc_rec* next;
     198        alloc_rec* it;
     199        next=0;
     200        it=allocs;
     201        for(; it!=0; ) {
     202            if(err_is_fail(vspace_unmap((void*)it->base))) {
     203                sysErrorBelch("freeAllMBlocks: vspace_unmap failed");
     204                stg_exit(EXIT_FAILURE);
     205            }
     206            next = it->next;
     207            stgFree(it);
     208            it=next;
     209        }
     210    }
     211}
     212
     213lnat getPageSize (void)
     214{
     215    return BASE_PAGE_SIZE;
     216}
     217
     218void setExecutable (void *p, lnat len, rtsBool exec)
     219{
     220    // TODO - at the moment we just map all memory as executable, once
     221    // we can do the equivalent of mprotect in barrelfish we should
     222    // revisit this
     223}
  • rts/barrelfish/OSThreads.c

    diff -rN -u old-ghc_bf/rts/barrelfish/OSThreads.c new-ghc_bf-2/rts/barrelfish/OSThreads.c
    old new  
     1/* ---------------------------------------------------------------------------
     2 *
     3 * (c) The GHC Team, 2001-2005
     4 *
     5 * Accessing OS threads functionality in a (mostly) OS-independent
     6 * manner.
     7 *
     8 * --------------------------------------------------------------------------*/
     9
     10#include "PosixSource.h"
     11#include "Rts.h"
     12
     13#if defined(THREADED_RTS)
     14#include "barrelfish/barrelfish.h"
     15
     16void
     17initCondition( Condition* pCond )
     18{
     19  thread_cond_init(pCond);
     20  return;
     21}
     22
     23void
     24closeCondition( Condition* pCond )
     25{
     26  // TODO what do we do here?
     27  return;
     28}
     29
     30rtsBool
     31broadcastCondition ( Condition* pCond )
     32{
     33  thread_cond_broadcast(pCond);
     34  return true;
     35}
     36
     37rtsBool
     38signalCondition ( Condition* pCond )
     39{
     40  thread_cond_signal(pCond);
     41  return true;
     42}
     43
     44rtsBool
     45waitCondition ( Condition* pCond, Mutex* pMut )
     46{
     47    thread_cond_wait(pCond, pMut);
     48  return true;
     49}
     50
     51void
     52yieldThread()
     53{
     54  thread_yield();
     55  return;
     56}
     57
     58void
     59shutdownThread()
     60{
     61  thread_exit();
     62}
     63
     64int
     65createOSThread (OSThreadId* pId, OSThreadProc *startProc, void *param)
     66{
     67  printf("Creating Thread\n");
     68  *pId = thread_create(startProc, param);  // TODO - start on right core!!
     69  return 0;
     70}
     71
     72OSThreadId
     73osThreadId()
     74{
     75  return thread_self();
     76}
     77
     78rtsBool
     79osThreadIsAlive(OSThreadId id STG_UNUSED)
     80{
     81    // no good way to implement this on POSIX, AFAICT.  Returning true
     82    // is safe.
     83    return true;
     84}
     85
     86void
     87initMutex(Mutex* pMut)
     88{
     89    thread_mutex_init(pMut);
     90    return;
     91}
     92void
     93closeMutex(Mutex* pMut)
     94{
     95    // how do we do this?
     96}
     97
     98void
     99newThreadLocalKey (ThreadLocalKey *key)
     100{
     101    static int curr_key = 1;
     102    *key = curr_key++;
     103}
     104
     105void *
     106getThreadLocalVar (ThreadLocalKey *key)
     107{
     108    if (*key != 1) printf("Error, invalid thread local key\n");
     109    return thread_self()->tls;
     110}
     111
     112void
     113setThreadLocalVar (ThreadLocalKey *key, void *value)
     114{
     115    if (*key != 1) printf("Error, invalid thread local key\n");
     116    thread_self()->tls = value;
     117}
     118
     119void
     120freeThreadLocalKey (ThreadLocalKey *key)
     121{
     122    // TODO
     123}
     124
     125int
     126forkOS_createThread ( HsStablePtr entry )
     127{
     128    printf("NYI forkOS_createThread\n");
     129    exit(-1);
     130}
     131
     132nat
     133getNumberOfProcessors (void)
     134{
     135    static nat nproc = 0;
     136
     137    if (nproc == 0) {
     138        // todo - move num_cores request to a blocking rpc
     139        printf("NYI getNumberOfProcessors\n");
     140        exit(-1);
     141    }
     142
     143    return nproc;
     144}
     145
     146#if defined(HAVE_SCHED_SETAFFINITY)
     147// Schedules the thread to run on CPU n of m.  m may be less than the
     148// number of physical CPUs, in which case, the thread will be allowed
     149// to run on CPU n, n+m, n+2m etc.
     150void
     151setThreadAffinity (nat n, nat m)
     152{
     153    printf("NYI setThreadAffinity\n");
     154    exit(-1);
     155}
     156
     157#else
     158void
     159setThreadAffinity (nat n GNUC3_ATTRIBUTE(__unused__),
     160                   nat m GNUC3_ATTRIBUTE(__unused__))
     161{
     162}
     163#endif
     164
     165#else /* !defined(THREADED_RTS) */
     166
     167int
     168forkOS_createThread ( HsStablePtr entry STG_UNUSED )
     169{
     170    return -1;
     171}
     172
     173#endif /* !defined(THREADED_RTS) */
  • rts/barrelfish/Select.c

    diff -rN -u old-ghc_bf/rts/barrelfish/Select.c new-ghc_bf-2/rts/barrelfish/Select.c
    old new  
     1/* -----------------------------------------------------------------------------
     2 *
     3 * (c) The GHC Team 1995-2002
     4 *
     5 * Support for concurrent non-blocking I/O and thread waiting.
     6 *
     7 * ---------------------------------------------------------------------------*/
     8
     9#include "Rts.h"
     10
     11#if !defined(THREADED_RTS)
     12
     13
     14
     15void
     16awaitEvent(rtsBool wait)
     17{
     18    printf("NYI awateEvent\n");
     19}
     20
     21#endif /* THREADED_RTS */
  • rts/barrelfish/Select.h

    diff -rN -u old-ghc_bf/rts/barrelfish/Select.h new-ghc_bf-2/rts/barrelfish/Select.h
    old new  
     1/* -----------------------------------------------------------------------------
     2 *
     3 * (c) The GHC Team 1998-2005
     4 *
     5 * Prototypes for functions in Select.c
     6 *
     7 * -------------------------------------------------------------------------*/
     8
     9#ifndef POSIX_SELECT_H
     10#define POSIX_SELECT_H
     11
     12#if !defined(THREADED_RTS)
     13/* In Select.c */
     14extern lnat timestamp;
     15#endif
     16
     17#endif /* POSIX_SELECT_H */
  • rts/barrelfish/Signals.c

    diff -rN -u old-ghc_bf/rts/barrelfish/Signals.c new-ghc_bf-2/rts/barrelfish/Signals.c
    old new  
     1/* -----------------------------------------------------------------------------
     2 *
     3 * (c) The GHC Team, 1998-2005
     4 *
     5 * Signal processing / handling.
     6 *
     7 * ---------------------------------------------------------------------------*/
     8
     9#include "PosixSource.h"
     10#include "Rts.h"
     11
     12#include "Schedule.h"
     13#include "RtsSignals.h"
     14#include "Signals.h"
     15#include "RtsUtils.h"
     16#include "Prelude.h"
     17#include "Stable.h"
     18
     19#ifdef HAVE_SIGNAL_H
     20# include <signal.h>
     21#endif
     22
     23#ifdef HAVE_ERRNO_H
     24# include <errno.h>
     25#endif
     26
     27#include <stdlib.h>
     28#include <string.h>
     29
     30
     31static void
     32more_handlers(int sig)
     33{
     34    printf("NYI more_handlers\n");
     35    exit(-1);
     36}
     37
     38void
     39setIOManagerPipe (int fd)
     40{
     41    printf("NYI setIOManagerPipe\n");
     42    exit(-1);
     43}
     44
     45void
     46ioManagerWakeup (void)
     47{
     48    printf("NYI ioManagerWakeup\n");
     49    exit(-1);
     50}
     51
     52void
     53ioManagerSync (void)
     54{
     55    printf("NYI ioManagerSync\n");
     56    exit(-1);
     57}
     58
     59#if defined(THREADED_RTS)
     60void
     61ioManagerDie (void)
     62{
     63    printf("NYI ioManagerDie\n");
     64    exit(-1);
     65}
     66
     67Capability *
     68ioManagerStartCap (Capability *cap)
     69{
     70    return rts_evalIO(cap,&base_GHCziConc_ensureIOManagerIsRunning_closure,NULL);
     71}
     72
     73void
     74ioManagerStart (void)
     75{
     76    // Make sure the IO manager thread is running
     77    Capability *cap;
     78    cap = rts_lock();
     79    cap = ioManagerStartCap(cap);
     80    rts_unlock(cap);
     81}
     82#endif
     83
     84/* -----------------------------------------------------------------------------
     85 * Blocking/Unblocking of the user signals
     86 * -------------------------------------------------------------------------- */
     87
     88void
     89initUserSignals(void)
     90{
     91    printf("NYI initUserSignals\n");
     92    exit(-1);
     93}
     94
     95void
     96blockUserSignals(void)
     97{
     98    printf("NYI blockUserSignals\n");
     99    exit(-1);
     100}
     101
     102void
     103unblockUserSignals(void)
     104{
     105    printf("NYI unblockUserSignals\n");
     106    exit(-1);
     107}
     108
     109rtsBool
     110anyUserHandlers(void)
     111{
     112    printf("NYI unblockUserSignals\n");
     113    exit(-1);
     114}
     115
     116#if !defined(THREADED_RTS)
     117void
     118awaitUserSignals(void)
     119{
     120    printf("NYI awaitUserSignals\n");
     121    exit(-1);
     122}
     123#endif
     124
     125/* -----------------------------------------------------------------------------
     126 * Install a Haskell signal handler.
     127 *
     128 * We should really do this in Haskell in GHC.Conc, and share the
     129 * signal_handlers array with the one there.
     130 *
     131 * -------------------------------------------------------------------------- */
     132
     133int
     134stg_sig_install(int sig, int spi, void *mask)
     135{
     136    printf("NYI stg_sig_install\n");
     137    exit(-1);
     138}
     139
     140/* -----------------------------------------------------------------------------
     141 * Creating new threads for signal handlers.
     142 * -------------------------------------------------------------------------- */
     143
     144#if !defined(THREADED_RTS)
     145void
     146startSignalHandlers(Capability *cap)
     147{
     148    printf("NYI stg_sig_install\n");
     149    exit(-1);
     150}
     151#endif
     152
     153/* ----------------------------------------------------------------------------
     154 * Mark signal handlers during GC.
     155 * -------------------------------------------------------------------------- */
     156
     157void
     158markSignalHandlers (evac_fn evac STG_UNUSED, void *user STG_UNUSED)
     159{
     160    // nothing to do
     161}
     162
     163void
     164resetDefaultHandlers(void)
     165{
     166    return;
     167}
  • rts/barrelfish/Signals.h

    diff -rN -u old-ghc_bf/rts/barrelfish/Signals.h new-ghc_bf-2/rts/barrelfish/Signals.h
    old new  
     1/* -----------------------------------------------------------------------------
     2 *
     3 * (c) The GHC Team, 1998-2005
     4 *
     5 * Signal processing / handling.
     6 *
     7 * ---------------------------------------------------------------------------*/
     8
     9#ifndef BFISH_SIGNALS_H
     10#define BFISH_SIGNALS_H
     11
     12#ifdef HAVE_SIGNAL_H
     13# include <signal.h>
     14#endif
     15
     16#include "BeginPrivate.h"
     17
     18rtsBool anyUserHandlers(void);
     19
     20Capability *ioManagerStartCap (Capability *cap);
     21
     22extern StgInt *signal_handlers;
     23
     24#include "EndPrivate.h"
     25
     26#endif /* BFISH_SIGNALS_H */
     27
  • rts/barrelfish/TTY.c

    diff -rN -u old-ghc_bf/rts/barrelfish/TTY.c new-ghc_bf-2/rts/barrelfish/TTY.c
    old new  
     1/* -----------------------------------------------------------------------------
     2 *
     3 * (c) The GHC Team, 1998-2009
     4 *
     5 * TTY-related functionality
     6 *
     7 * ---------------------------------------------------------------------------*/
     8
     9#include "PosixSource.h"
     10#include "Rts.h"
     11
     12#include "RtsUtils.h" // __hscore_get/set prototypes
     13#include "TTY.h"
     14
     15#ifdef HAVE_TERMIOS_H
     16#include <termios.h>
     17#endif
     18#ifdef HAVE_SIGNAL_H
     19#include <signal.h>
     20#endif
     21
     22// Here we save the terminal settings on the standard file
     23// descriptors, if we need to change them (eg. to support NoBuffering
     24// input).
     25static void *saved_termios[3] = {NULL,NULL,NULL};
     26
     27void*
     28__hscore_get_saved_termios(int fd)
     29{
     30  return (0 <= fd && fd < (int)(sizeof(saved_termios) / sizeof(*saved_termios))) ?
     31    saved_termios[fd] : NULL;
     32}
     33
     34void
     35__hscore_set_saved_termios(int fd, void* ts)
     36{
     37  if (0 <= fd && fd < (int)(sizeof(saved_termios) / sizeof(*saved_termios))) {
     38    saved_termios[fd] = ts;
     39  }
     40}
     41
     42void
     43resetTerminalSettings (void)
     44{
     45#if HAVE_TERMIOS_H
     46    // Reset the terminal settings on the standard file descriptors,
     47    // if we changed them.  See System.Posix.Internals.tcSetAttr for
     48    // more details, including the reason we termporarily disable
     49    // SIGTTOU here.
     50    {
     51        int fd;
     52        sigset_t sigset, old_sigset;
     53        sigemptyset(&sigset);
     54        sigaddset(&sigset, SIGTTOU);
     55        sigprocmask(SIG_BLOCK, &sigset, &old_sigset);
     56        for (fd = 0; fd <= 2; fd++) {
     57            struct termios* ts = (struct termios*)__hscore_get_saved_termios(fd);
     58            if (ts != NULL) {
     59                tcsetattr(fd,TCSANOW,ts);
     60            }
     61        }
     62        sigprocmask(SIG_SETMASK, &old_sigset, NULL);
     63    }
     64#endif
     65}
  • rts/barrelfish/TTY.h

    diff -rN -u old-ghc_bf/rts/barrelfish/TTY.h new-ghc_bf-2/rts/barrelfish/TTY.h
    old new  
     1/* -----------------------------------------------------------------------------
     2 *
     3 * (c) The GHC Team, 1998-2009
     4 *
     5 * TTY-related functionality
     6 *
     7 * ---------------------------------------------------------------------------*/
     8
     9#ifndef POSIX_TTY_H
     10#define POSIX_TTY_H
     11
     12RTS_PRIVATE void resetTerminalSettings (void);
     13
     14#endif /* POSIX_TTY_H */
  • rts/ghc.mk

    diff -rN -u old-ghc_bf/rts/ghc.mk new-ghc_bf-2/rts/ghc.mk
    old new  
    3131
    3232ifeq "$(HOSTPLATFORM)" "i386-unknown-mingw32"
    3333ALL_DIRS += win32
     34else
     35ifeq "$(HOSTPLATFORM)" "x86_64-unknown-barrelfish"
     36ALL_DIRS += barrelfish
    3437else
    3538ALL_DIRS += posix
    3639endif
     40endif
    3741
    3842EXCLUDED_SRCS += rts/Main.c
    3943EXCLUDED_SRCS += rts/parallel/SysMan.c
     
    274278rts_CC_OPTS += -DBE_CONSERVATIVE
    275279endif
    276280
     281rts_CC_OPTS += $(STAGE_1_CC_OPTS)
     282
    277283#-----------------------------------------------------------------------------
    278284# Flags for compiling specific files
    279285
  • rts/Linker.c

    diff -rN -u old-ghc_bf/rts/Linker.c new-ghc_bf-2/rts/Linker.c
    old new  
    2929#include "StgPrimFloat.h" // for __int_encodeFloat etc.
    3030#include "Stable.h"
    3131
    32 #if !defined(mingw32_HOST_OS)
     32#if !defined(mingw32_HOST_OS) && !defined(barrelfish_HOST_OS)
    3333#include "posix/Signals.h"
    3434#endif
    3535
     
    240240                                SymI_HasProto(stg_makeStableNamezh)             \
    241241                                SymI_HasProto(stg_finalizzeWeakzh)
    242242
    243 #if !defined (mingw32_HOST_OS)
     243#if !defined (mingw32_HOST_OS) && !defined(barrelfish_HOST_OS)
    244244#define RTS_POSIX_ONLY_SYMBOLS                  \
    245245      SymI_HasProto(__hscore_get_saved_termios) \
    246246      SymI_HasProto(__hscore_set_saved_termios) \
     
    339339#elif !defined(mingw32_HOST_OS)
    340340#define RTS_MINGW_ONLY_SYMBOLS /**/
    341341#define RTS_CYGWIN_ONLY_SYMBOLS /**/
     342#ifdef barrelfish_HOST_OS
     343#define RTS_POSIX_ONLY_SYMBOLS  /**/
     344#endif
    342345#else /* defined(mingw32_HOST_OS) */
    343346#define RTS_POSIX_ONLY_SYMBOLS  /**/
    344347#define RTS_CYGWIN_ONLY_SYMBOLS /**/
     
    513516# define MAIN_CAP_SYM
    514517#endif
    515518
     519#ifndef RTS_USER_SIGNALS
     520#define RTS_USER_SIGNALS_SYMBOLS /**/
     521#else
    516522#if !defined(mingw32_HOST_OS)
    517523#define RTS_USER_SIGNALS_SYMBOLS \
    518524   SymI_HasProto(setIOManagerPipe) \
     
    528534   SymI_HasProto(getIOManagerEvent)  \
    529535   SymI_HasProto(console_handler)
    530536#endif
     537#endif
    531538
    532539#define RTS_LIBFFI_SYMBOLS                                  \
    533540     SymE_NeedsProto(ffi_prep_cif)                          \
  • rts/package.conf.in

    diff -rN -u old-ghc_bf/rts/package.conf.in new-ghc_bf-2/rts/package.conf.in
    old new  
    2424hs-libraries:   "HSrts"
    2525
    2626extra-libraries:
     27#ifndef barrelfish_HOST_OS
    2728#ifdef HAVE_LIBM
    2829                                "m"             /* for ldexp() */
    2930#endif
     
    4748#if USE_PAPI
    4849                             , "papi"
    4950#endif
     51#endif
    5052
    5153#ifdef INSTALLING
    5254include-dirs:           INCLUDE_DIR PAPI_INCLUDE_DIR
  • rts/PrimOps.cmm

    diff -rN -u old-ghc_bf/rts/PrimOps.cmm new-ghc_bf-2/rts/PrimOps.cmm
    old new  
    17371737
    17381738#ifdef THREADED_RTS
    17391739    foreign "C" barf("delay# on threaded RTS") never returns;
    1740 #else
     1740#elif defined(barrelfish_HOST_OS)
     1741    foreign "C" barf("NYI delay");
     1742#else
    17411743
    17421744    /* args: R1 (microsecond delay amount) */
    17431745    ASSERT(StgTSO_why_blocked(CurrentTSO) == NotBlocked::I16);
    17441746    StgTSO_why_blocked(CurrentTSO) = BlockedOnDelay::I16;
    17451747
    1746 #ifdef mingw32_HOST_OS
     1748#if defined(mingw32_HOST_OS)
    17471749
    17481750    /* could probably allocate this on the heap instead */
    17491751    ("ptr" ares) = foreign "C" stgMallocBytes(SIZEOF_StgAsyncIOResult,
  • rts/RtsSignals.h

    diff -rN -u old-ghc_bf/rts/RtsSignals.h new-ghc_bf-2/rts/RtsSignals.h
    old new  
    99#ifndef RTSSIGNALS_H
    1010#define RTSSIGNALS_H
    1111
    12 #if !defined(mingw32_HOST_OS)
     12#if !defined(mingw32_HOST_OS) && !defined(barrelfish_HOST_OS)
    1313
    1414#include "posix/Signals.h"
    1515
  • rts/RtsStartup.c

    diff -rN -u old-ghc_bf/rts/RtsStartup.c new-ghc_bf-2/rts/RtsStartup.c
    old new  
    4949#include "win32/AsyncIO.h"
    5050#endif
    5151
    52 #if !defined(mingw32_HOST_OS)
     52#if !defined(mingw32_HOST_OS) && !defined(barrelfish_HOST_OS)
    5353#include "posix/TTY.h"
    5454#include "posix/FileLock.h"
    5555#endif
     
    184184
    185185    getStablePtr((StgPtr)runSparks_closure);
    186186    getStablePtr((StgPtr)ensureIOManagerIsRunning_closure);
    187 #ifndef mingw32_HOST_OS
     187#if !defined(mingw32_HOST_OS) &&!defined(barrelfish_HOST_OS)
    188188    getStablePtr((StgPtr)runHandlers_closure);
    189189#endif
    190190
     
    192192    initGlobalStore();
    193193
    194194    /* initialise file locking, if necessary */
    195 #if !defined(mingw32_HOST_OS)    
     195#if !defined(mingw32_HOST_OS) && !defined(barrelfish_HOST_OS)    
    196196    initFileLocking();
    197197#endif
    198198
     
    402402    exitLinker();
    403403
    404404    /* free file locking tables, if necessary */
    405 #if !defined(mingw32_HOST_OS)    
     405#if !defined(mingw32_HOST_OS) && !defined(barrelfish_HOST_OS)
    406406    freeFileLocking();
    407407#endif
    408408
     
    489489    }
    490490}
    491491
    492 #ifndef mingw32_HOST_OS
     492#if !defined(mingw32_HOST_OS) && !defined(barrelfish_HOST_OS)
    493493void
    494494shutdownHaskellAndSignal(int sig)
    495495{
  • rts/RtsUtils.c

    diff -rN -u old-ghc_bf/rts/RtsUtils.c new-ghc_bf-2/rts/RtsUtils.c
    old new  
    420420int genericRaise(int sig) {
    421421#if defined(THREADED_RTS) && (defined(openbsd_HOST_OS) || defined(freebsd_HOST_OS) || defined(dragonfly_HOST_OS))
    422422        return pthread_kill(pthread_self(), sig);
     423#elif defined(barrelfish_HOST_OS)
     424        printf("NYI generic Raise\n");
     425        return -1;
    423426#else
    424427        return raise(sig);
    425428#endif
  • rts/Schedule.c

    diff -rN -u old-ghc_bf/rts/Schedule.c new-ghc_bf-2/rts/Schedule.c
    old new  
    107107Mutex sched_mutex;
    108108#endif
    109109
    110 #if !defined(mingw32_HOST_OS)
     110#if !defined(mingw32_HOST_OS) && !defined(barrelfish_HOST_OS)
    111111#define FORKPROCESS_PRIMOP_SUPPORTED
    112112#endif
    113113
  • rts/sm/GC.c

    diff -rN -u old-ghc_bf/rts/sm/GC.c new-ghc_bf-2/rts/sm/GC.c
    old new  
    846846    gen_workspace *ws;
    847847
    848848#ifdef THREADED_RTS
    849     t->id = 0;
     849    t->id = OSThreadNullId;
    850850    initSpinLock(&t->gc_spin);
    851851    initSpinLock(&t->mut_spin);
    852852    ACQUIRE_SPIN_LOCK(&t->gc_spin);
  • rts/Stats.c

    diff -rN -u old-ghc_bf/rts/Stats.c new-ghc_bf-2/rts/Stats.c
    old new  
    208208void
    209209stat_startInit(void)
    210210{
     211#ifndef barrelfish_HOST_OS
    211212    Ticks elapsed;
    212213
    213214    elapsed = getProcessElapsedTime();
    214215    ElapsedTimeStart = elapsed;
     216#endif
    215217}
    216218
    217219void
    218220stat_endInit(void)
    219221{
     222#ifndef barrelfish_HOST_OS
    220223    Ticks user, elapsed;
    221224
    222225    getProcessTimes(&user, &elapsed);
     
    238241    papi_is_reporting = 1;
    239242
    240243#endif
     244#endif
    241245}
    242246
    243247/* -----------------------------------------------------------------------------
     
    249253void
    250254stat_startExit(void)
    251255{
     256#ifndef barrelfish_HOST_OS
    252257    Ticks user, elapsed;
    253258
    254259    getProcessTimes(&user, &elapsed);
     
    270275    papi_is_reporting = 0;
    271276
    272277#endif
     278#endif
    273279}
    274280
    275281void
    276282stat_endExit(void)
    277283{
     284#ifndef barrelfish_HOST_OS
    278285    Ticks user, elapsed;
    279286
    280287    getProcessTimes(&user, &elapsed);
     
    287294    if (ExitElapsedTime < 0) {
    288295        ExitElapsedTime = 0;
    289296    }
     297#endif
    290298}
    291299
    292300/* -----------------------------------------------------------------------------
  • rules/build-package-data.mk

    diff -rN -u old-ghc_bf/rules/build-package-data.mk new-ghc_bf-2/rules/build-package-data.mk
    old new  
    2828$1_$2_CONFIGURE_OPTS += --with-hscolour="$$(HSCOLOUR_CMD)"
    2929endif
    3030
     31$1_$2_CONFIGURE_OPTS += --configure-option=--build=$$(BUILDPLATFORM)
     32$1_$2_CONFIGURE_OPTS += --configure-option=--host=$$(HOSTPLATFORM)
     33
    3134# We filter out -Werror from SRC_CC_OPTS, because when configure tests
    3235# for a feature it may not generate warning-free C code, and thus may
    3336# think that the feature doesn't exist if -Werror is on.
    34 $1_$2_CONFIGURE_OPTS += --configure-option=CFLAGS="$$(filter-out -Werror,$$(SRC_CC_OPTS)) $$(CONF_CC_OPTS) $$($1_CC_OPTS) $$($1_$2_CC_OPTS)"
    35 $1_$2_CONFIGURE_OPTS += --configure-option=LDFLAGS="$$(SRC_LD_OPTS) $$($1_LD_OPTS) $$($1_$2_LD_OPTS)"
     37$1_$2_CONFIGURE_OPTS += --configure-option=CFLAGS="$$(filter-out -Werror,$$(SRC_CC_OPTS)) $$(CONF_CC_OPTS) $$($1_CC_OPTS) $$($1_$2_CC_OPTS) $$(STAGE_$3_CC_OPTS)"
     38$1_$2_CONFIGURE_OPTS += --configure-option=CPPFLAGS="$$(filter-out -Werror,$$(SRC_CC_OPTS)) $$(CONF_CC_OPTS) $$($1_CC_OPTS) $$($1_$2_CC_OPTS) $$(STAGE_$3_CC_OPTS)"
     39$1_$2_CONFIGURE_OPTS += --configure-option=LDFLAGS="$$(SRC_LD_OPTS) $$($1_LD_OPTS) $$($1_$2_LD_OPTS) $$(STAGE_$3_LD_OPTS)"
    3640
    3741ifneq "$$(ICONV_INCLUDE_DIRS)" ""
    3842$1_$2_CONFIGURE_OPTS += --configure-option=--with-iconv-includes="$$(ICONV_INCLUDE_DIRS)"
  • rules/build-prog.mk

    diff -rN -u old-ghc_bf/rules/build-prog.mk new-ghc_bf-2/rules/build-prog.mk
    old new  
    128128
    129129ifeq "$$($1_$2_LINK_WITH_GCC)" "NO"
    130130$1/$2/build/tmp/$$($1_$2_PROG) : $$($1_$2_v_HS_OBJS) $$($1_$2_v_C_OBJS) $$($1_$2_v_S_OBJS) $$($1_$2_OTHER_OBJS) | $$$$(dir $$$$@)/.
    131         "$$($1_$2_HC)" -o $$@ $$($1_$2_v_ALL_HC_OPTS) $$(LD_OPTS) $$($1_$2_v_HS_OBJS) $$($1_$2_v_C_OBJS) $$($1_$2_v_S_OBJS) $$($1_$2_OTHER_OBJS)
     131        "$$($1_$2_HC)" -o $$@ $$($1_$2_v_ALL_HC_OPTS)  $$(STAGE_$3_LD_OPTS) $$(LD_OPTS) $$($1_$2_LD_OPTS) $$($1_$2_v_HS_OBJS) $$($1_$2_v_C_OBJS) $$($1_$2_v_S_OBJS) $$($1_$2_OTHER_OBJS)
    132132else
    133133$1/$2/build/tmp/$$($1_$2_PROG) : $$($1_$2_v_HS_OBJS) $$($1_$2_v_C_OBJS) $$($1_$2_v_S_OBJS) $$($1_$2_OTHER_OBJS) | $$$$(dir $$$$@)/.
    134         "$$(CC)" -o $$@ $$($1_$2_v_ALL_CC_OPTS) $$(LD_OPTS) $$($1_$2_v_HS_OBJS) $$($1_$2_v_C_OBJS) $$($1_$2_v_S_OBJS) $$($1_$2_OTHER_OBJS) $$($1_$2_v_EXTRA_CC_OPTS)
     134        "$$(CC)" -o $$@ $$($1_$2_v_ALL_CC_OPTS)  $$(STAGE_$3_LD_OPTS) $$(LD_OPTS) $$($1_$2_LD_OPTS) $$($1_$2_v_HS_OBJS) $$($1_$2_v_C_OBJS) $$($1_$2_v_S_OBJS) $$($1_$2_OTHER_OBJS) $$($1_$2_v_EXTRA_CC_OPTS)
    135135endif
    136136
    137137# Note [lib-depends] if this program is built with stage1 or greater, we
  • rules/distdir-way-opts.mk

    diff -rN -u old-ghc_bf/rules/distdir-way-opts.mk new-ghc_bf-2/rules/distdir-way-opts.mk
    old new  
    8282endif
    8383
    8484$1_$2_DIST_CC_OPTS = \
     85 $$(STAGE_$4_CC_OPTS) \
    8586 $$(CONF_CC_OPTS) \
    8687 $$(SRC_CC_OPTS) \
    8788 $$($1_CC_OPTS) \
  • rules/shell-wrapper.mk

    diff -rN -u old-ghc_bf/rules/shell-wrapper.mk new-ghc_bf-2/rules/shell-wrapper.mk
    old new  
    4141        echo 'bindir="$$(TOP)/$$(INPLACE_BIN)"'        >> $$@
    4242        echo 'topdir="$$(TOP)/$$(INPLACE_TOPDIR)"'     >> $$@
    4343        echo 'pgmgcc="$$(WhatGccIsCalled)"'            >> $$@
     44        echo 'builtInArgs="$$(BUILTIN_HC_OPTS)"'       >> $$@
    4445        $$($1_$2_SHELL_WRAPPER_EXTRA)
    4546        $$($1_$2_INPLACE_SHELL_WRAPPER_EXTRA)
    4647        cat $$($1_$2_SHELL_WRAPPER_NAME)               >> $$@
     
    7374        echo 'bindir="$$(bindir)"'                               >> "$$(WRAPPER)"
    7475        echo 'topdir="$$(topdir)"'                               >> "$$(WRAPPER)"
    7576        echo 'pgmgcc="$$(WhatGccIsCalled)"'                      >> "$$(WRAPPER)"
     77        echo 'builtInArgs="$$(BUILTIN_HC_OPTS)"'                 >> "$$(WRAPPER)"
    7678        $$($1_$2_SHELL_WRAPPER_EXTRA)
    7779        $$($1_$2_INSTALL_SHELL_WRAPPER_EXTRA)
    7880        cat $$($1_$2_SHELL_WRAPPER_NAME)                         >> "$$(WRAPPER)"
  • utils/ghc-pkg/ghc-pkg.cabal

    diff -rN -u old-ghc_bf/utils/ghc-pkg/ghc-pkg.cabal new-ghc_bf-2/utils/ghc-pkg/ghc-pkg.cabal
    old new  
    2828                   bin-package-db,
    2929                   bytestring
    3030    if !os(windows)
    31         Build-Depends: unix,
    32                        terminfo
     31        Build-Depends: unix
    3332    if os(windows)
    3433        c-sources: CRT_noglob.c
  • utils/ghc-pkg/Main.hs

    diff -rN -u old-ghc_bf/utils/ghc-pkg/Main.hs new-ghc_bf-2/utils/ghc-pkg/Main.hs
    old new  
    7070import qualified System.Info(os)
    7171#endif
    7272
    73 #if !defined(mingw32_HOST_OS) && __GLASGOW_HASKELL__ >= 611 && !defined(BOOTSTRAPPING)
     73#if !defined(mingw32_HOST_OS) &&!defined(barrelfish_HOST_OS) && __GLASGOW_HASKELL__ >= 611 && !defined(BOOTSTRAPPING)
    7474import System.Console.Terminfo as Terminfo
    7575#endif
    7676
     
    854854
    855855  if simple_output then show_simple stack else do
    856856
    857 #if defined(mingw32_HOST_OS) || __GLASGOW_HASKELL__ < 611 || defined(BOOTSTRAPPING)
     857#if defined(mingw32_HOST_OS) || defined(barrelfish_HOST_OS) || __GLASGOW_HASKELL__ < 611 || defined(BOOTSTRAPPING)
    858858  mapM_ show_normal stack
    859859#else
    860860  let