xref: /haiku/src/system/boot/platform/riscv/debug.cpp (revision af435dd1c9460acc910170b4f82f44bfd3f557c9)
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 
16 extern FILE *dbgerr;
17 
18 
19 static void
20 dprintf_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 
32 extern "C" void
33 dprintf(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 
43 void
44 panic(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 
58 char*
59 platform_debug_get_log_buffer(size_t* _size)
60 {
61 	return NULL;
62 }
63