#include <stdio.h>
#include <stdint.h>
#include <stdarg.h>
#include <ctype.h>
#include <ipxe/console.h>
Go to the source code of this file.
|
| struct | autocolour |
| | A colour assigned to an autocolourised debug message stream. More...
|
| |
◆ DBGCOL_MIN
Base message stream colour.
We default to using 31 (red foreground) as the base colour.
Definition at line 132 of file debug.c.
◆ DBGCOL_MAX
Maximum number of separately coloured message streams.
Six is the realistic maximum; there are 8 basic ANSI colours, one of which will be the terminal default and one of which will be invisible on the terminal because it matches the background colour.
Definition at line 143 of file debug.c.
◆ FILE_LICENCE()
| FILE_LICENCE |
( |
GPL2_OR_LATER_OR_UBDL |
| ) |
|
◆ FILE_SECBOOT()
| FILE_SECBOOT |
( |
PERMITTED |
| ) |
|
◆ dbg_hex_dump_da_row()
| static void dbg_hex_dump_da_row |
( |
unsigned long |
dispaddr, |
|
|
const void * |
data, |
|
|
unsigned long |
len, |
|
|
unsigned int |
offset |
|
) |
| |
|
static |
Print row of a hex dump with specified display address.
- Parameters
-
| dispaddr | Display address |
| data | Data to print |
| len | Length of data |
| offset | Starting offset within data |
Definition at line 83 of file debug.c.
96 ( ( ( i % 16 ) == 8 ) ?
'-' :
' ' ),
bytes[i] );
static int isprint(int character)
Check if character is printable.
uint8_t data[48]
Additional event data.
uint16_t offset
Offset to command line.
void dbg_printf(const char *fmt,...)
Print debug message.
References bytes, data, dbg_printf(), isprint(), len, and offset.
Referenced by dbg_hex_dump_da().
◆ dbg_autocolour()
| static int dbg_autocolour |
( |
unsigned long |
stream | ) |
|
|
static |
Choose colour index for debug autocolourisation.
- Parameters
-
- Return values
-
Definition at line 160 of file debug.c.
162 static unsigned long use;
165 unsigned int oldest_last_used;
171 for ( i = 0 ; i < (
sizeof ( acs ) /
sizeof ( acs[0] ) ) ; i++ ) {
180 oldest_last_used = use;
181 for ( i = 0 ; i < (
sizeof ( acs ) /
sizeof ( acs[0] ) ) ; i++ ) {
182 if ( acs[i].
last_used < oldest_last_used ) {
183 oldest_last_used = acs[i].last_used;
187 acs[oldest].stream =
stream;
188 acs[oldest].last_used = use;
#define DBGCOL_MIN
Base message stream colour.
#define DBGCOL_MAX
Maximum number of separately coloured message streams.
unsigned long last_used
Last recorded usage.
A colour assigned to an autocolourised debug message stream.
unsigned long stream
Message stream ID.
References DBGCOL_MAX, DBGCOL_MIN, autocolour::last_used, and autocolour::stream.
Referenced by dbg_autocolourise().