summaryrefslogtreecommitdiff
path: root/rts/wasm/StgRun.c
blob: b3442a92424ce1b93a99ba8898dfac67d4c45412 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "Rts.h"

// We directly return the same BaseReg as passed to StgRun. This is
// fine on wasm which doesn't have SMP.
//
// Reading BaseReg from R1 is quite tricky; we map R1 to a wasm
// global, and reading from wasm globals from C requires calling a
// getter function implemented in assembly, which is totally not worth
// the effort.
StgRegTable * StgRun(StgFunPtr f, StgRegTable *basereg)
{
    while (f) {
        f = (StgFunPtr) (f)();
    }
    return basereg;
}

StgFunPtr StgReturn(void)
{
    return 0;
}