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