diff --git a/CMakeLists.txt b/CMakeLists.txt index a9d199e..9445da0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,4 @@ # Build system for the gint unikernel -# TODO: Options for NO_SYSCALLS, STATIC_GRAY, USER_VRAM, ATEXIT_MAX cmake_minimum_required(VERSION 3.18) project(Gint VERSION 2.3.0 LANGUAGES C ASM) @@ -7,7 +6,10 @@ project(Gint VERSION 2.3.0 LANGUAGES C ASM) include(GitVersionNumber) include(Fxconv) -# Generate with commit hash and version name in +option(GINT_USER_VRAM "Put all VRAMs into the user stack (fx-CG 50 only)") +option(GINT_STATIC_GRAY "Use static memory instead of malloc for gray buffers (fx-9860G only)") + +# Generate with commit hash, version name and options git_version_number(SHORT_HASH "GINT_GIT_HASH" TAG_RELATIVE "GINT_GIT_VERSION") configure_file(include/gint/config.h.in include/gint/config.h) diff --git a/include/gint/config.h.in b/include/gint/config.h.in index c388a1d..34322da 100644 --- a/include/gint/config.h.in +++ b/include/gint/config.h.in @@ -16,4 +16,12 @@ 0x03f7c0a0 = Commit 3f7c0a0 */ #define GINT_HASH 0x@GINT_GIT_HASH@ +/* GINT_USER_VRAM: Selects whether to store VRAMs in the user stack (occupying + 350k/512k of the area) or in the system stack (the default). (fx-CG 50) */ +#cmakedefine GINT_USER_VRAM + +/* GINT_STATIC_GRAY: Selects whether additional gray VRAMs are allocated + statically or in the system heap (fx-9860G) */ +#cmakedefine GINT_STATIC_GRAY + #endif /* GINT_CONFIG */ diff --git a/src/render-cg/dvram.c b/src/render-cg/dvram.c index 4cd3331..e1a9031 100644 --- a/src/render-cg/dvram.c +++ b/src/render-cg/dvram.c @@ -1,5 +1,6 @@ #include #include +#include #ifdef GINT_USER_VRAM /* We want to put the VRAM in the user section, however we can't use the @@ -10,7 +11,7 @@ GALIGNED(4) GSECTION(".bss.vram") int8_t _gint_vram_buffers[396*224*2]; /* In this case, we can define pointers to our user stack directly, these will - be the physical address associated with _vram_buffers */ + be the physical address associated with _gint_vram_buffers */ static uint16_t *main = (void *)0xac161400; static uint16_t *scnd = (void *)0xac18c900;