]>
git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/Python/FirmwareStorageFormat/FfsFileHeader.py
2 # This file is used to define the Ffs Header C Struct.
4 # Copyright (c) 2021-, Intel Corporation. All rights reserved.<BR>
5 # SPDX-License-Identifier: BSD-2-Clause-Patent
9 from FirmwareStorageFormat
.Common
import *
11 EFI_FFS_FILE_HEADER_LEN
= 24
12 EFI_FFS_FILE_HEADER2_LEN
= 32
14 class CHECK_SUM(Structure
):
21 class EFI_FFS_INTEGRITY_CHECK(Union
):
24 ('Checksum', CHECK_SUM
),
25 ('Checksum16', c_uint16
),
29 class EFI_FFS_FILE_HEADER(Structure
):
33 ('IntegrityCheck', EFI_FFS_INTEGRITY_CHECK
),
35 ('Attributes', c_uint8
),
36 ('Size', ARRAY(c_uint8
, 3)),
41 def FFS_FILE_SIZE(self
) -> int:
42 return self
.Size
[0] | self
.Size
[1] << 8 | self
.Size
[2] << 16
45 def HeaderLength(self
) -> int:
48 class EFI_FFS_FILE_HEADER2(Structure
):
52 ('IntegrityCheck', EFI_FFS_INTEGRITY_CHECK
),
54 ('Attributes', c_uint8
),
55 ('Size', ARRAY(c_uint8
, 3)),
57 ('ExtendedSize', c_uint64
),
61 def FFS_FILE_SIZE(self
) -> int:
62 return self
.ExtendedSize
65 def HeaderLength(self
) -> int: