render / rpms / qemu

Forked from rpms/qemu 5 months ago
Clone

Blame 0007-fdt-update-embedded-header-file-from-upstream-to-fix.patch

562b65
From 53800f1a71cdbc9e0deadd00e77d5d60a45ab999 Mon Sep 17 00:00:00 2001
562b65
From: Andre Przywara <andre.przywara@linaro.org>
562b65
Date: Tue, 7 May 2013 14:36:59 +0200
562b65
Subject: [PATCH] fdt: update embedded header file from upstream to fix
562b65
 compilation
562b65
562b65
Upstream dtc.git introduced a change in libfdt_env.h, which breaks
562b65
compilation with QEMU's version of it:
562b65
562b65
  CC arm-softmmu/device_tree.o
562b65
In file included from /usr/include/libfdt.h:55:0,
562b65
                 from /src/qemu.git/device_tree.c:28:
562b65
/usr/include/fdt.h:7:2: error: unknown type name 'fdt32_t'
562b65
   ...
562b65
562b65
The culprit is:
562b65
commit feafcd972cb744750a65728440c99526e6199a6d
562b65
Author: Kim Phillips <kim.phillips@freescale.com>
562b65
Date:   Wed Nov 28 17:33:01 2012 -0600
562b65
562b65
    dtc/libfdt: introduce fdt types for annotation by endian checkers
562b65
    ...
562b65
562b65
Pull the new definitions into QEMU's version of the file. This change
562b65
also works with older installed versions of dtc.
562b65
The upstream version got a "GPL or BSD" dual license header meanwhile.
562b65
I retained the original GPL license header from QEMU, only added
562b65
the original copyrights.
562b65
562b65
Signed-off-by: Andre Przywara <andre.przywara@linaro.org>
562b65
---
562b65
 include/libfdt_env.h | 25 ++++++++++++++++++++-----
562b65
 1 file changed, 20 insertions(+), 5 deletions(-)
562b65
562b65
diff --git a/include/libfdt_env.h b/include/libfdt_env.h
562b65
index 3667d4c..aad54bb 100644
562b65
--- a/include/libfdt_env.h
562b65
+++ b/include/libfdt_env.h
562b65
@@ -1,4 +1,12 @@
562b65
+#ifndef _LIBFDT_ENV_H
562b65
+#define _LIBFDT_ENV_H
562b65
 /*
562b65
+ * libfdt - Flat Device Tree manipulation
562b65
+ * Copyright (C) 2006 David Gibson, IBM Corporation.
562b65
+ * Copyright 2012 Kim Phillips, Freescale Semiconductor.
562b65
+ * Adaptation to QEMU: Copyright IBM Corp. 2008
562b65
+ *                     by Hollis Blanchard <hollisb@us.ibm.com>
562b65
+ *
562b65
  * This program is free software; you can redistribute it and/or modify
562b65
  * it under the terms of the GNU General Public License, version 2, as
562b65
  * published by the Free Software Foundation.
562b65
@@ -11,16 +19,23 @@
562b65
  * You should have received a copy of the GNU General Public License
562b65
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
562b65
  *
562b65
- * Copyright IBM Corp. 2008
562b65
- * Authors: Hollis Blanchard <hollisb@us.ibm.com>
562b65
  *
562b65
  */
562b65
 
562b65
-#ifndef _LIBFDT_ENV_H
562b65
-#define _LIBFDT_ENV_H
562b65
-
562b65
 #include "qemu/bswap.h"
562b65
 
562b65
+#ifdef __CHECKER__
562b65
+#define __force __attribute__((force))
562b65
+#define __bitwise __attribute__((bitwise))
562b65
+#else
562b65
+#define __force
562b65
+#define __bitwise
562b65
+#endif
562b65
+
562b65
+typedef uint16_t __bitwise fdt16_t;
562b65
+typedef uint32_t __bitwise fdt32_t;
562b65
+typedef uint64_t __bitwise fdt64_t;
562b65
+
562b65
 #ifdef HOST_WORDS_BIGENDIAN
562b65
 #define fdt32_to_cpu(x)  (x)
562b65
 #define cpu_to_fdt32(x)  (x)