summaryrefslogtreecommitdiffstats
path: root/sys/boot/ofw
diff options
context:
space:
mode:
authornwhitehorn <nwhitehorn@FreeBSD.org>2010-10-29 00:37:35 +0000
committernwhitehorn <nwhitehorn@FreeBSD.org>2010-10-29 00:37:35 +0000
commitd508714b76fdc127602a1c6ee49a838db87efaba (patch)
tree37b9762d260024137ea46704489aff55dcc1948d /sys/boot/ofw
parent9322be1c23a73b2bba61591fdd09ca1f785b00dd (diff)
downloadFreeBSD-src-d508714b76fdc127602a1c6ee49a838db87efaba.zip
FreeBSD-src-d508714b76fdc127602a1c6ee49a838db87efaba.tar.gz
Fix the printf() in init_heap so that it can run before the console is up.
Pointed out by: marius
Diffstat (limited to 'sys/boot/ofw')
-rw-r--r--sys/boot/ofw/common/main.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/boot/ofw/common/main.c b/sys/boot/ofw/common/main.c
index 00fe9ca..52e69199 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();
}
OpenPOWER on IntegriCloud