Re: Flash memory mapped region protection
Konstantin Aladyshev
Thanks for the answer! I'll investigate the mentioned modules.
toggle quoted message
Show quoted text
As for my example I completely forgot that I can declare variable as 'volatile' like this: ``` volatile UINT32* Val = (UINT32*)(FixedPcdGet32(PcdMyRegionBase)); Print(L"Val = 0x%08x\n", *Val); *Val = 0xCAFECAFE; Print(L"Val = 0x%08x\n", *Val); ``` This way compiler doesn't perform any optimizations and it is clearly seen that the variable is read-only: ``` FS0:\> FlashAccessRaw.efi Val = 0xEFBEADDE Val = 0xEFBEADDE ``` Best regards, Konstantin Aladyshev On Tue, Jul 26, 2022 at 8:09 PM Andrew Fish <afish@...> wrote:
|
|