arch/arm64: Avoid GCC warning about out of bounds array access

With the update to GCC 13 a new warning about subtracting numbers from
arrays appears.

src/arch/arm64/armv8/mmu.c:296:9: error: array subscript -1 is outside array bounds of 'u8[]' {aka 'unsigned char[]'} [-Werror=array-bounds=]

Change-Id: I4757ca2e7ad3f969d7416041ea40c3e9866cdf49
Signed-off-by: Zebreus <lennarteichhorn@googlemail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79014
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Zebreus 2023-11-13 21:06:18 +01:00 committed by Felix Singer
parent e00523aae2
commit 9ba7bada08
1 changed files with 1 additions and 1 deletions

View File

@ -293,7 +293,7 @@ void mmu_restore_context(const struct mmu_context *mmu_context)
void mmu_enable(void)
{
assert_correct_ttb_mapping(_ttb);
assert_correct_ttb_mapping(_ettb - 1);
assert_correct_ttb_mapping((void *)((uintptr_t)_ettb - 1));
uint32_t sctlr = raw_read_sctlr_el3();
sctlr |= SCTLR_C | SCTLR_M | SCTLR_I;