diff options
| author | Inochi Amaoto <[email protected]> | 2023-12-10 17:44:54 +0800 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2023-12-11 09:23:24 +0530 |
| commit | 87aa3069d14b52bf87cb14d8f6b3ed51b45465ea (patch) | |
| tree | 168979658ae6bf1dcff0a39bfe88c7e9d8d65574 /include | |
| parent | a25fc74699feb9409e44344dff742d525f315e5c (diff) | |
platform: recalculate heap size to support new tlb entry number
Previous patch introduced a change that using hart count as the default
number of tlb entries in the fifo. This makes the default tlb fifo size
grow in square with the number of harts. So the default heap size is
not enough to allocate tlb fifo when the hart count is big.
Fixes: 52fd64b ("platform: Uses hart count as the default size of tlb info")
Signed-off-by: Inochi Amaoto <[email protected]>
Reviewed-by: Anup Patel <[email protected]>
Diffstat (limited to 'include')
| -rw-r--r-- | include/sbi/sbi_bitops.h | 1 | ||||
| -rw-r--r-- | include/sbi/sbi_heap.h | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/include/sbi/sbi_bitops.h b/include/sbi/sbi_bitops.h index 48a20901..7d90334d 100644 --- a/include/sbi/sbi_bitops.h +++ b/include/sbi/sbi_bitops.h @@ -26,6 +26,7 @@ #define BIT_MASK(nr) (1UL << ((nr) % BITS_PER_LONG)) #define BIT_WORD(bit) ((bit) / BITS_PER_LONG) #define BIT_WORD_OFFSET(bit) ((bit) & (BITS_PER_LONG - 1)) +#define BIT_ALIGN(bit, align) (((bit) + ((align) - 1)) & ~((align) - 1)) #define GENMASK(h, l) \ (((~0UL) - (1UL << (l)) + 1) & (~0UL >> (BITS_PER_LONG - 1 - (h)))) diff --git a/include/sbi/sbi_heap.h b/include/sbi/sbi_heap.h index 88d176ef..16755ec9 100644 --- a/include/sbi/sbi_heap.h +++ b/include/sbi/sbi_heap.h @@ -12,6 +12,9 @@ #include <sbi/sbi_types.h> +/* Alignment of heap base address and size */ +#define HEAP_BASE_ALIGN 1024 + struct sbi_scratch; /** Allocate from heap area */ |
