Auto-generate header of struct offsets/sizes
Code written in assembly needs to be told the offsets of struct members.
Currently these are hardcoded and static_assert-ed at compile time,
requiring manual updates every time struct declarations change.
This patch adds a mechanism for auto-generating a header with these
constants.
It uses a "hack" similar to other projects, e.g. Linux, where the
integer constant is used as an immediate in an inline assembly block.
The file is compiled and the constant extracted by a script which
generates the header file. For easy grep-ing, the constant is compiled
into a '.ascii' string, surrounded by magic strings, and extracted using
the 'strings' binutils tool.
To guarantee correctness, the same source file is compiled again as part
of the Hafnium binary but this time the declarations are converted to
static_asserts which check the values.
Fix: 120137356
Test: ./kokoru/ubuntu/build.sh
Change-Id: I551126519675e73cb01b4beb4ff9b1200b9b3de7
diff --git a/src/arch/aarch64/hypervisor/exceptions.S b/src/arch/aarch64/hypervisor/exceptions.S
index e8e391b..b8a1fcd 100644
--- a/src/arch/aarch64/hypervisor/exceptions.S
+++ b/src/arch/aarch64/hypervisor/exceptions.S
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "offsets.h"
+#include "hf/arch/offsets.h"
#include "exception_macros.S"
/**