Platform-neutral record format and policy for the early-boot loop guard (see fl/wdt/boot_guard.h).
Everything is always-inline: platforms call it from startup hooks that run before normal code memory is ready.
Definition in file boot_guard_record.h.
|
| FL_ALWAYS_INLINE fl::u32 | fl::bootGuardCheck (fl::u32 image, fl::u32 boots, fl::u32 crashes) |
| |
| FL_ALWAYS_INLINE fl::u32 | fl::bootGuardDecode (const volatile BootGuardRecord &r, fl::u32 image) |
| | Boot count stored in r, or 0 if r is not a valid record of image.
|
| |
| FL_ALWAYS_INLINE fl::u32 | fl::bootGuardDecodeCrashes (const volatile BootGuardRecord &r, fl::u32 image) |
| | Crash count stored in r, or 0 if r is not a valid record of image.
|
| |
| FL_ALWAYS_INLINE void | fl::bootGuardEncode (volatile BootGuardRecord &r, fl::u32 image, fl::u32 boots) |
| | Store boots, keeping the crash count (0 if the record is invalid).
|
| |
| FL_ALWAYS_INLINE void | fl::bootGuardEncodeCrashes (volatile BootGuardRecord &r, fl::u32 image, fl::u32 crashes) |
| | Store crashes, keeping the boot count (0 if the record is invalid).
|
| |
| FL_ALWAYS_INLINE fl::u32 | fl::bootGuardHashWords (const volatile fl::u32 *words, fl::u32 count, fl::u32 stride=1) |
| | FNV-1a over every stride-th of count 32-bit words; platforms hash their firmware image with it to get the record key.
|
| |
| FL_ALWAYS_INLINE BootGuardDecision | fl::bootGuardOnBoot (fl::u32 stored_boots, fl::u32 escape_boots) |
| | Boot-guard policy.
|
| |
| FL_ALWAYS_INLINE void | fl::bootGuardStore (volatile BootGuardRecord &r, fl::u32 image, fl::u32 boots, fl::u32 crashes) |
| | Store both counts in r as a valid record of image.
|
| |
| FL_ALWAYS_INLINE bool | fl::bootGuardValid (const volatile BootGuardRecord &r, fl::u32 image) |
| | True when r holds a valid record written by firmware image.
|
| |