Skip to main content

raw_acpi/
bgrt.rs

1use crate::SDTHeader;
2
3#[derive(Copy, Clone)]
4#[repr(C, packed)]
5/// ## Boot Graphics Resource Table (BGRT)
6/// 
7/// The Boot Graphics Resource Table (BGRT) is an optional table that provides a mechanism
8/// to indicate that an image was drawn on the screen during boot, and some information about the image.
9/// 
10/// The table is written when the image is drawn on the screen. This should be done after it is expected that any firmware components
11/// that may write to the screen are done doing so and it is known that the image is the only thing on the screen.
12/// If the boot path is interrupted (e.g., by a key press), the Displayed bit within the status field should be changed to 0
13/// to indicate to the OS that the current image is invalidated.
14/// 
15/// This table is only supported on UEFI systems.
16pub struct BootGraphicsResourceTable {
17    /// - **Signature** - "BGRT"
18    pub header: SDTHeader,
19    /// 2-bytes (16 bit) version ID. This value must be 1.
20    pub version: u16,
21    /// - **Bits [[7:3]]** - Reserved
22    /// - **Bits [[2:1]]** - Orientation Offset. These bits describe the clockwise degree offset from the image's default orientation.
23    ///   - **0b00** - 0, no offset
24    ///   - **0b01** - 90
25    ///   - **0b10** - 180
26    ///   - **0b11** - 270
27    /// - **Bit [[0]]** - Displayed. A one indicates the boot image graphic is displayed.
28    pub status: u8,
29    /// - **0x00** - Bitmap
30    /// 
31    /// The rest of the values are reserved.
32    pub image_type: u8,
33    /// 8-byte (64 bit) physical address pointing to the firmware’s in-memory copy of the image bitmap.
34    pub image_address: u64,
35    /// A 4-byte (32-bit) unsigned long describing the display X-offset of the boot image.
36    /// 
37    /// (X, Y) display offset of the top left corner of the boot image. The top left corner of the display is at offset (0, 0).
38    pub image_offset_x: u32,
39    /// A 4-byte (32-bit) unsigned long describing the display Y-offset of the boot image.
40    /// 
41    /// (X, Y) display offset of the top left corner of the boot image. The top left corner of the display is at offset (0, 0).
42    pub image_offset_y: u32,
43}