2002-07-09 16:24:59 +04:00
|
|
|
/*
|
|
|
|
** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
|
|
|
|
** Distributed under the terms of the NewOS License.
|
|
|
|
*/
|
|
|
|
#ifndef _KERNEL_DEBUG_H
|
|
|
|
#define _KERNEL_DEBUG_H
|
|
|
|
|
|
|
|
#include <kernel.h>
|
|
|
|
#include <stage2.h>
|
|
|
|
#include <cdefs.h>
|
|
|
|
|
|
|
|
extern int dbg_register_file[2][14]; /* XXXmpetit -- must be made generic */
|
|
|
|
|
|
|
|
int dbg_init(kernel_args *ka);
|
|
|
|
int dbg_init2(kernel_args *ka);
|
|
|
|
char dbg_putch(char c);
|
|
|
|
void dbg_puts(const char *s);
|
|
|
|
bool dbg_set_serial_debug(bool new_val);
|
|
|
|
bool dbg_get_serial_debug(void);
|
2002-07-18 02:10:34 +04:00
|
|
|
|
|
|
|
/* special return codes for kernel debugger command function*/
|
|
|
|
#define B_KDEBUG_CONT 2
|
|
|
|
#define B_KDEBUG_QUIT 3
|
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
extern void dbg_save_registers(int *); /* arch provided */
|
|
|
|
|
2002-07-18 22:45:07 +04:00
|
|
|
#if DEBUG
|
|
|
|
# define ASSERT(x) \
|
|
|
|
{ if (!(x)) panic("ASSERT FAILED (%s:%d): %s", __FILE__, __LINE__, #x); }
|
|
|
|
#else
|
|
|
|
# define ASSERT(x)
|
2002-07-09 16:24:59 +04:00
|
|
|
#endif
|
2002-07-18 22:45:07 +04:00
|
|
|
|
|
|
|
#endif /* _KERNEL_DEBUG_H */
|