-
Notifications
You must be signed in to change notification settings - Fork 644
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4333 from mokshasoft/seL4
Makefiles and changes needed for the C RTS on the seL4 microkernel
- Loading branch information
Showing
6 changed files
with
83 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
libsel4-idris-rts: $(libc) common | ||
libs-$(CONFIG_LIBSEL4_IDRIS_RTS) += libsel4-idris-rts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
config LIBSEL4_IDRIS_RTS | ||
bool "libsel4-idris-rts" | ||
default y | ||
select HAVE_LIBSEL4_IDRIS_RTS | ||
help | ||
Idris RTS compiled for seL4 | ||
|
||
config HAVE_LIBSEL4_IDRIS_RTS | ||
bool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Target | ||
TARGETS := libsel4-idris-rts.a | ||
|
||
# Source files required to build the target | ||
FILES := \ | ||
idris_rts.c \ | ||
idris_heap.c \ | ||
idris_gc.c \ | ||
idris_gmp.c \ | ||
idris_bitstring.c \ | ||
idris_opts.c \ | ||
idris_stats.c \ | ||
idris_utf8.c \ | ||
idris_stdfgn.c \ | ||
mini-gmp.c \ | ||
idris_buffer.c \ | ||
getline.c \ | ||
idris_net.c \ | ||
seL4/idris_main.c | ||
CFILES := $(addprefix rts/,$(FILES)) | ||
|
||
# Header file directory this library provides | ||
HDRFILES := $(wildcard ${SOURCE_DIR}/rts/*) | ||
|
||
CFLAGS += -W -Wall | ||
# Don't use the host machines' environment when cross compiling | ||
CFLAGS += -undef | ||
CFLAGS += -DIDRIS_TARGET_OS=\"seL4\" | ||
CFLAGS += -DSEL4 | ||
MACHINE := $(shell $(CC) -dumpmachine) | ||
CFLAGS += -DIDRIS_TARGET_TRIPLE=\"$(MACHINE)\" | ||
|
||
include $(SEL4_COMMON)/common.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#include "idris_gmp.h" | ||
#include "idris_opts.h" | ||
#include "idris_rts.h" | ||
#include "idris_stats.h" | ||
|
||
void _idris__123_runMain_95_0_125_(VM* vm, VAL* oldbase); | ||
|
||
RTSOpts opts = { | ||
.init_heap_size = 16384000, | ||
.max_stack_size = 4096000, | ||
.show_summary = 0 | ||
}; | ||
|
||
int main() { | ||
VM* vm = init_vm(opts.max_stack_size, opts.init_heap_size, 1); | ||
init_gmpalloc(); | ||
init_nullaries(); | ||
|
||
_idris__123_runMain_95_0_125_(vm, NULL); | ||
|
||
#ifdef IDRIS_DEBUG | ||
if (opts.show_summary) { | ||
idris_gcInfo(vm, 1); | ||
} | ||
#endif | ||
|
||
free_nullaries(); | ||
// Remove call to terminate since it crashes the application during a free | ||
//Stats stats = terminate(vm); | ||
|
||
return EXIT_SUCCESS; | ||
} |