From 49939626beb04f2797147f55cf1e1997a1d8e040 Mon Sep 17 00:00:00 2001 From: Nathan Whitehorn Date: Fri, 29 Oct 2010 00:37:35 +0000 Subject: [PATCH] Fix the printf() in init_heap so that it can run before the console is up. Pointed out by: marius --- sys/boot/ofw/common/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/boot/ofw/common/main.c b/sys/boot/ofw/common/main.c index 00fe9ca4ce0a..52e691991619 100644 --- a/sys/boot/ofw/common/main.c +++ b/sys/boot/ofw/common/main.c @@ -47,13 +47,17 @@ static char bootargs[128]; #define HEAP_SIZE 0x80000 +#define OF_puts(fd, text) OF_write(fd, text, strlen(text)) + void init_heap(void) { void *base; + ihandle_t stdout; if ((base = ofw_alloc_heap(HEAP_SIZE)) == (void *)0xffffffff) { - printf("Heap memory claim failed!\n"); + OF_getprop(chosen, "stdout", &stdout, sizeof(stdout)); + OF_puts(stdout, "Heap memory claim failed!\n"); OF_enter(); }