1 | /* $Id: efi-fat.h 93115 2022-01-01 11:31:46Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * IPRT, EFI FAT Binary (used by Apple, contains multiple architectures).
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2019-2022 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | *
|
---|
17 | * The contents of this file may alternatively be used under the terms
|
---|
18 | * of the Common Development and Distribution License Version 1.0
|
---|
19 | * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
20 | * VirtualBox OSE distribution, in which case the provisions of the
|
---|
21 | * CDDL are applicable instead of those of the GPL.
|
---|
22 | *
|
---|
23 | * You may elect to license modified versions of this file under the
|
---|
24 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
25 | */
|
---|
26 |
|
---|
27 | #ifndef IPRT_INCLUDED_formats_efi_fat_h
|
---|
28 | #define IPRT_INCLUDED_formats_efi_fat_h
|
---|
29 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
30 | # pragma once
|
---|
31 | #endif
|
---|
32 |
|
---|
33 | #include <iprt/types.h>
|
---|
34 | #include <iprt/assertcompile.h>
|
---|
35 |
|
---|
36 | /*
|
---|
37 | * Definitions come from http://refit.sourceforge.net/info/fat_binary.html
|
---|
38 | */
|
---|
39 |
|
---|
40 | /**
|
---|
41 | * The header structure.
|
---|
42 | */
|
---|
43 | typedef struct EFI_FATHDR
|
---|
44 | {
|
---|
45 | /** The magic identifying the header .*/
|
---|
46 | uint32_t u32Magic;
|
---|
47 | /** Number of files (one per architecture) embedded into the file. */
|
---|
48 | uint32_t cFilesEmbedded;
|
---|
49 | } EFI_FATHDR;
|
---|
50 | AssertCompileSize(EFI_FATHDR, 8);
|
---|
51 | typedef EFI_FATHDR *PEFI_FATHDR;
|
---|
52 |
|
---|
53 | /** The magic identifying a FAT header. */
|
---|
54 | #define EFI_FATHDR_MAGIC UINT32_C(0x0ef1fab9)
|
---|
55 |
|
---|
56 | /**
|
---|
57 | * The direcory entry.
|
---|
58 | */
|
---|
59 | typedef struct EFI_FATDIRENTRY
|
---|
60 | {
|
---|
61 | /** The CPU type the referenced file is for. */
|
---|
62 | uint32_t u32CpuType;
|
---|
63 | /** The CPU sub-type the referenced file is for. */
|
---|
64 | uint32_t u32CpuSubType;
|
---|
65 | /** Offset in bytes where the file is located. */
|
---|
66 | uint32_t u32OffsetStart;
|
---|
67 | /** Length of the file in bytes. */
|
---|
68 | uint32_t cbFile;
|
---|
69 | /** Alignment used for the file. */
|
---|
70 | uint32_t u32Alignment;
|
---|
71 | } EFI_FATDIRENTRY;
|
---|
72 | AssertCompileSize(EFI_FATDIRENTRY, 20);
|
---|
73 | typedef EFI_FATDIRENTRY *PEFI_FATDIRENTRY;
|
---|
74 |
|
---|
75 | #define EFI_FATDIRENTRY_CPU_TYPE_X86 UINT32_C(0x7)
|
---|
76 | #define EFI_FATDIRENTRY_CPU_TYPE_AMD64 UINT32_C(0x01000007)
|
---|
77 |
|
---|
78 | #define EFI_FATDIRENTRY_CPU_SUB_TYPE_GENERIC UINT32_C(0x3)
|
---|
79 |
|
---|
80 |
|
---|
81 | #endif /* !IPRT_INCLUDED_formats_efi_fat_h */
|
---|
82 |
|
---|