mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-25 07:41:42 +01:00
platform: Allow platforms to specify heap size
We extend struct sbi_platform and struct sbi_scratch to allow platforms specify the heap size to the OpenSBI firmwares. The OpenSBI firmwares will use this information to determine the location of heap and provide heap base address in per-HART scratch space. Signed-off-by: Anup Patel <apatel@ventanamicro.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
This commit is contained in:
@@ -185,5 +185,6 @@ const struct sbi_platform platform = {
|
||||
.features = SBI_PLATFORM_DEFAULT_FEATURES,
|
||||
.hart_count = ARIANE_HART_COUNT,
|
||||
.hart_stack_size = SBI_PLATFORM_DEFAULT_HART_STACK_SIZE,
|
||||
.heap_size = SBI_PLATFORM_DEFAULT_HEAP_SIZE(ARIANE_HART_COUNT),
|
||||
.platform_ops_addr = (unsigned long)&platform_ops
|
||||
};
|
||||
|
@@ -220,5 +220,7 @@ const struct sbi_platform platform = {
|
||||
.features = SBI_PLATFORM_DEFAULT_FEATURES,
|
||||
.hart_count = OPENPITON_DEFAULT_HART_COUNT,
|
||||
.hart_stack_size = SBI_PLATFORM_DEFAULT_HART_STACK_SIZE,
|
||||
.heap_size =
|
||||
SBI_PLATFORM_DEFAULT_HEAP_SIZE(OPENPITON_DEFAULT_HART_COUNT),
|
||||
.platform_ops_addr = (unsigned long)&platform_ops
|
||||
};
|
||||
|
@@ -115,7 +115,7 @@ unsigned long fw_platform_init(unsigned long arg0, unsigned long arg1,
|
||||
}
|
||||
|
||||
platform.hart_count = hart_count;
|
||||
|
||||
platform.heap_size = SBI_PLATFORM_DEFAULT_HEAP_SIZE(hart_count);
|
||||
platform_has_mlevel_imsic = fdt_check_imsic_mlevel(fdt);
|
||||
|
||||
/* Return original FDT pointer */
|
||||
@@ -315,5 +315,6 @@ struct sbi_platform platform = {
|
||||
.hart_count = SBI_HARTMASK_MAX_BITS,
|
||||
.hart_index2id = generic_hart_index2id,
|
||||
.hart_stack_size = SBI_PLATFORM_DEFAULT_HART_STACK_SIZE,
|
||||
.heap_size = SBI_PLATFORM_DEFAULT_HEAP_SIZE(0),
|
||||
.platform_ops_addr = (unsigned long)&platform_ops
|
||||
};
|
||||
|
@@ -196,5 +196,7 @@ const struct sbi_platform platform = {
|
||||
.features = 0,
|
||||
.hart_count = K210_HART_COUNT,
|
||||
.hart_stack_size = SBI_PLATFORM_DEFAULT_HART_STACK_SIZE,
|
||||
.heap_size =
|
||||
SBI_PLATFORM_DEFAULT_HEAP_SIZE(K210_HART_COUNT),
|
||||
.platform_ops_addr = (unsigned long)&platform_ops
|
||||
};
|
||||
|
@@ -244,5 +244,7 @@ const struct sbi_platform platform = {
|
||||
.features = SBI_PLATFORM_DEFAULT_FEATURES,
|
||||
.hart_count = UX600_HART_COUNT,
|
||||
.hart_stack_size = SBI_PLATFORM_DEFAULT_HART_STACK_SIZE,
|
||||
.heap_size =
|
||||
SBI_PLATFORM_DEFAULT_HEAP_SIZE(UX600_HART_COUNT),
|
||||
.platform_ops_addr = (unsigned long)&platform_ops
|
||||
};
|
||||
|
@@ -152,5 +152,6 @@ const struct sbi_platform platform = {
|
||||
.features = SBI_PLATFORM_DEFAULT_FEATURES,
|
||||
.hart_count = 1,
|
||||
.hart_stack_size = SBI_PLATFORM_DEFAULT_HART_STACK_SIZE,
|
||||
.heap_size = SBI_PLATFORM_DEFAULT_HEAP_SIZE(1),
|
||||
.platform_ops_addr = (unsigned long)&platform_ops
|
||||
};
|
||||
|
Reference in New Issue
Block a user