]> xenbits.xensource.com Git - people/iwj/xen.git/commitdiff
ARM: GIC: add GIC_INVALID to enum gic_version
authorAndre Przywara <andre.przywara@linaro.org>
Wed, 21 Mar 2018 13:38:21 +0000 (13:38 +0000)
committerStefano Stabellini <sstabellini@kernel.org>
Mon, 26 Mar 2018 20:30:55 +0000 (13:30 -0700)
The enum gic_version at the moment just contains GIC_V2 and GIC_V3,
where GIC_V2 happens to map to 0. So without having initialised a
variable of that type, we will read back GIC_V2 (when allocated with zeroing
the memory).
To prevent ambiguities and to give an explicitly uninitialised state, add
a new first member: GIC_INVALID. Also make it obvious that this has a
"0" encoding.

Signed-off-by: Andre Przywara <andre.przywara@linaro.org>
Acked-by: Julien Grall <julien.grall@arm.com>
xen/include/asm-arm/gic.h

index 565b0875cae56eb5ac05d0c8a277f44384595d0d..3079387e06563075c5976a53c46aaea0d27c57b0 100644 (file)
@@ -227,6 +227,7 @@ struct gic_lr {
 };
 
 enum gic_version {
+    GIC_INVALID = 0,    /* the default until explicitly set up */
     GIC_V2,
     GIC_V3,
 };