Hi,

I'm upgrading the ATF I use from 2.4 to 2.8, and ran into a header conflict. The change

  https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/13806

introduced an inclusion of

  include/drivers/arm/gicv3.h

in lib/el3_runtime/aarch64/context_mgmt.c, but in my build environment that .c file also includes

  include/drivers/arm/gicv2.h

so now I get macro redefinition of "INT_ID_MASK" errors when compiling. Is it an error, that in my build environment the gicv2.h gets included ?

I've solved it locally by doing:

diff --git a/lib/el3_runtime/aarch64/context_mgmt.c b/lib/el3_runtime/aarch64/context_mgmt.c
index 866ac4154..395635a86 100644
--- a/lib/el3_runtime/aarch64/context_mgmt.c
+++ b/lib/el3_runtime/aarch64/context_mgmt.c
@@ -18,7 +18,9 @@
 #include <common/bl_common.h>
 #include <common/debug.h>
 #include <context.h>
+#if CTX_INCLUDE_EL2_REGS
 #include <drivers/arm/gicv3.h>
+#endif
 #include <lib/el3_runtime/context_mgmt.h>
 #include <lib/el3_runtime/pubsub_events.h>
 #include <lib/extensions/amu.h>

but I am not sure whether this is the correct fix or not, or if I am doing something else wrong here. Any suggestions on what would be the correct fix ?

Regards
Jacob