aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPalmer Dabbelt <palmer@dabbelt.com>2017-11-03 17:02:06 -0700
committerPalmer Dabbelt <palmer@dabbelt.com>2017-11-03 17:02:06 -0700
commit455608b465064eee862364796effeca91b4413f9 (patch)
tree60615272c1371ab73ce194b92f135337d613768a
parentd1849cb5e3b8c714c2dae78bb15465f288707ac5 (diff)
downloadpk-455608b465064eee862364796effeca91b4413f9.zip
pk-455608b465064eee862364796effeca91b4413f9.tar.gz
pk-455608b465064eee862364796effeca91b4413f9.tar.bz2
Allow users to pick a logo
-rw-r--r--Makefile.in2
-rw-r--r--bbl/bbl.ac4
-rw-r--r--bbl/bbl.mk.in1
-rw-r--r--bbl/logo.c25
-rw-r--r--bbl/raw_logo.S7
-rw-r--r--bbl/riscv_logo.txt23
-rwxr-xr-xconfigure14
7 files changed, 51 insertions, 25 deletions
diff --git a/Makefile.in b/Makefile.in
index 7b9bb81..0d5e862 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -85,7 +85,7 @@ VPATH := $(addprefix $(src_dir)/, $(sprojs_enabled))
CC := @CC@
READELF := @READELF@
OBJCOPY := @OBJCOPY@
-CFLAGS := @CFLAGS@ $(CFLAGS) -DBBL_PAYLOAD=\"bbl_payload\"
+CFLAGS := @CFLAGS@ $(CFLAGS) -DBBL_PAYLOAD=\"bbl_payload\" -DBBL_LOGO_FILE=\"@BBL_LOGO_FILE@\"
BBL_PAYLOAD := @BBL_PAYLOAD@
COMPILE := $(CC) -MMD -MP $(CFLAGS) \
$(sprojs_include)
diff --git a/bbl/bbl.ac b/bbl/bbl.ac
index 4b6a9f3..80d3b06 100644
--- a/bbl/bbl.ac
+++ b/bbl/bbl.ac
@@ -6,3 +6,7 @@ AS_IF([test "x$enable_logo" == "xyes"], [
AC_ARG_WITH([payload], AS_HELP_STRING([--with-payload], [Set ELF payload for bbl]),
[AC_SUBST([BBL_PAYLOAD], $with_payload, [Kernel payload for bbl])],
[AC_SUBST([BBL_PAYLOAD], [dummy_payload], [Kernel 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])])
diff --git a/bbl/bbl.mk.in b/bbl/bbl.mk.in
index 5abe2cd..0840859 100644
--- a/bbl/bbl.mk.in
+++ b/bbl/bbl.mk.in
@@ -12,6 +12,7 @@ bbl_c_srcs = \
bbl_asm_srcs = \
payload.S \
+ raw_logo.S \
payload.o: bbl_payload
diff --git a/bbl/logo.c b/bbl/logo.c
index 673899d..fcd43ec 100644
--- a/bbl/logo.c
+++ b/bbl/logo.c
@@ -1,30 +1,7 @@
#include <string.h>
#include "mtrap.h"
-static const char logo[] =
-" vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n"
-" vvvvvvvvvvvvvvvvvvvvvvvvvvvv\n"
-"rrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvvvvvv\n"
-"rrrrrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvvvv\n"
-"rrrrrrrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvvvv\n"
-"rrrrrrrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvvvv\n"
-"rrrrrrrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvvvv\n"
-"rrrrrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvv \n"
-"rrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvv \n"
-"rr vvvvvvvvvvvvvvvvvvvvvv \n"
-"rr vvvvvvvvvvvvvvvvvvvvvvvv rr\n"
-"rrrr vvvvvvvvvvvvvvvvvvvvvvvvvv rrrr\n"
-"rrrrrr vvvvvvvvvvvvvvvvvvvvvv rrrrrr\n"
-"rrrrrrrr vvvvvvvvvvvvvvvvvv rrrrrrrr\n"
-"rrrrrrrrrr vvvvvvvvvvvvvv rrrrrrrrrr\n"
-"rrrrrrrrrrrr vvvvvvvvvv rrrrrrrrrrrr\n"
-"rrrrrrrrrrrrrr vvvvvv rrrrrrrrrrrrrr\n"
-"rrrrrrrrrrrrrrrr vv rrrrrrrrrrrrrrrr\n"
-"rrrrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrr\n"
-"rrrrrrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrrrr\n"
-"rrrrrrrrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrrrrrr\n"
-"\n"
-" INSTRUCTION SETS WANT TO BE FREE\n";
+extern const char logo[];
void print_logo()
{
diff --git a/bbl/raw_logo.S b/bbl/raw_logo.S
new file mode 100644
index 0000000..bddf8f4
--- /dev/null
+++ b/bbl/raw_logo.S
@@ -0,0 +1,7 @@
+#include "encoding.h"
+
+ .section .rodata
+ .globl logo
+logo:
+ .incbin BBL_LOGO_FILE
+ .byte 0
diff --git a/bbl/riscv_logo.txt b/bbl/riscv_logo.txt
new file mode 100644
index 0000000..1f4c9f5
--- /dev/null
+++ b/bbl/riscv_logo.txt
@@ -0,0 +1,23 @@
+ vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
+ vvvvvvvvvvvvvvvvvvvvvvvvvvvv
+rrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvvvvvv
+rrrrrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvvvv
+rrrrrrrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvvvv
+rrrrrrrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvvvv
+rrrrrrrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvvvv
+rrrrrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvv
+rrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvv
+rr vvvvvvvvvvvvvvvvvvvvvv
+rr vvvvvvvvvvvvvvvvvvvvvvvv rr
+rrrr vvvvvvvvvvvvvvvvvvvvvvvvvv rrrr
+rrrrrr vvvvvvvvvvvvvvvvvvvvvv rrrrrr
+rrrrrrrr vvvvvvvvvvvvvvvvvv rrrrrrrr
+rrrrrrrrrr vvvvvvvvvvvvvv rrrrrrrrrr
+rrrrrrrrrrrr vvvvvvvvvv rrrrrrrrrrrr
+rrrrrrrrrrrrrr vvvvvv rrrrrrrrrrrrrr
+rrrrrrrrrrrrrrrr vv rrrrrrrrrrrrrrrr
+rrrrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrr
+rrrrrrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrrrr
+rrrrrrrrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrrrrrr
+
+ INSTRUCTION SETS WANT TO BE FREE
diff --git a/configure b/configure
index e67142c..d7d3380 100755
--- a/configure
+++ b/configure
@@ -590,6 +590,7 @@ ac_subst_vars='LTLIBOBJS
LIBOBJS
subprojects_enabled
subprojects
+BBL_LOGO_FILE
BBL_PAYLOAD
install_subdir
RISCV
@@ -674,6 +675,7 @@ enable_optional_subprojects
enable_vm
enable_logo
with_payload
+with_logo
enable_fp_emulation
'
ac_precious_vars='build_alias
@@ -1329,6 +1331,7 @@ Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-payload Set ELF payload for bbl
+ --with-logo Specify a better logo
Some influential environment variables:
CC C compiler command
@@ -4254,6 +4257,17 @@ fi
+# Check whether --with-logo was given.
+if test "${with_logo+set}" = set; then :
+ withval=$with_logo; BBL_LOGO_FILE=$with_logo
+
+else
+ BBL_LOGO_FILE=riscv_logo.txt
+
+fi
+
+
+