WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 2/4] kexec: Export compare_ranges() function from fir

To: konrad.wilk@xxxxxxxxxx, ian.campbell@xxxxxxxxxx, vgoyal@xxxxxxxxxx, horms@xxxxxxxxxxxx, olaf@xxxxxxxxx, kexec@xxxxxxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 2/4] kexec: Export compare_ranges() function from firmware_memmap.c module
From: Daniel Kiper <dkiper@xxxxxxxxxxxx>
Date: Sun, 21 Aug 2011 15:52:42 +0200
Cc:
Delivery-date: Sun, 21 Aug 2011 06:55:14 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.3.28i
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@xxxxxxxxxxxx>
---
 kexec/firmware_memmap.c |   14 ++------------
 kexec/firmware_memmap.h |   13 +++++++++++++
 2 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/kexec/firmware_memmap.c b/kexec/firmware_memmap.c
index d8afed5..9598933 100644
--- a/kexec/firmware_memmap.c
+++ b/kexec/firmware_memmap.c
@@ -179,18 +179,8 @@ static int parse_memmap_entry(const char *entry, struct 
memory_range *range)
        return 0;
 }
 
-/**
- * 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.
- */
-static int compare_ranges(const void *first, const void *second)
+/* documentation: firmware_memmap.h */
+int compare_ranges(const void *first, const void *second)
 {
        const struct memory_range *first_range = first;
        const struct memory_range *second_range = second;
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
-- 
1.5.6.5

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH 2/4] kexec: Export compare_ranges() function from firmware_memmap.c module, Daniel Kiper <=