Improve debugging code. Set login to override env variables.

This commit is contained in:
Enrico Fraccaroli
2021-12-20 16:29:41 +01:00
parent a72f8e6b75
commit f7b951cb72
7 changed files with 17 additions and 25 deletions
-4
View File
@@ -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).
-4
View File
@@ -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)