summaryrefslogtreecommitdiffstats
path: root/src/core/debug.c
diff options
context:
space:
mode:
authorMichael Brown2010-07-14 12:44:58 +0200
committerMichael Brown2010-07-14 12:44:58 +0200
commit9f3c0c1f393544c87bbd9550743edb4f31dc071f (patch)
tree23082c8a76bb4c29c240d8b2f1e3bbb61e9ce96a /src/core/debug.c
parent[build] Remove some obsolete header files (diff)
downloadipxe-9f3c0c1f393544c87bbd9550743edb4f31dc071f.tar.gz
ipxe-9f3c0c1f393544c87bbd9550743edb4f31dc071f.tar.xz
ipxe-9f3c0c1f393544c87bbd9550743edb4f31dc071f.zip
[debug] Remove unused guard_region() and check_region() functions
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/core/debug.c')
-rw-r--r--src/core/debug.c53
1 files changed, 0 insertions, 53 deletions
diff --git a/src/core/debug.c b/src/core/debug.c
index a08be9c2..0e79a1ab 100644
--- a/src/core/debug.c
+++ b/src/core/debug.c
@@ -69,59 +69,6 @@ void dbg_hex_dump_da ( unsigned long dispaddr, const void *data,
}
}
-#define GUARD_SYMBOL ( ( 'M' << 24 ) | ( 'I' << 16 ) | ( 'N' << 8 ) | 'E' )
-/* Fill a region with guard markers. We use a 4-byte pattern to make
- * it less likely that check_region will find spurious 1-byte regions
- * of non-corruption.
- */
-void guard_region ( void *region, size_t len ) {
- uint32_t offset = 0;
-
- len &= ~0x03;
- for ( offset = 0; offset < len ; offset += 4 ) {
- *((uint32_t *)(region + offset)) = GUARD_SYMBOL;
- }
-}
-
-/* Check a region that has been guarded with guard_region() for
- * corruption.
- */
-int check_region ( void *region, size_t len ) {
- uint8_t corrupted = 0;
- uint8_t in_corruption = 0;
- uint32_t offset = 0;
- uint32_t test = 0;
-
- len &= ~0x03;
- for ( offset = 0; offset < len ; offset += 4 ) {
- test = *((uint32_t *)(region + offset)) = GUARD_SYMBOL;
- if ( ( in_corruption == 0 ) &&
- ( test != GUARD_SYMBOL ) ) {
- /* Start of corruption */
- if ( corrupted == 0 ) {
- corrupted = 1;
- printf ( "Region %p-%p (physical %#lx-%#lx) "
- "corrupted\n",
- region, region + len,
- virt_to_phys ( region ),
- virt_to_phys ( region + len ) );
- }
- in_corruption = 1;
- printf ( "--- offset %#x ", offset );
- } else if ( ( in_corruption != 0 ) &&
- ( test == GUARD_SYMBOL ) ) {
- /* End of corruption */
- in_corruption = 0;
- printf ( "to offset %#x", offset );
- }
-
- }
- if ( in_corruption != 0 ) {
- printf ( "to offset %#zx (end of region)\n", len-1 );
- }
- return corrupted;
-}
-
/**
* Maximum number of separately coloured message streams
*