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:
Xiang Wang
2019-03-06 15:29:34 +08:00
committed by Atish Patra
parent 27fae182dc
commit 9eb8f0f90d
11 changed files with 45 additions and 43 deletions

View File

@@ -125,7 +125,7 @@ static int sifive_u_system_down(u32 type)
return 0;
}
struct sbi_platform platform = {
const struct sbi_platform platform = {
.name = "QEMU SiFive Unleashed",
.features = SBI_PLATFORM_DEFAULT_FEATURES,
.hart_count = SIFIVE_U_HART_COUNT,