diff options
author | Michael Brown <mcb30@ipxe.org> | 2010-05-30 15:29:05 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2010-05-31 03:11:57 +0100 |
commit | 6c0e8c14be9546b49c097f5e6e8307bda3e7f5ac (patch) | |
tree | b04dd064c978bf0525649e9d1b936a9724deadaf /src/image/segment.c | |
parent | d2415be06935a270a45fc62db18c5730f71171cb (diff) | |
download | ipxe-6c0e8c14be9546b49c097f5e6e8307bda3e7f5ac.zip ipxe-6c0e8c14be9546b49c097f5e6e8307bda3e7f5ac.tar.gz ipxe-6c0e8c14be9546b49c097f5e6e8307bda3e7f5ac.tar.bz2 |
[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>
Diffstat (limited to 'src/image/segment.c')
-rw-r--r-- | src/image/segment.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/image/segment.c b/src/image/segment.c index 9099c8f..c3f0b8d 100644 --- a/src/image/segment.c +++ b/src/image/segment.c @@ -32,6 +32,19 @@ FILE_LICENCE ( GPL2_OR_LATER ); #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 * * @v segment Segment start @@ -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" }, -}; |