commit | 863b150f8efca3928e5f8d1b85835a359607143c | [log] [tgz] |
---|---|---|
author | David Brazdil <dbrazdil@google.com> | Thu Oct 24 13:55:50 2019 +0100 |
committer | David Brazdil <dbrazdil@google.com> | Wed Oct 30 15:50:47 2019 +0000 |
tree | f11f24220dc80f987b80e6db712b8dd238a97867 | |
parent | 9370450493f1d80484e71a4dfac403db4c55d4c9 [diff] |
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
Hafnium is a hypervisor, initially supporting aarch64 (64-bit ARMv8 CPUs).
Get in touch and keep up-to-date at hafnium-discuss@googlegroups.com.
To jump in and build Hafnium, follow the getting started instructions.
If you want to contribute to the project, see details of how we accept contributions.
More documentation is available on: