From bb7e82468f5cf3dc8ac09bd571cc10b371728cea Mon Sep 17 00:00:00 2001 From: Sam Leffler Date: Wed, 13 Jul 2022 21:02:37 +0000 Subject: [PATCH] Merge "Fix CONFIG_PRINTING handling by test applications." GitOrigin-RevId: 1ea1b3b4e0c7a4d1d817ac1e2ef3939d2b2200b3 --- apps/fibonacci/fibonacci.c | 8 +++++--- apps/hello/hello.c | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/apps/fibonacci/fibonacci.c b/apps/fibonacci/fibonacci.c index 063cc4a..8182279 100644 --- a/apps/fibonacci/fibonacci.c +++ b/apps/fibonacci/fibonacci.c @@ -10,11 +10,11 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include +#include +#include #include #include -#include - -#include __thread seL4_IPCBuffer *__sel4_ipc_buffer; @@ -45,6 +45,7 @@ __attribute__((naked)) void _start() { // only prints 32-bit "%x" hex values void minisel_printf(const char *fmt, ...) { +#if CONFIG_PRINTING va_list args; va_start(args, fmt); for (; *fmt; fmt++) { @@ -74,6 +75,7 @@ void minisel_printf(const char *fmt, ...) { } } va_end(args); +#endif } typedef uint64_t interrupt_count_t; diff --git a/apps/hello/hello.c b/apps/hello/hello.c index eabd45f..1749991 100644 --- a/apps/hello/hello.c +++ b/apps/hello/hello.c @@ -9,10 +9,10 @@ // using the seL4_DebugPutChar syscall and is intended as a starting // point for low-level tests. -#include -#include - +#include #include +#include +#include __thread seL4_IPCBuffer *__sel4_ipc_buffer; @@ -36,6 +36,7 @@ __attribute__((naked)) void _start() { // only prints 32-bit "%x" hex values void minisel_printf(const char *fmt, ...) { +#if CONFIG_PRINTING va_list args; va_start(args, fmt); for (; *fmt; fmt++) { @@ -53,6 +54,7 @@ void minisel_printf(const char *fmt, ...) { } } va_end(args); +#endif } int main(int a0, int a1, int a2, int a3) {