1 /** @file 2 This file declares the internal Framework Boot Script format used by 3 the PI implementation of Script Saver and Executor. 4 5 Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR> 6 7 This program and the accompanying materials 8 are licensed and made available under the terms and conditions 9 of the BSD License which accompanies this distribution. The 10 full text of the license may be found at 11 http://opensource.org/licenses/bsd-license.php 12 13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 15 16 **/ 17 18 #ifndef _BOOT_SCRIPT_INTERNAL_FORMAT_H_ 19 #define _BOOT_SCRIPT_INTERNAL_FORMAT_H_ 20 21 #pragma pack(1) 22 23 // 24 // Boot Script Opcode Header Structure Definitions 25 // 26 27 typedef struct { 28 UINT16 OpCode; 29 UINT8 Length; 30 } EFI_BOOT_SCRIPT_GENERIC_HEADER; 31 32 typedef struct { 33 UINT16 OpCode; 34 UINT8 Length; 35 UINT16 Version; 36 UINT32 TableLength; 37 UINT16 Reserved[2]; 38 } EFI_BOOT_SCRIPT_TABLE_HEADER; 39 40 typedef struct { 41 UINT16 OpCode; 42 UINT8 Length; 43 UINT32 Width; 44 } EFI_BOOT_SCRIPT_COMMON_HEADER; 45 46 typedef struct { 47 UINT16 OpCode; 48 UINT8 Length; 49 UINT32 Width; 50 UINT32 Count; 51 UINT64 Address; 52 } EFI_BOOT_SCRIPT_IO_WRITE; 53 54 typedef struct { 55 UINT16 OpCode; 56 UINT8 Length; 57 UINT32 Width; 58 UINT64 Address; 59 } EFI_BOOT_SCRIPT_IO_READ_WRITE; 60 61 typedef struct { 62 UINT16 OpCode; 63 UINT8 Length; 64 UINT32 Width; 65 UINT32 Count; 66 UINT64 Address; 67 } EFI_BOOT_SCRIPT_MEM_WRITE; 68 69 typedef struct { 70 UINT16 OpCode; 71 UINT8 Length; 72 UINT32 Width; 73 UINT64 Address; 74 } EFI_BOOT_SCRIPT_MEM_READ_WRITE; 75 76 typedef struct { 77 UINT16 OpCode; 78 UINT8 Length; 79 UINT32 Width; 80 UINT32 Count; 81 UINT64 Address; 82 } EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE; 83 84 typedef struct { 85 UINT16 OpCode; 86 UINT8 Length; 87 UINT32 Width; 88 UINT32 Count; 89 UINT64 Address; 90 UINT16 Segment; 91 } EFI_BOOT_SCRIPT_PCI_CONFIG2_WRITE; 92 93 typedef struct { 94 UINT16 OpCode; 95 UINT8 Length; 96 UINT32 Width; 97 UINT64 Address; 98 } EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE; 99 100 typedef struct { 101 UINT16 OpCode; 102 UINT8 Length; 103 UINT32 Width; 104 UINT64 Address; 105 UINT16 Segment; 106 } EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE; 107 108 typedef struct { 109 UINT16 OpCode; 110 UINT8 Length; 111 UINT64 SmBusAddress; 112 UINT32 Operation; 113 UINT32 DataSize; 114 } EFI_BOOT_SCRIPT_SMBUS_EXECUTE; 115 116 typedef struct { 117 UINT16 OpCode; 118 UINT8 Length; 119 UINT64 Duration; 120 } EFI_BOOT_SCRIPT_STALL; 121 122 typedef struct { 123 UINT16 OpCode; 124 UINT8 Length; 125 EFI_PHYSICAL_ADDRESS EntryPoint; 126 } EFI_BOOT_SCRIPT_DISPATCH; 127 128 typedef struct { 129 UINT16 OpCode; 130 UINT8 Length; 131 EFI_PHYSICAL_ADDRESS EntryPoint; 132 EFI_PHYSICAL_ADDRESS Context; 133 } EFI_BOOT_SCRIPT_DISPATCH_2; 134 135 typedef struct { 136 UINT16 OpCode; 137 UINT8 Length; 138 UINT32 Width; 139 UINT64 Address; 140 UINT64 Duration; 141 UINT64 LoopTimes; 142 } EFI_BOOT_SCRIPT_MEM_POLL; 143 144 typedef struct { 145 UINT16 OpCode; 146 UINT8 Length; 147 UINT32 InformationLength; 148 // UINT8 InformationData[InformationLength]; 149 } EFI_BOOT_SCRIPT_INFORMATION; 150 151 typedef struct { 152 UINT16 OpCode; 153 UINT8 Length; 154 UINT32 Width; 155 UINT64 Address; 156 UINT64 Delay; 157 } EFI_BOOT_SCRIPT_IO_POLL; 158 159 typedef struct { 160 UINT16 OpCode; 161 UINT8 Length; 162 UINT32 Width; 163 UINT64 Address; 164 UINT64 Delay; 165 } EFI_BOOT_SCRIPT_PCI_CONFIG_POLL; 166 167 typedef struct { 168 UINT16 OpCode; 169 UINT8 Length; 170 UINT32 Width; 171 UINT64 Address; 172 UINT16 Segment; 173 UINT64 Delay; 174 } EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL; 175 176 typedef struct { 177 UINT16 OpCode; 178 UINT8 Length; 179 } EFI_BOOT_SCRIPT_TERMINATE; 180 181 182 #pragma pack() 183 184 #define BOOT_SCRIPT_NODE_MAX_LENGTH 1024 185 186 #define BOOT_SCRIPT_TABLE_VERSION 0x0001 187 188 #endif 189