]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkPkg/Include/Ppi/BootScriptExecuter.h
c98f3821ebd61bc78d6d3c09ade0447b2ed90b75
[mirror_edk2.git] / IntelFrameworkPkg / Include / Ppi / BootScriptExecuter.h
1 /** @file
2 This file declares Boot Script Executer PPI.
3
4 This PPI is published by a PEIM upon dispatch and provides an execution engine for the
5 Framework boot script. This PEIM should be platform neutral and have no specific knowledge of
6 platform instructions and other information. The ability to interpret the boot script depends on the
7 abundance of other PPIs that are available. For example, if the script requests an SMBus command
8 execution, the PEIM looks for a relevant PPI that is available to execute it, rather than executing it
9 by issuing the native IA-32 instruction.
10
11 Copyright (c) 2007, Intel Corporation
12 All rights reserved. This program and the accompanying materials
13 are licensed and made available under the terms and conditions of the BSD License
14 which accompanies this distribution. The full text of the license may be found at
15 http://opensource.org/licenses/bsd-license.php
16
17 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
18 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19
20 Module Name: BootScriptExecuter.h
21
22 @par Revision Reference:
23 This PPI is defined in Framework of EFI BootScript spec.
24 Version 0.91.
25
26 **/
27
28 #ifndef _PEI_BOOT_SCRIPT_EXECUTER_PPI_H_
29 #define _PEI_BOOT_SCRIPT_EXECUTER_PPI_H_
30
31 #include <PiPei.h>
32
33 #define EFI_ACPI_S3_RESUME_SCRIPT_TABLE 0x00
34
35 //
36 // Boot Script Opcode Definitions
37 //
38
39 #define EFI_BOOT_SCRIPT_IO_WRITE_OPCODE 0x00
40 #define EFI_BOOT_SCRIPT_IO_READ_WRITE_OPCODE 0x01
41 #define EFI_BOOT_SCRIPT_MEM_WRITE_OPCODE 0x02
42 #define EFI_BOOT_SCRIPT_MEM_READ_WRITE_OPCODE 0x03
43 #define EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE_OPCODE 0x04
44 #define EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE_OPCODE 0x05
45 #define EFI_BOOT_SCRIPT_SMBUS_EXECUTE_OPCODE 0x06
46 #define EFI_BOOT_SCRIPT_STALL_OPCODE 0x07
47 #define EFI_BOOT_SCRIPT_DISPATCH_OPCODE 0x08
48
49 //
50 // Extensions to boot script definitions
51 //
52 #define EFI_BOOT_SCRIPT_MEM_POLL_OPCODE 0x09
53 #define EFI_BOOT_SCRIPT_INFORMATION_OPCODE 0x0A
54 #define EFI_BOOT_SCRIPT_PCI_CONFIG2_WRITE_OPCODE 0x0B
55 #define EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE_OPCODE 0x0C
56 #define EFI_BOOT_SCRIPT_DISPATCH_2_OPCODE 0x0D
57 #define EFI_BOOT_SCRIPT_TABLE_OPCODE 0xAA
58 #define EFI_BOOT_SCRIPT_TERMINATE_OPCODE 0xFF
59
60 //
61 // EFI Boot Script Width
62 //
63 typedef enum {
64 EfiBootScriptWidthUint8,
65 EfiBootScriptWidthUint16,
66 EfiBootScriptWidthUint32,
67 EfiBootScriptWidthUint64,
68 EfiBootScriptWidthFifoUint8,
69 EfiBootScriptWidthFifoUint16,
70 EfiBootScriptWidthFifoUint32,
71 EfiBootScriptWidthFifoUint64,
72 EfiBootScriptWidthFillUint8,
73 EfiBootScriptWidthFillUint16,
74 EfiBootScriptWidthFillUint32,
75 EfiBootScriptWidthFillUint64,
76 EfiBootScriptWidthMaximum
77 } EFI_BOOT_SCRIPT_WIDTH;
78
79 #define EFI_PEI_BOOT_SCRIPT_EXECUTER_PPI_GUID \
80 { \
81 0xabd42895, 0x78cf, 0x4872, {0x84, 0x44, 0x1b, 0x5c, 0x18, 0x0b, 0xfb, 0xff } \
82 }
83
84 typedef struct _EFI_PEI_BOOT_SCRIPT_EXECUTER_PPI EFI_PEI_BOOT_SCRIPT_EXECUTER_PPI;
85
86 /**
87 Executes the Framework boot script table.
88
89 @param PeiServices A pointer to the system PEI Services Table.
90 @param This A pointer to the EFI_PEI_BOOT_SCRIPT_EXECUTER_PPI instance.
91 @param Address The physical memory address where the table is stored.
92 It must be zero if the table to be executed is stored in a firmware volume file.
93 @param FvFile The firmware volume file name that contains the table to
94 be executed. It must be NULL if the table to be executed is stored in physical memory.
95
96 @retval EFI_SUCCESS The boot script table was executed successfully.
97 @retval EFI_INVALID_PARAMETER Address is zero and FvFile is NULL.
98 @retval EFI_NOT_FOUND The file name specified in FvFile cannot be found.
99 @retval EFI_UNSUPPORTED The format of the boot script table is invalid.
100 Or An unsupported opcode occurred in the table.
101 Or There were opcode execution errors, such as an insufficient dependency.
102
103 **/
104 typedef
105 EFI_STATUS
106 (EFIAPI *EFI_PEI_BOOT_SCRIPT_EXECUTE) (
107 IN EFI_PEI_SERVICES **PeiServices,
108 IN EFI_PEI_BOOT_SCRIPT_EXECUTER_PPI *This,
109 IN EFI_PHYSICAL_ADDRESS Address,
110 IN EFI_GUID *FvFile OPTIONAL
111 );
112
113 /**
114 @par Ppi Description:
115 This PPI produces functions to interpret and execute the Framework boot script table.
116
117 @param Execute
118 Executes a boot script table.
119
120 **/
121 struct _EFI_PEI_BOOT_SCRIPT_EXECUTER_PPI {
122 EFI_PEI_BOOT_SCRIPT_EXECUTE Execute;
123 };
124
125 extern EFI_GUID gEfiPeiBootScriptExecuterPpiGuid;
126
127 #endif