Fix debug output code.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23361 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -4,7 +4,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "serial.h"
|
|
||||||
#include "keyboard.h"
|
#include "keyboard.h"
|
||||||
#include "toscalls.h"
|
#include "toscalls.h"
|
||||||
|
|
||||||
@@ -19,17 +18,21 @@
|
|||||||
void
|
void
|
||||||
panic(const char *format, ...)
|
panic(const char *format, ...)
|
||||||
{
|
{
|
||||||
|
char buffer[512];
|
||||||
va_list list;
|
va_list list;
|
||||||
|
int length;
|
||||||
|
|
||||||
platform_switch_to_text_mode();
|
//platform_switch_to_text_mode();
|
||||||
|
|
||||||
puts("*** PANIC ***");
|
Bconputs(DEV_CONSOLE, "*** PANIC ***");
|
||||||
|
|
||||||
va_start(list, format);
|
va_start(list, format);
|
||||||
vprintf(format, list);
|
length = vsnprintf(buffer, sizeof(buffer), format, list);
|
||||||
va_end(list);
|
va_end(list);
|
||||||
|
|
||||||
puts("\nPress key to reboot.");
|
Bconputs(DEV_CONSOLE, buffer);
|
||||||
|
|
||||||
|
Bconputs(DEV_CONSOLE, "\nPress key to reboot.");
|
||||||
|
|
||||||
clear_key_buffer();
|
clear_key_buffer();
|
||||||
wait_for_key();
|
wait_for_key();
|
||||||
@@ -48,10 +51,10 @@ dprintf(const char *format, ...)
|
|||||||
length = vsnprintf(buffer, sizeof(buffer), format, list);
|
length = vsnprintf(buffer, sizeof(buffer), format, list);
|
||||||
va_end(list);
|
va_end(list);
|
||||||
|
|
||||||
serial_puts(buffer, length);
|
Bconputs(DEV_AUX, buffer);
|
||||||
|
|
||||||
if (platform_boot_options() & BOOT_OPTION_DEBUG_OUTPUT)
|
if (platform_boot_options() & BOOT_OPTION_DEBUG_OUTPUT)
|
||||||
fprintf(stderr, "%s", buffer);
|
Bconputs(DEV_CONSOLE, buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -71,6 +71,18 @@ struct tosbpb {
|
|||||||
#define Drvmap() (uint32)bios(10)
|
#define Drvmap() (uint32)bios(10)
|
||||||
#define Kbshift(mode) bios(11, (uint16)mode)
|
#define Kbshift(mode) bios(11, (uint16)mode)
|
||||||
|
|
||||||
|
/* handy shortcut */
|
||||||
|
static inline int Bconputs(int16 handle, const char *string)
|
||||||
|
{
|
||||||
|
int i, err;
|
||||||
|
for (i = 0; string[i]; i++) {
|
||||||
|
err = Bconout(string[i]);
|
||||||
|
if (err)
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Atari XBIOS calls
|
* Atari XBIOS calls
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user