Merge "Fix CONFIG_PRINTING handling by test applications."

GitOrigin-RevId: 1ea1b3b4e0c7a4d1d817ac1e2ef3939d2b2200b3
This commit is contained in:
Sam Leffler 2022-07-13 21:02:37 +00:00
parent 92dc1019be
commit bb7e82468f
2 changed files with 10 additions and 6 deletions

View File

@ -10,11 +10,11 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
#include <kernel/gen_config.h>
#include <sel4/arch/syscalls.h>
#include <stdarg.h>
#include <stdint.h> #include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <stdarg.h>
#include <sel4/arch/syscalls.h>
__thread seL4_IPCBuffer *__sel4_ipc_buffer; __thread seL4_IPCBuffer *__sel4_ipc_buffer;
@ -45,6 +45,7 @@ __attribute__((naked)) void _start() {
// only prints 32-bit "%x" hex values // only prints 32-bit "%x" hex values
void minisel_printf(const char *fmt, ...) { void minisel_printf(const char *fmt, ...) {
#if CONFIG_PRINTING
va_list args; va_list args;
va_start(args, fmt); va_start(args, fmt);
for (; *fmt; fmt++) { for (; *fmt; fmt++) {
@ -74,6 +75,7 @@ void minisel_printf(const char *fmt, ...) {
} }
} }
va_end(args); va_end(args);
#endif
} }
typedef uint64_t interrupt_count_t; typedef uint64_t interrupt_count_t;

View File

@ -9,10 +9,10 @@
// using the seL4_DebugPutChar syscall and is intended as a starting // using the seL4_DebugPutChar syscall and is intended as a starting
// point for low-level tests. // point for low-level tests.
#include <stdint.h> #include <kernel/gen_config.h>
#include <stdarg.h>
#include <sel4/arch/syscalls.h> #include <sel4/arch/syscalls.h>
#include <stdarg.h>
#include <stdint.h>
__thread seL4_IPCBuffer *__sel4_ipc_buffer; __thread seL4_IPCBuffer *__sel4_ipc_buffer;
@ -36,6 +36,7 @@ __attribute__((naked)) void _start() {
// only prints 32-bit "%x" hex values // only prints 32-bit "%x" hex values
void minisel_printf(const char *fmt, ...) { void minisel_printf(const char *fmt, ...) {
#if CONFIG_PRINTING
va_list args; va_list args;
va_start(args, fmt); va_start(args, fmt);
for (; *fmt; fmt++) { for (; *fmt; fmt++) {
@ -53,6 +54,7 @@ void minisel_printf(const char *fmt, ...) {
} }
} }
va_end(args); va_end(args);
#endif
} }
int main(int a0, int a1, int a2, int a3) { int main(int a0, int a1, int a2, int a3) {