vmbase_example: Clarify that the payload is a BIOS
Rename all Soong targets to include "_bios" and refactor the linker
script and idmap.S to be preprocessed and receive a CPP macro
representing the "mode". Rename image.ld to reflect this.
Modify the test to use the new "_bios" binary name and refactor it to
make the core logic re-usable for future vmbase_example modes.
No functional change intended.
Test: atest vmbase_example.integration_test
Change-Id: I06679d154494d85916ff534298a066519b1b0778
diff --git a/guest/vmbase_example/idmap.S b/guest/vmbase_example/idmap.S
index 71a6ade..268de5f 100644
--- a/guest/vmbase_example/idmap.S
+++ b/guest/vmbase_example/idmap.S
@@ -43,8 +43,12 @@
.quad .L_TT_TYPE_TABLE + 0f // up to 1 GiB of DRAM
.fill 509, 8, 0x0 // 509 GiB of remaining VA space
- /* level 2 */
-0: .quad .L_BLOCK_MEM | 0x80000000 // DT provided by VMM
+0: /* level 2 */
+#if defined(VMBASE_EXAMPLE_IS_BIOS)
+ .quad .L_BLOCK_MEM | 0x80000000 // DT provided by VMM
.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
+#else
+#error "Unexpected vmbase_example mode: failed to generate idmap"
+#endif