diff mbox

[v2,for-4.7,05/14] tools/headers: prevent adding two __align8__ to uint64_t in ARM headers

Message ID 1461682343-20597-6-git-send-email-roger.pau@citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Roger Pau Monné April 26, 2016, 2:52 p.m. UTC
Due to the fact that on ARM headers types are substituted to uint64_t and
then uint64_t is also substituted to contain the aligment, this would lead
to some types containing two __align8__ directives. Fix this by first
expanding Xen specific types to uint64_t only, and then replacing all the
uint64_t types to __align8__ uint64_t. This relies on the fact that all
Xen-specific types will have longer names, so they will always be replaced
first.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
---
 tools/include/xen-foreign/mkheader.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Andrew Cooper April 26, 2016, 3:08 p.m. UTC | #1
On 26/04/16 15:52, Roger Pau Monne wrote:
> Due to the fact that on ARM headers types are substituted to uint64_t and
> then uint64_t is also substituted to contain the aligment, this would lead
> to some types containing two __align8__ directives. Fix this by first
> expanding Xen specific types to uint64_t only, and then replacing all the
> uint64_t types to __align8__ uint64_t. This relies on the fact that all
> Xen-specific types will have longer names, so they will always be replaced
> first.
>
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Douglas Goldstein April 26, 2016, 3:15 p.m. UTC | #2
On 4/26/16 9:52 AM, Roger Pau Monne wrote:
> Due to the fact that on ARM headers types are substituted to uint64_t and
> then uint64_t is also substituted to contain the aligment, this would lead
> to some types containing two __align8__ directives. Fix this by first
> expanding Xen specific types to uint64_t only, and then replacing all the
> uint64_t types to __align8__ uint64_t. This relies on the fact that all
> Xen-specific types will have longer names, so they will always be replaced
> first.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
Wei Liu April 26, 2016, 3:17 p.m. UTC | #3
On Tue, Apr 26, 2016 at 04:52:14PM +0200, Roger Pau Monne wrote:
> Due to the fact that on ARM headers types are substituted to uint64_t and
> then uint64_t is also substituted to contain the aligment, this would lead
> to some types containing two __align8__ directives. Fix this by first
> expanding Xen specific types to uint64_t only, and then replacing all the
> uint64_t types to __align8__ uint64_t. This relies on the fact that all
> Xen-specific types will have longer names, so they will always be replaced
> first.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> ---
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Wei Liu <wei.liu2@citrix.com>

Acked-by: Wei Liu <wei.liu2@citrix.com>
diff mbox

Patch

diff --git a/tools/include/xen-foreign/mkheader.py b/tools/include/xen-foreign/mkheader.py
index 0504cb8..0e42e14 100644
--- a/tools/include/xen-foreign/mkheader.py
+++ b/tools/include/xen-foreign/mkheader.py
@@ -20,8 +20,8 @@  footer = {};
 inttypes["arm32"] = {
     "unsigned long" : "__danger_unsigned_long_on_arm32",
     "long"          : "__danger_long_on_arm32",
-    "xen_pfn_t"     : "__align8__ uint64_t",
-    "xen_ulong_t"   : "__align8__ uint64_t",
+    "xen_pfn_t"     : "uint64_t",
+    "xen_ulong_t"   : "uint64_t",
     "uint64_t"      : "__align8__ uint64_t",
 };
 header["arm32"] = """
@@ -41,8 +41,8 @@  footer["arm32"] = """
 inttypes["arm64"] = {
     "unsigned long" : "__danger_unsigned_long_on_arm64",
     "long"          : "__danger_long_on_arm64",
-    "xen_pfn_t"     : "__align8__ uint64_t",
-    "xen_ulong_t"   : "__align8__ uint64_t",
+    "xen_pfn_t"     : "uint64_t",
+    "xen_ulong_t"   : "uint64_t",
     "uint64_t"      : "__align8__ uint64_t",
 };
 header["arm64"] = """