platform: Make the platform read-only
platform should be a read-only variable, if it is placed in the data segment, it may be exploited. Signed-off-by: Xiang Wang <wxjstz@126.com>
This commit is contained in:
@@ -39,7 +39,7 @@ u64 get_ticks(void)
|
||||
|
||||
u64 sbi_timer_value(struct sbi_scratch *scratch)
|
||||
{
|
||||
struct sbi_platform *plat = sbi_platform_ptr(scratch);
|
||||
const struct sbi_platform *plat = sbi_platform_ptr(scratch);
|
||||
|
||||
if (sbi_platform_has_timer_value(plat))
|
||||
return sbi_platform_timer_value(plat);
|
||||
|
||||
Reference in New Issue
Block a user