diff options
-rw-r--r-- | include/sbi/sbi_platform.h | 15 | ||||
-rw-r--r-- | platform/template/platform.c | 1 |
2 files changed, 7 insertions, 9 deletions
diff --git a/include/sbi/sbi_platform.h b/include/sbi/sbi_platform.h index 0de8be4..ba1d95f 100644 --- a/include/sbi/sbi_platform.h +++ b/include/sbi/sbi_platform.h @@ -30,12 +30,10 @@ #define SBI_PLATFORM_HART_STACK_SIZE_OFFSET (0x54) /** Offset of disabled_hart_mask in struct sbi_platform */ #define SBI_PLATFORM_DISABLED_HART_OFFSET (0x58) -/** Offset of tlb_range_flush_limit in struct sbi_platform */ -#define SBI_PLATFORM_TLB_RANGE_FLUSH_LIMIT_OFFSET (0x60) /** Offset of platform_ops_addr in struct sbi_platform */ -#define SBI_PLATFORM_OPS_OFFSET (0x68) +#define SBI_PLATFORM_OPS_OFFSET (0x60) /** Offset of firmware_context in struct sbi_platform */ -#define SBI_PLATFORM_FIRMWARE_CONTEXT_OFFSET (0x68 + __SIZEOF_POINTER__) +#define SBI_PLATFORM_FIRMWARE_CONTEXT_OFFSET (0x60 + __SIZEOF_POINTER__) #define SBI_PLATFORM_TLB_RANGE_FLUSH_LIMIT_DEFAULT (1UL << 12) @@ -121,6 +119,9 @@ struct sbi_platform_operations { /** Exit IPI for current HART */ void (*ipi_exit)(void); + /** Get tlb flush limit value **/ + u64 (*get_tlbr_flush_limit)(void); + /** Get platform timer value */ u64 (*timer_value)(void); /** Start platform timer event for current HART */ @@ -170,8 +171,6 @@ struct sbi_platform { u32 hart_stack_size; /** Mask representing the set of disabled HARTs */ u64 disabled_hart_mask; - /* Maximum value of tlb flush range request*/ - u64 tlb_range_flush_limit; /** Pointer to sbi platform operations */ unsigned long platform_ops_addr; /** Pointer to system firmware specific context */ @@ -247,8 +246,8 @@ static inline bool sbi_platform_hart_disabled(const struct sbi_platform *plat, */ static inline u64 sbi_platform_tlbr_flush_limit(const struct sbi_platform *plat) { - if (plat && plat->tlb_range_flush_limit) - return plat->tlb_range_flush_limit; + if (plat && sbi_platform_ops(plat)->get_tlbr_flush_limit) + return sbi_platform_ops(plat)->get_tlbr_flush_limit(); return SBI_PLATFORM_TLB_RANGE_FLUSH_LIMIT_DEFAULT; } diff --git a/platform/template/platform.c b/platform/template/platform.c index 1646c8c..f959a11 100644 --- a/platform/template/platform.c +++ b/platform/template/platform.c @@ -224,6 +224,5 @@ const struct sbi_platform platform = { .hart_count = 1, .hart_stack_size = 4096, .disabled_hart_mask = 0, - .tlb_range_flush_limit = 0, .platform_ops_addr = (unsigned long)&platform_ops }; |