mirror of
https://github.com/ipxe/ipxe
synced 2026-05-13 03:41:15 +03:00
[memmap] Allow explicit colour selection for memory map debug messages
Provide DBGC_MEMMAP() as a replacement for memmap_dump(), allowing the colour used to match other messages within the same message group. Retain a dedicated colour for output from memmap_dump_all(), on the basis that it is generally most useful to visually compare full memory dumps against previous full memory dumps. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
+1
-1
@@ -102,7 +102,7 @@ static int lkrn_ram ( struct image *image, struct lkrn_context *ctx ) {
|
||||
|
||||
/* Locate start of RAM */
|
||||
for_each_memmap ( ®ion, 0 ) {
|
||||
memmap_dump ( ®ion );
|
||||
DBGC_MEMMAP ( image, ®ion );
|
||||
if ( ! ( region.flags & MEMMAP_FL_MEMORY ) )
|
||||
continue;
|
||||
ctx->ram = region.min;
|
||||
|
||||
+5
-5
@@ -65,11 +65,11 @@ int prep_segment ( void *segment, size_t filesz, size_t memsz ) {
|
||||
physaddr_t end = ( start + memsz );
|
||||
physaddr_t max;
|
||||
|
||||
DBGC ( ®ion, "SEGMENT [%#08lx,%#08lx,%#08lx)\n", start, mid, end );
|
||||
DBGC ( segment, "SEGMENT [%#08lx,%#08lx,%#08lx)\n", start, mid, end );
|
||||
|
||||
/* Check for malformed lengths */
|
||||
if ( filesz > memsz ) {
|
||||
DBGC ( ®ion, "SEGMENT [%#08lx,%#08lx,%#08lx) is "
|
||||
DBGC ( segment, "SEGMENT [%#08lx,%#08lx,%#08lx) is "
|
||||
"malformed\n", start, mid, end );
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -81,18 +81,18 @@ int prep_segment ( void *segment, size_t filesz, size_t memsz ) {
|
||||
|
||||
/* Check for address space overflow */
|
||||
if ( max < start ) {
|
||||
DBGC ( ®ion, "SEGMENT [%#08lx,%#08lx,%#08lx) wraps "
|
||||
DBGC ( segment, "SEGMENT [%#08lx,%#08lx,%#08lx) wraps "
|
||||
"around\n", start, mid, end );
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Describe region containing this segment */
|
||||
memmap_describe ( start, 1, ®ion );
|
||||
memmap_dump ( ®ion );
|
||||
DBGC_MEMMAP ( segment, ®ion );
|
||||
|
||||
/* Fail unless region is usable and sufficiently large */
|
||||
if ( ( ! memmap_is_usable ( ®ion ) ) || ( region.max < max ) ) {
|
||||
DBGC ( ®ion, "SEGMENT [%#08lx,%#08lx,%#08lx) does not fit "
|
||||
DBGC ( segment, "SEGMENT [%#08lx,%#08lx,%#08lx) does not fit "
|
||||
"into available memory\n", start, mid, end );
|
||||
return -ERANGE_SEGMENT;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user