Pip
Architecture-dependent parts of Pip: MAL, IAL and boot
Macros | Functions
x86_multiboot/boot/include/debug.h File Reference
#include <stdint.h>
#include <stdarg.h>
#include "x86int.h"
#include "mal.h"

Go to the source code of this file.

Macros

#define CRITICAL   0
 Strings for debugging output. More...
 
#define ERROR   1
 Error output. More...
 
#define WARNING   2
 Warning output. More...
 
#define INFO   3
 Information output. More...
 
#define LOG   4
 Log output. More...
 
#define TRACE   5
 Annoying, verbose output. More...
 
#define True   1
 
#define False   0
 
#define DEBUGRAW(...)
 Defines the appropriate DEBUGRAW behavior. More...
 
#define DEBUG(...)
 Defines the appropriate DEBUG behavior. More...
 
#define DEBUGHEX(...)
 Defines the appropriate DEBUGHEX behavior. More...
 
#define DEBUGDEC(...)
 Defines the appropriate DEBUGDEC behavior. More...
 
#define BENCH_BEGIN   counter_update(1)
 
#define BENCH_END   {counter_update(0); DEBUG(TRACE, "Benchmark lasted "); display_time();}
 
#define ASSERT(u)
 

Functions

void krn_puts (char *c)
 Writes a string to the serial output. More...
 
void kaput (char c)
 
void puthex (int n)
 Writes an hexadecimal number to the serial output. More...
 
void putdec (int n)
 Writes a decimal number to the serial output. More...
 
void counter_update (uint32_t begin)
 
void display_time ()
 
void kprintf (char *fmt,...)
 
void panic (int_ctx_t *is)
 Just a loop acting like a kernel panic. More...
 
void dumpRegs (int_ctx_t *is, uint32_t outputLevel)
 Dumps the registers of a saved interrupt context onto the serial output. More...
 

Macro Definition Documentation

◆ ASSERT

#define ASSERT (   u)
Value:
if (!(u)){ \
kprintf("[%s:%d] Assert failed: " #u "\n", __FILE__, __LINE__); \
panic(0); \
}

◆ BENCH_BEGIN

#define BENCH_BEGIN   counter_update(1)

◆ BENCH_END

#define BENCH_END   {counter_update(0); DEBUG(TRACE, "Benchmark lasted "); display_time();}

◆ CRITICAL

#define CRITICAL   0

Strings for debugging output.

Critical output

◆ DEBUG

#define DEBUG (   ...)

Defines the appropriate DEBUG behavior.

◆ DEBUGDEC

#define DEBUGDEC (   ...)

Defines the appropriate DEBUGDEC behavior.

◆ DEBUGHEX

#define DEBUGHEX (   ...)

Defines the appropriate DEBUGHEX behavior.

◆ DEBUGRAW

#define DEBUGRAW (   ...)

Defines the appropriate DEBUGRAW behavior.

◆ ERROR

#define ERROR   1

Error output.

◆ False

#define False   0

◆ INFO

#define INFO   3

Information output.

◆ LOG

#define LOG   4

Log output.

◆ TRACE

#define TRACE   5

Annoying, verbose output.

◆ True

#define True   1

◆ WARNING

#define WARNING   2

Warning output.

Function Documentation

◆ counter_update()

void counter_update ( uint32_t  begin)

◆ display_time()

void display_time ( )

◆ dumpRegs()

void dumpRegs ( int_ctx_t is,
uint32_t  outputLevel 
)

Dumps the registers of a saved interrupt context onto the serial output.

Parameters
isInterrupted state
outputLevelSerial log debugging output level

◆ kaput()

void kaput ( char  c)

◆ kprintf()

void kprintf ( char *  fmt,
  ... 
)

◆ krn_puts()

void krn_puts ( char *  c)

Writes a string to the serial output.

Parameters
cThe string to write

◆ panic()

void panic ( int_ctx_t is)

Just a loop acting like a kernel panic.

◆ putdec()

void putdec ( int  n)

Writes a decimal number to the serial output.

Parameters
nThe number to write

◆ puthex()

void puthex ( int  n)

Writes an hexadecimal number to the serial output.

Parameters
nThe number to write