Bo Lv | 72d0e90 | 2023-01-02 14:27:34 +0000 | [diff] [blame^] | 1 | /*Virtual A/B merge status information*/ |
| 2 | |
| 3 | // Spaces used by misc partition are as below: |
| 4 | // 0 - 2K For bootloader_message |
| 5 | // 2K - 16K Used by Vendor's bootloader (the 2K - 4K range may be optionally used |
| 6 | // as bootloader_message_ab struct) |
| 7 | // 16K - 32K Used by uncrypt and recovery to store wipe_package for A/B devices |
| 8 | // 32K - 64K System space, used for miscellanious AOSP features. See below. |
| 9 | // Note that these offsets are admitted by bootloader,recovery and uncrypt, so they |
| 10 | // are not configurable without changing all of them. |
| 11 | |
| 12 | #ifndef _ANDROID_VAB_H_ |
| 13 | #define _ANDROID_VAB_H_ |
| 14 | |
| 15 | #define BOOTLOADER_MESSAGE_OFFSET_IN_MISC 0 |
| 16 | #define VENDOR_SPACE_OFFSET_IN_MISC 2 * 1024 |
| 17 | #define WIPE_PACKAGE_OFFSET_IN_MISC 16 * 1024 |
| 18 | #define SYSTEM_SPACE_OFFSET_IN_MISC 32 * 1024 |
| 19 | #define SYSTEM_SPACE_SIZE_IN_MISC 32 * 1024 |
| 20 | |
| 21 | enum MergeStatus { |
| 22 | /** |
| 23 | * No snapshot or merge is in progress. |
| 24 | */ |
| 25 | NONE = 0, |
| 26 | |
| 27 | /** |
| 28 | * The merge status could not be determined. |
| 29 | */ |
| 30 | UNKNOWN, |
| 31 | |
| 32 | /** |
| 33 | * Partitions are being snapshotted, but no merge has been started. |
| 34 | */ |
| 35 | SNAPSHOTTED, |
| 36 | |
| 37 | /** |
| 38 | * At least one partition has merge is in progress. |
| 39 | */ |
| 40 | MERGING, |
| 41 | |
| 42 | /** |
| 43 | * A merge was in progress, but it was canceled by the bootloader. |
| 44 | */ |
| 45 | CANCELLED, |
| 46 | }; |
| 47 | |
| 48 | // Holds Virtual A/B merge status information. Current version is 1. New fields |
| 49 | // must be added to the end. |
| 50 | struct misc_virtual_ab_message { |
| 51 | uint8_t version; |
| 52 | uint32_t magic; |
| 53 | uint8_t merge_status; // IBootControl 1.1, MergeStatus enum. |
| 54 | uint8_t source_slot; // Slot number when merge_status was written. |
| 55 | uint8_t reserved[57]; |
| 56 | }; |
| 57 | |
| 58 | #endif |