Sice `bootinfo` statically allocates space in the final image to store
Memory Region Descriptors at runtime and their actual amount is highly
variable depending on the platform, allow the user to configure a
precise maximum amount of such descriptors.
This allows flexibility in the size of the final image. One can check
at runtime whether `-ENOMEM` is returned by the memory region insertion
function or not and adjust `CONFIG_UKPLAT_MEMREGION_MAX_COUNT` accordingly.
Signed-off-by: Sergiu Moga <sergiu.moga@protonmail.com>
Reviewed-by: Michalis Pappas <michalis@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #848
help
Enable name field in memory region descriptors
+config UKPLAT_MEMREGION_MAX_COUNT
+ int "Maximum amount of Bootinfo Memory Region Descriptors"
+ default 128
+ help
+ The number of memory region descriptors depends on the platform. Some
+ may have less than 100, while others may have 100's of memory region
+ descriptors. In order to cope with this, the user is able to configure
+ the amount of statically allocated space in the image made available
+ for storing memory region descriptors' metadata.
+
config UKPLAT_LCPU_MAXCOUNT
int "Maximum number of supported logical CPUs"
range 1 256
/**
* Space reservation for boot information. Will be populated by build script.
*/
-__section(".uk_bootinfo") __align(8) __used
-static char bi_bootinfo_sec[UKPLAT_BOOTINFO_SIZE(32)];
+__section(".uk_bootinfo") __align(8) __used static char
+bi_bootinfo_sec[UKPLAT_BOOTINFO_SIZE(CONFIG_UKPLAT_MEMREGION_MAX_COUNT)];
/**
* Pointer to boot information. Can be changed at runtime if the boot