@@ -14,6 +14,14 @@
/* Max number of boot modules a bootloader can provide in addition to Xen */
#define MAX_NR_BOOTMODS 63
+/* Boot module binary type / purpose */
+enum bootmod_type {
+ BOOTMOD_UNKNOWN,
+ BOOTMOD_XEN,
+ BOOTMOD_KERNEL,
+ BOOTMOD_RAMDISK,
+};
+
struct boot_module {
/* Transitionary only */
module_t *mod;
@@ -31,6 +39,7 @@ struct boot_module {
* [ decompressed kernel ][ unused rounding ]
*/
unsigned long headroom;
+ enum bootmod_type type;
};
/*
@@ -319,6 +319,7 @@ static struct boot_info *__init multiboot_fill_boot_info(unsigned long mbi_p)
/* Variable 'i' should be one entry past the last module. */
bi->mods[i].mod = &mods[bi->nr_modules];
+ bi->mods[i].type = BOOTMOD_XEN;
return bi;
}
@@ -1194,6 +1195,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
bitmap_fill(module_map, bi->nr_modules);
__clear_bit(0, module_map); /* Dom0 kernel is always first */
+ bi->mods[0].type = BOOTMOD_KERNEL;
if ( pvh_boot )
{
@@ -2080,6 +2082,8 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
cpu_has_nx ? "" : "not ");
initrdidx = find_first_bit(module_map, bi->nr_modules);
+ if ( initrdidx < bi->nr_modules )
+ bi->mods[initrdidx].type = BOOTMOD_RAMDISK;
if ( bitmap_weight(module_map, bi->nr_modules) > 1 )
printk(XENLOG_WARNING
"Multiple initrd candidates, picking module #%u\n",