From ec67a827f6b6482e688a92a5b99accfdb2e17b5e Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Mon, 22 Jul 2019 13:00:28 +0200 Subject: cleanup PAM check Signed-off-by: Paolo Bonzini --- hwsetup.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'hwsetup.c') diff --git a/hwsetup.c b/hwsetup.c index 617af06..9d51daa 100644 --- a/hwsetup.c +++ b/hwsetup.c @@ -99,7 +99,7 @@ void setup_hw(void) const int bdf = 0; const uint8_t *bios_start = (void *)((uintptr_t)&stext + 0xfff00000); const uint8_t *init_start = (void *)((uintptr_t)&sinit + 0xfff00000); - volatile uint8_t *rom_check = &stext; + static volatile uint8_t rom_check; int rom_check_value; int pambase; @@ -116,9 +116,9 @@ void setup_hw(void) panic(); // Make ram from 0xc0000-0xf0000 read-write - rom_check_value = *rom_check; - *rom_check = rom_check_value + 1; - if (*rom_check == rom_check_value) + rom_check_value = rom_check; + rom_check = rom_check_value + 1; + if (rom_check == rom_check_value) setup_pam(bdf, pambase); // Shadow BIOS; we're still running from 0xffff0000 -- cgit v1.1