Improve debugging code. Set login to override env variables.
This commit is contained in:
@@ -54,19 +54,15 @@ static inline void __outportb(uint16_t port, uint8_t data)
|
||||
/// @param c the character to send to the debug port.
|
||||
static inline void __debug_putchar(char c)
|
||||
{
|
||||
#if (defined(DEBUG_STDIO) || defined(DEBUG_LOG))
|
||||
__outportb(SERIAL_COM1, c);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// @brief Writes the given string on the debug port.
|
||||
/// @param s the string to send to the debug port.
|
||||
static inline void __debug_puts(char *s)
|
||||
{
|
||||
#if (defined(DEBUG_STDIO) || defined(DEBUG_LOG))
|
||||
while ((*s) != 0)
|
||||
__outportb(SERIAL_COM1, *s++);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// @brief Align memory address to the specified value (round up).
|
||||
|
||||
@@ -21,17 +21,13 @@ static int max_log_level = LOGLEVEL_DEBUG;
|
||||
|
||||
void dbg_putchar(char c)
|
||||
{
|
||||
#if (defined(DEBUG_STDIO) || defined(DEBUG_LOG))
|
||||
outportb(SERIAL_COM1, (uint8_t)c);
|
||||
#endif
|
||||
}
|
||||
|
||||
void dbg_puts(const char *s)
|
||||
{
|
||||
#if (defined(DEBUG_STDIO) || defined(DEBUG_LOG))
|
||||
while ((*s) != 0)
|
||||
dbg_putchar(*s++);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void __debug_print_header(const char *file, const char *fun, int line, int log_level, char *header)
|
||||
|
||||
Reference in New Issue
Block a user