diff options
author | Daniel Kiper <dkiper@net-space.pl> | 2011-08-21 15:52:42 +0200 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2011-08-22 07:39:49 +0900 |
commit | f6929891145014dff22199d25c87ccd38256af2c (patch) | |
tree | 8c18a41873d379a62c2c552e6fea3e3f0e4d79c4 /kexec/firmware_memmap.h | |
parent | 408594d30843bdb7c45a391d8fccbaf468d47777 (diff) | |
download | kexec-tools-f6929891145014dff22199d25c87ccd38256af2c.tar.gz |
kexec: Export compare_ranges() function from firmware_memmap.c module
Export compare_ranges() function from firmware_memmap.c module.
It is generic function and it could be used by other modules.
Signed-off-by: Daniel Kiper <dkiper@net-space.pl>
Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'kexec/firmware_memmap.h')
-rw-r--r-- | kexec/firmware_memmap.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/kexec/firmware_memmap.h b/kexec/firmware_memmap.h index adb03c3..eac0ddb 100644 --- a/kexec/firmware_memmap.h +++ b/kexec/firmware_memmap.h @@ -39,6 +39,19 @@ */ /** + * Compares two memory ranges according to their start address. This function + * can be used with qsort() as @c compar function. + * + * @param[in] first a pointer to the first memory range + * @param[in] second a pointer to the second memory range + * @return 0 if @p first and @p second have the same start address, + * a value less then 0 if the start address of @p first is less than + * the start address of @p second, and a value greater than 0 if + * the opposite is in case. + */ +int compare_ranges(const void *first, const void *second); + +/** * Checks if the kernel provides the /sys/firmware/memmap interface. * It makes sense to use that function in advance before calling * get_firmware_memmap_ranges() because the latter function prints an error |