All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christoph Egger" <Christoph.Egger@amd.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH] libelf portability
Date: Thu, 20 Sep 2007 16:17:59 +0200	[thread overview]
Message-ID: <200709201617.59589.Christoph.Egger@amd.com> (raw)

[-- 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

                 reply	other threads:[~2007-09-20 14:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200709201617.59589.Christoph.Egger@amd.com \
    --to=christoph.egger@amd.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.