[libc] Enable automated extraction of error usage reports

Add preprocessor magic to the error definitions to enable every error
usage to be tracked.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2010-05-30 15:29:05 +01:00
parent d2415be069
commit 6c0e8c14be
22 changed files with 1499 additions and 391 deletions

View File

@@ -31,6 +31,19 @@ FILE_LICENCE ( GPL2_OR_LATER );
#include <ipxe/errortab.h>
#include <ipxe/segment.h>
/**
* Segment-specific error messages
*
* This error happens sufficiently often to merit a user-friendly
* description.
*/
#define ERANGE_SEGMENT __einfo_error ( EINFO_ERANGE_SEGMENT )
#define EINFO_ERANGE_SEGMENT \
__einfo_uniqify ( EINFO_ERANGE, 0x01, "Requested memory not available" )
struct errortab segment_errors[] __errortab = {
__einfo_errortab ( EINFO_ERANGE_SEGMENT ),
};
/**
* Prepare segment for loading
*
@@ -73,15 +86,5 @@ int prep_segment ( userptr_t segment, size_t filesz, size_t memsz ) {
/* No suitable memory region found */
DBG ( "Segment [%lx,%lx,%lx) does not fit into available memory\n",
start, mid, end );
return -ERANGE;
return -ERANGE_SEGMENT;
}
/**
* Segment-specific error messages
*
* This error happens sufficiently often to merit a user-friendly
* description.
*/
struct errortab segment_errors[] __errortab = {
{ ERANGE, "Requested memory not available" },
};