]>
Commit | Line | Data |
---|---|---|
5583a8a4 LE |
1 | /** @file\r |
2 | Macro and type definitions corresponding to the QEMU fw_cfg interface.\r | |
3 | \r | |
4 | Refer to "docs/specs/fw_cfg.txt" in the QEMU source directory.\r | |
5 | \r | |
6 | Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>\r | |
7 | Copyright (C) 2013 - 2017, Red Hat, Inc.\r | |
8 | \r | |
9 | This program and the accompanying materials are licensed and made available\r | |
10 | under the terms and conditions of the BSD License which accompanies this\r | |
11 | distribution. The full text of the license may be found at\r | |
12 | http://opensource.org/licenses/bsd-license.php\r | |
13 | \r | |
14 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT\r | |
15 | WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
16 | **/\r | |
17 | \r | |
18 | #ifndef __FW_CFG_H__\r | |
19 | #define __FW_CFG_H__\r | |
20 | \r | |
21 | #include <Base.h>\r | |
22 | \r | |
23 | //\r | |
24 | // The size, in bytes, of names of firmware configuration files, including at\r | |
25 | // least one terminating NUL byte.\r | |
26 | //\r | |
27 | #define QEMU_FW_CFG_FNAME_SIZE 56\r | |
28 | \r | |
29 | //\r | |
30 | // If the following bit is set in the UINT32 fw_cfg revision / feature bitmap\r | |
31 | // -- read from key 0x0001 with the basic IO Port or MMIO method --, then the\r | |
32 | // DMA interface is available.\r | |
33 | //\r | |
34 | #define FW_CFG_F_DMA BIT1\r | |
35 | \r | |
36 | //\r | |
37 | // Macros for the FW_CFG_DMA_ACCESS.Control bitmap (in native encoding).\r | |
38 | //\r | |
39 | #define FW_CFG_DMA_CTL_ERROR BIT0\r | |
40 | #define FW_CFG_DMA_CTL_READ BIT1\r | |
41 | #define FW_CFG_DMA_CTL_SKIP BIT2\r | |
42 | #define FW_CFG_DMA_CTL_SELECT BIT3\r | |
43 | #define FW_CFG_DMA_CTL_WRITE BIT4\r | |
44 | \r | |
21ca2f28 LE |
45 | //\r |
46 | // The fw_cfg registers can be found at these IO Ports, on the IO-mapped\r | |
47 | // platforms (Ia32 and X64).\r | |
48 | //\r | |
49 | #define FW_CFG_IO_SELECTOR 0x510\r | |
509e6b5a | 50 | #define FW_CFG_IO_DATA 0x511\r |
ed1a2d42 | 51 | #define FW_CFG_IO_DMA_ADDRESS 0x514\r |
21ca2f28 | 52 | \r |
5583a8a4 LE |
53 | //\r |
54 | // Numerically defined keys.\r | |
55 | //\r | |
56 | typedef enum {\r | |
57 | QemuFwCfgItemSignature = 0x0000,\r | |
58 | QemuFwCfgItemInterfaceVersion = 0x0001,\r | |
59 | QemuFwCfgItemSystemUuid = 0x0002,\r | |
60 | QemuFwCfgItemRamSize = 0x0003,\r | |
61 | QemuFwCfgItemGraphicsEnabled = 0x0004,\r | |
62 | QemuFwCfgItemSmpCpuCount = 0x0005,\r | |
63 | QemuFwCfgItemMachineId = 0x0006,\r | |
64 | QemuFwCfgItemKernelAddress = 0x0007,\r | |
65 | QemuFwCfgItemKernelSize = 0x0008,\r | |
66 | QemuFwCfgItemKernelCommandLine = 0x0009,\r | |
67 | QemuFwCfgItemInitrdAddress = 0x000a,\r | |
68 | QemuFwCfgItemInitrdSize = 0x000b,\r | |
69 | QemuFwCfgItemBootDevice = 0x000c,\r | |
70 | QemuFwCfgItemNumaData = 0x000d,\r | |
71 | QemuFwCfgItemBootMenu = 0x000e,\r | |
72 | QemuFwCfgItemMaximumCpuCount = 0x000f,\r | |
73 | QemuFwCfgItemKernelEntry = 0x0010,\r | |
74 | QemuFwCfgItemKernelData = 0x0011,\r | |
75 | QemuFwCfgItemInitrdData = 0x0012,\r | |
76 | QemuFwCfgItemCommandLineAddress = 0x0013,\r | |
77 | QemuFwCfgItemCommandLineSize = 0x0014,\r | |
78 | QemuFwCfgItemCommandLineData = 0x0015,\r | |
79 | QemuFwCfgItemKernelSetupAddress = 0x0016,\r | |
80 | QemuFwCfgItemKernelSetupSize = 0x0017,\r | |
81 | QemuFwCfgItemKernelSetupData = 0x0018,\r | |
82 | QemuFwCfgItemFileDir = 0x0019,\r | |
83 | \r | |
84 | QemuFwCfgItemX86AcpiTables = 0x8000,\r | |
85 | QemuFwCfgItemX86SmbiosTables = 0x8001,\r | |
86 | QemuFwCfgItemX86Irq0Override = 0x8002,\r | |
87 | QemuFwCfgItemX86E820Table = 0x8003,\r | |
88 | QemuFwCfgItemX86HpetData = 0x8004,\r | |
89 | \r | |
90 | } FIRMWARE_CONFIG_ITEM;\r | |
91 | \r | |
92 | //\r | |
93 | // Communication structure for the DMA access method. All fields are encoded in\r | |
94 | // big endian.\r | |
95 | //\r | |
96 | #pragma pack (1)\r | |
97 | typedef struct {\r | |
98 | UINT32 Control;\r | |
99 | UINT32 Length;\r | |
100 | UINT64 Address;\r | |
101 | } FW_CFG_DMA_ACCESS;\r | |
102 | #pragma pack ()\r | |
103 | \r | |
104 | #endif\r |