From 2d85b4c38e216f8e9ceea595b87a999f2bf5d9df Mon Sep 17 00:00:00 2001 From: Hesham Almatary Date: Mon, 14 May 2018 16:56:21 +0100 Subject: configure: Add --enable-boot-machine in BBL If --enable-boot-machine is passed, BBL disables VM and runs the payload in machine mode. This is useful for payloads (e.g. RTOSes or other OSes) that want to run only in machine mode while still relying on bbl/pk for system calls and emulation --- bbl/bbl.ac | 5 +++++ config.h.in | 3 +++ configure | 15 +++++++++++++++ 3 files changed, 23 insertions(+) diff --git a/bbl/bbl.ac b/bbl/bbl.ac index dc3cf42..68780db 100644 --- a/bbl/bbl.ac +++ b/bbl/bbl.ac @@ -18,3 +18,8 @@ AC_ARG_WITH([payload], AS_HELP_STRING([--with-payload], [Set ELF payload for bbl AC_ARG_WITH([logo], AS_HELP_STRING([--with-logo], [Specify a better logo]), [AC_SUBST([BBL_LOGO_FILE], $with_logo, [Logo for bbl])], [AC_SUBST([BBL_LOGO_FILE], [riscv_logo.txt], [Logo for bbl])]) + +AC_ARG_ENABLE([boot-machine], AS_HELP_STRING([--enable-boot-machine], [Run payload in machine mode])) +AS_IF([test "x$enable_boot_machine" == "xyes"], [ + AC_DEFINE([BBL_BOOT_MACHINE],,[Define to run payload in machine mode]) +]) diff --git a/config.h.in b/config.h.in index a350c78..dbacd78 100644 --- a/config.h.in +++ b/config.h.in @@ -1,5 +1,8 @@ /* config.h.in. Generated from configure.ac by autoheader. */ +/* Define to run payload in machine mode */ +#undef BBL_BOOT_MACHINE + /* Define if subproject MCPPBS_SPROJ_NORM is enabled */ #undef BBL_ENABLED diff --git a/configure b/configure index 1ab2f31..b001ba3 100755 --- a/configure +++ b/configure @@ -677,6 +677,7 @@ enable_vm enable_logo with_payload with_logo +enable_boot_machine enable_fp_emulation ' ac_precious_vars='build_alias @@ -1325,6 +1326,7 @@ Optional Features: Enable all optional subprojects --disable-vm Disable virtual memory --enable-logo Enable boot logo + --enable-boot-machine Run payload in machine mode --disable-fp-emulation Disable floating-point emulation Optional Packages: @@ -4272,6 +4274,19 @@ else fi +# Check whether --enable-boot-machine was given. +if test "${enable_boot_machine+set}" = set; then : + enableval=$enable_boot_machine; +fi + +if test "x$enable_boot_machine" == "xyes"; then : + + +$as_echo "#define BBL_BOOT_MACHINE /**/" >>confdefs.h + + +fi + -- cgit v1.1