[PATCH V2 0/2] hv: add compile time assert


Wu, Binbin
 

The patch series moves the definitions of offset of fields in boot_ctx to the
same header file that the struct boot_ctx is in, to reduce the possibility that
some modification would make the offset inconsistant with the fields within
the structure.

Also, the patch series adds two files to do compile time assert.
One is arch specific, and put in hypervisor/arch/x86/.
The other one is common, and put in hypervisor/common/.
If the statement is not true, there will be error during compile time.
The source files will not increase the size of HV binary.

V1->V2:
Move other ASSERT statements, which should be checked in compile time.
Rename dummy.c to static_checks.c
Two static_checks.c, one for x86 arch specific code, the other for common code.

Binbin Wu (2):
hv: move boot_ctx offset definitions
hv: add compile time assert for static checks

hypervisor/Makefile | 2 +
hypervisor/arch/x86/cpu.c | 72 ----------------------------
hypervisor/arch/x86/cpu_save_boot_ctx.S | 17 +------
hypervisor/arch/x86/static_checks.c | 61 +++++++++++++++++++++++
hypervisor/common/io_request.c | 4 --
hypervisor/common/static_checks.c | 12 +++++
hypervisor/include/arch/x86/guest/vm0_boot.h | 44 +++++++++++++++--
7 files changed, 115 insertions(+), 97 deletions(-)
create mode 100644 hypervisor/arch/x86/static_checks.c
create mode 100644 hypervisor/common/static_checks.c

--
2.7.4

Join acrn-dev@lists.projectacrn.org to automatically receive all group messages.