vmbase_example: Add support for kernel mode & test
Support linking vmbase_example as a payload compatible with crosvm's
"kernel" (default) mode.
Extend vmbase_example.integration_test to replicate the BIOS mode tests
in kernel mode, with the respective corresponding vmbase_example builds.
Bug: 359659124
Test: atest vmbase_example.integration_test
Change-Id: Ib125d46d703b62b2d65a3d4a6691d046720f1343
diff --git a/guest/vmbase_example/idmap.S b/guest/vmbase_example/idmap.S
index 2e62085..881850c 100644
--- a/guest/vmbase_example/idmap.S
+++ b/guest/vmbase_example/idmap.S
@@ -49,6 +49,10 @@
.quad .L_BLOCK_MEM_XIP | 0x80200000 // 2 MiB of DRAM containing image
.quad .L_BLOCK_MEM | 0x80400000 // 2 MiB of writable DRAM
.fill 509, 8, 0x0
+#elif defined(VMBASE_EXAMPLE_IS_KERNEL)
+ .quad .L_BLOCK_MEM_XIP | 0x80000000 // 2 MiB of DRAM containing image
+ .quad .L_BLOCK_MEM | 0x80200000 // 2 MiB of writable DRAM
+ .fill 510, 8, 0x0
#else
#error "Unexpected vmbase_example mode: failed to generate idmap"
#endif