]>
Commit | Line | Data |
---|---|---|
cf7e50f8 | 1 | /** @file\r |
4a71b21a | 2 | This protocol is used to prepare all information that is needed for the S3 resume boot path. This\r |
3 | protocol is not required for all platforms.\r | |
4a71b21a | 4 | \r |
534b8251 | 5 | Copyright (c) 2006 - 2009, Intel Corporation\r |
6 | All rights reserved. This program and the accompanying materials\r | |
7 | are licensed and made available under the terms and conditions of the BSD License\r | |
8 | which accompanies this distribution. The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php\r | |
8f23e4e6 | 10 | \r |
534b8251 | 11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
8f23e4e6 | 13 | \r |
534b8251 | 14 | @par Revision Reference:\r |
15 | This Protocol is defined in Framework of S3 Resume Boot Path Spec.\r | |
16 | Version 0.9.\r | |
17 | \r | |
cf7e50f8 | 18 | **/\r |
8f23e4e6 | 19 | \r |
4ebb0d9e | 20 | #ifndef _ACPI_S3_SAVE_PROTOCOL_H_\r |
21 | #define _ACPI_S3_SAVE_PROTOCOL_H_\r | |
8f23e4e6 | 22 | \r |
8f23e4e6 | 23 | //\r |
24 | // Forward reference for pure ANSI compatability\r | |
25 | //\r | |
26 | typedef struct _EFI_ACPI_S3_SAVE_PROTOCOL EFI_ACPI_S3_SAVE_PROTOCOL;\r | |
27 | \r | |
28 | //\r | |
29 | // S3 Save Protocol GUID\r | |
30 | //\r | |
31 | #define EFI_ACPI_S3_SAVE_GUID \\r | |
32 | { \\r | |
33 | 0x125f2de1, 0xfb85, 0x440c, {0xa5, 0x4c, 0x4d, 0x99, 0x35, 0x8a, 0x8d, 0x38 } \\r | |
34 | }\r | |
35 | \r | |
36 | //\r | |
37 | // Protocol Data Structures\r | |
38 | //\r | |
534b8251 | 39 | \r |
40 | /**\r | |
41 | This function returns the size of the legacy memory below 1 MB that is required during an S3\r | |
42 | resume. Before the Framework-based firmware transfers control to the OS, it has to transition from\r | |
43 | flat mode into real mode in case the OS supplies only a real-mode waking vector. This transition\r | |
44 | requires a certain amount of legacy memory below 1 MB. After getting the size of legacy memory\r | |
45 | below 1 MB, the caller is responsible for allocating the legacy memory below 1 MB according to\r | |
46 | the size that is returned. The specific implementation of allocating the legacy memory is out of the\r | |
47 | scope of this specification.\r | |
48 | \r | |
49 | @param This A pointer to the EFI_ACPI_S3_SAVE_PROTOCOL instance.\r | |
50 | @param LegacyMemoryAddress The returned size of legacy memory below 1MB.\r | |
51 | \r | |
52 | @retval EFI_SUCCESS Size is successfully returned.\r | |
53 | @retval EFI_INVALID_PARAMETER The pointer Size is NULL.\r | |
54 | \r | |
55 | **/\r | |
8f23e4e6 | 56 | typedef\r |
57 | EFI_STATUS\r | |
69686d56 | 58 | (EFIAPI *EFI_ACPI_S3_SAVE)(\r |
8f23e4e6 | 59 | IN EFI_ACPI_S3_SAVE_PROTOCOL * This,\r |
60 | IN VOID * LegacyMemoryAddress\r | |
61 | );\r | |
62 | \r | |
534b8251 | 63 | /**\r |
64 | This function is used to do the following:\r | |
65 | \r | |
66 | - Prepare all information that is needed in the S3 resume boot path. This information can include\r | |
67 | the following:\r | |
68 | -- Framework boot script table\r | |
69 | -- RSDT pointer\r | |
70 | -- Reserved memory for the S3 resume\r | |
71 | \r | |
72 | - Get the minimum memory length below 1 MB that is required for the S3 resume boot path.\r | |
73 | If LegacyMemoryAddress is NULL, the firmware will be unable to jump into a real-mode\r | |
74 | waking vector. However, it might still be able to jump into a flat-mode waking vector as long as the\r | |
b4420c36 | 75 | OS provides a flat-mode waking vector. It is the caller's responsibility to ensure the\r |
534b8251 | 76 | LegacyMemoryAddress is valid. If the LegacyMemoryAddress is higher than 1 MB,\r |
77 | EFI_INVALID_PARAMETER will be returned.\r | |
78 | \r | |
79 | @param This A pointer to the EFI_ACPI_S3_SAVE_PROTOCOL instance.\r | |
80 | @param LegacyMemoryAddress The base of legacy memory.\r | |
81 | \r | |
82 | @retval EFI_SUCCESS All information was saved successfully.\r | |
83 | @retval EFI_INVALID_PARAMETER The memory range is not located below 1 MB.\r | |
84 | @retval EFI_OUT_OF_RESOURCES Resources were insufficient to save all the information.\r | |
85 | @retval EFI_NOT_FOUND Some necessary information cannot be found.\r | |
86 | \r | |
87 | **/\r | |
8f23e4e6 | 88 | typedef\r |
89 | EFI_STATUS\r | |
69686d56 | 90 | (EFIAPI *EFI_ACPI_GET_LEGACY_MEMORY_SIZE)(\r |
8f23e4e6 | 91 | IN EFI_ACPI_S3_SAVE_PROTOCOL * This,\r |
92 | OUT UINTN * Size\r | |
93 | );\r | |
94 | \r | |
534b8251 | 95 | /**\r |
534b8251 | 96 | The EFI_ACPI_S3_SAVE_PROTOCOL is responsible for preparing all the information that the\r |
b4420c36 | 97 | Framework needs to restore the platform's preboot state during an S3 resume boot. This\r |
534b8251 | 98 | information can include the following:\r |
99 | - The Framework boot script table, containing all necessary operations to initialize the platform\r | |
100 | - ACPI table information, such as RSDT, through which the OS waking vector can be located\r | |
101 | - Range of reserved memory that can be used on the S3 resume boot path\r | |
102 | This protocol can be used after the Framework makes sure that the boot process is complete and\r | |
103 | that no hardware has been left unconfigured. It is implementation specific where to call this\r | |
104 | protocol to save all the information.\r | |
105 | In the case of an EFI-aware OS, ExitBootServices()can be a choice to provide this hook.\r | |
106 | The currently executing EFI OS loader image calls ExitBootServices()to terminate all boot\r | |
107 | services. After ExitBootServices() successfully completes, the loader becomes responsible\r | |
108 | for the continued operation of the system.\r | |
109 | On a normal boot, ExitBootServices() checks if the platform supports S3 by looking for\r | |
110 | EFI_ACPI_S3_SAVE_PROTOCOL. If the protocol exists, ExitBootServices()will assume\r | |
111 | that the target platform supports an S3 resume and then call EFI_ACPI_S3_SAVE_PROTOCOL\r | |
112 | to save the S3 resume information. The entire Framework boot script table will then be generated,\r | |
113 | assuming the platform currently is in the preboot state.\r | |
534b8251 | 114 | **/\r |
8f23e4e6 | 115 | struct _EFI_ACPI_S3_SAVE_PROTOCOL {\r |
2bbaeb0d | 116 | ///\r |
117 | /// Gets the size of legacy memory below 1 MB that is required for S3 resume.\r | |
118 | ///\r | |
8f23e4e6 | 119 | EFI_ACPI_GET_LEGACY_MEMORY_SIZE GetLegacyMemorySize;\r |
2bbaeb0d | 120 | \r |
121 | ///\r | |
122 | /// Prepare all information for an S3 resume.\r | |
123 | ///\r | |
8f23e4e6 | 124 | EFI_ACPI_S3_SAVE S3Save;\r |
125 | };\r | |
126 | \r | |
127 | extern EFI_GUID gEfiAcpiS3SaveProtocolGuid;\r | |
128 | \r | |
129 | #endif\r |