xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: David Vrabel <david.vrabel@citrix.com>
To: xen-devel@lists.xensource.com
Cc: David Vrabel <david.vrabel@citrix.com>
Subject: [PATCH 5/7] libfdt: fixup libfdt_env.h for xen
Date: Fri, 3 Feb 2012 19:15:13 +0000	[thread overview]
Message-ID: <1328296515-25876-6-git-send-email-david.vrabel@citrix.com> (raw)
In-Reply-To: <1328296515-25876-1-git-send-email-david.vrabel@citrix.com>

From: David Vrabel <david.vrabel@citrix.com>

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
---
 xen/common/libfdt/libfdt_env.h |   27 ++++++++++-----------------
 xen/include/xen/types.h        |    2 ++
 2 files changed, 12 insertions(+), 17 deletions(-)

diff --git a/xen/common/libfdt/libfdt_env.h b/xen/common/libfdt/libfdt_env.h
index 449bf60..8c0c030 100644
--- a/xen/common/libfdt/libfdt_env.h
+++ b/xen/common/libfdt/libfdt_env.h
@@ -1,23 +1,16 @@
 #ifndef _LIBFDT_ENV_H
 #define _LIBFDT_ENV_H
 
-#include <stddef.h>
-#include <stdint.h>
-#include <string.h>
+#include <xen/config.h>
+#include <xen/types.h>
+#include <xen/string.h>
+#include <asm/byteorder.h>
 
-#define _B(n)	((unsigned long long)((uint8_t *)&x)[n])
-static inline uint32_t fdt32_to_cpu(uint32_t x)
-{
-	return (_B(0) << 24) | (_B(1) << 16) | (_B(2) << 8) | _B(3);
-}
-#define cpu_to_fdt32(x) fdt32_to_cpu(x)
-
-static inline uint64_t fdt64_to_cpu(uint64_t x)
-{
-	return (_B(0) << 56) | (_B(1) << 48) | (_B(2) << 40) | (_B(3) << 32)
-		| (_B(4) << 24) | (_B(5) << 16) | (_B(6) << 8) | _B(7);
-}
-#define cpu_to_fdt64(x) fdt64_to_cpu(x)
-#undef _B
+#define fdt16_to_cpu(x) be16_to_cpu(x)
+#define cpu_to_fdt16(x) cpu_to_be16(x)
+#define fdt32_to_cpu(x) be32_to_cpu(x)
+#define cpu_to_fdt32(x) cpu_to_be32(x)
+#define fdt64_to_cpu(x) be64_to_cpu(x)
+#define cpu_to_fdt64(x) cpu_to_be64(x)
 
 #endif /* _LIBFDT_ENV_H */
diff --git a/xen/include/xen/types.h b/xen/include/xen/types.h
index fd89c98..727d5a5 100644
--- a/xen/include/xen/types.h
+++ b/xen/include/xen/types.h
@@ -58,4 +58,6 @@ typedef __u32 __be32;
 typedef __u64 __le64;
 typedef __u64 __be64;
 
+typedef unsigned long uintptr_t;
+
 #endif /* __TYPES_H__ */
-- 
1.7.2.5

  parent reply	other threads:[~2012-02-03 19:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-03 19:15 [PATCH 0/7] RFC: arm: (really) minimal device tree support David Vrabel
2012-02-03 19:15 ` [PATCH 1/7] libfdt: add version 1.3.0 David Vrabel
2012-02-03 19:15 ` [PATCH 2/7] libfdt: add to build David Vrabel
2012-02-03 19:15 ` [PATCH 3/7] arm: link a device tree blob into the xen image David Vrabel
2012-02-03 20:22   ` Tim Deegan
2012-02-03 19:15 ` [PATCH 4/7] arm: map device tree blob in initial page tables David Vrabel
2012-02-03 21:18   ` Tim Deegan
2012-02-06 17:36     ` David Vrabel
2012-02-07  9:28       ` Tim Deegan
2012-02-03 19:15 ` David Vrabel [this message]
2012-02-03 19:15 ` [PATCH 6/7] arm: add early_printk() David Vrabel
2012-02-03 19:15 ` [PATCH 7/7] arm, device tree: parse the DTB for RAM location and size David Vrabel

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=1328296515-25876-6-git-send-email-david.vrabel@citrix.com \
    --to=david.vrabel@citrix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).