1/*
2 * Copyright 2004-2007, Axel D��rfler, axeld@pinc-software.de.
3 * Distributed under the terms of the MIT License.
4 */
5
6
7#include <Htif.h>
8
9#include <boot/platform.h>
10#include <boot/stdio.h>
11#include <stdarg.h>
12#include <string.h>
13
14#include <Errors.h>
15
16extern FILE *dbgerr;
17
18
19static void
20dprintf_args(const char* format, va_list args)
21{
22	char buffer[512];
23	int length = vsnprintf(buffer, sizeof(buffer), format, args);
24	if (length == 0)
25		return;
26
27	//syslog_write(buffer, length);
28	HtifOutString(buffer);
29}
30
31
32extern "C" void
33dprintf(const char* format, ...)
34{
35	va_list args;
36
37	va_start(args, format);
38	dprintf_args(format, args);
39	va_end(args);
40}
41
42
43void
44panic(const char* format, ...)
45{
46	va_list args;
47
48	dprintf("*** PANIC ***\n");
49
50	va_start(args, format);
51	dprintf_args(format, args);
52	va_end(args);
53
54	for(;;) {}
55}
56
57
58char*
59platform_debug_get_log_buffer(size_t* _size)
60{
61	return NULL;
62}
63