* [PATCH] libelf portability
@ 2007-09-20 14:17 Christoph Egger
0 siblings, 0 replies; only message in thread
From: Christoph Egger @ 2007-09-20 14:17 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1: Type: text/plain, Size: 587 bytes --]
Hi!
Attached patch adds support for OpenBSD and NetBSD to libelf
in relation to tools/libxc.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
--
AMD Saxony, Dresden, Germany
Operating System Research Center
Legal Information:
AMD Saxony Limited Liability Company & Co. KG
Sitz (Geschäftsanschrift):
Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland
Registergericht Dresden: HRA 4896
vertretungsberechtigter Komplementär:
AMD Saxony LLC (Sitz Wilmington, Delaware, USA)
Geschäftsführer der AMD Saxony LLC:
Dr. Hans-R. Deppe, Thomas McCoy
[-- Attachment #2: libelf_libxc.diff --]
[-- Type: text/plain, Size: 798 bytes --]
diff -r a00cc97b392a xen/common/libelf/libelf-private.h
--- a/xen/common/libelf/libelf-private.h Wed Sep 12 09:43:33 2007 +0100
+++ b/xen/common/libelf/libelf-private.h Thu Sep 20 16:01:28 2007 +0000
@@ -33,8 +33,20 @@
#define bswap_16(x) BSWAP_16(x)
#define bswap_32(x) BSWAP_32(x)
#define bswap_64(x) BSWAP_64(x)
+#elif defined(__NetBSD__)
+#include <sys/bswap.h>
+#define bswap_16(x) bswap16(x)
+#define bswap_32(x) bswap32(x)
+#define bswap_64(x) bswap64(x)
+#elif defined(__OpenBSD__)
+#include <machine/endian.h>
+#define bswap_16(x) swap16(x)
+#define bswap_32(x) swap32(x)
+#define bswap_64(x) swap64(x)
+#elif defined(__linux__) || defined(__Linux__)
+#include <byteswap.h>
#else
-#include <byteswap.h>
+#error Unsupported OS
#endif
#include <xen/elfnote.h>
#include <xen/libelf.h>
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-09-20 14:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-20 14:17 [PATCH] libelf portability Christoph Egger
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.