| 61 | } |
| 62 | |
| 63 | static inline int vboot_logic_executed(void) |
| 64 | { |
| 65 | extern int vboot_executed; /* should not be globally accessible */ |
| 66 | |
| 67 | /* If we are in the stage that runs verification, or in the stage that |
| 68 | both loads the verstage and is returned to from it afterwards, we |
| 69 | need to check a global to see if verification has run. */ |
| 70 | if (verification_should_run() || |
| 71 | (verstage_should_load() && CONFIG(VBOOT_RETURN_FROM_VERSTAGE))) |
| 72 | return vboot_executed; |
| 73 | |
| 74 | if (CONFIG(VBOOT_STARTS_IN_BOOTBLOCK)) { |
| 75 | /* All other stages are "after the bootblock" */ |
| 76 | return !ENV_BOOTBLOCK; |
| 77 | } else if (CONFIG(VBOOT_STARTS_IN_ROMSTAGE)) { |
| 78 | /* Post-RAM stages are "after the romstage" */ |
| 79 | return !ENV_ROMSTAGE_OR_BEFORE; |
| 80 | } else if (CONFIG(VBOOT_STARTS_BEFORE_BOOTBLOCK)) { |
| 81 | return !ENV_SEPARATE_VERSTAGE; |
| 82 | } else { |
| 83 | dead_code(); |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | static inline bool vboot_hwcrypto_allowed(void) |
| 88 | { |
no test coverage detected