xen/arm: fix get_cpu_info() when built with clang
authorJulien Grall <julien.grall@arm.com>
Tue, 26 Mar 2019 21:52:20 +0000 (21:52 +0000)
committerJulien Grall <julien.grall@arm.com>
Thu, 3 Oct 2019 10:38:14 +0000 (11:38 +0100)
commita943d6ccffff7bba9988c1c8968b37b031724cd2
tree683e7bc23fa7b5b9108009c67303c695126961ed
parentb01b1dc046da70a2621a4d1f032ddb22b0cdde6b
xen/arm: fix get_cpu_info() when built with clang

Clang understands the GCCism in use here, but still complains that sp is
unitialised. In such cases, resort to the older versions of this code,
which directly read sp into the temporary variable.

Note that GCCism is still kept in default because other compilers (e.g.
clang) may also define __GNUC__, so AFAIK there are no proper way to
detect properly GCC.

This means that in the event Xen is ported to a new compiler, the code
will need to be updated. But that likely not going to be the only place
where Xen will need to be adapted...

This is based on the x86 counterpart.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
xen/include/asm-arm/current.h