2 This is an implementation of the ACPI S3 Save protocol. This is defined in
3 S3 boot path specification 0.9.
5 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
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
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.
18 #ifndef _ACPI_S3_SAVE_H_
19 #define _ACPI_S3_SAVE_H_
35 UINT32 DefaultSize
: 1;
36 UINT32 Granularity
: 1;
43 IA32_IDT_GATE_DESCRIPTOR Ia32IdtEntry
;
46 } X64_IDT_GATE_DESCRIPTOR
;
49 // Page-Map Level-4 Offset (PML4) and
50 // Page-Directory-Pointer Offset (PDPE) entries 4K & 2MB
55 UINT64 Present
:1; // 0 = Not present in memory, 1 = Present in memory
56 UINT64 ReadWrite
:1; // 0 = Read-Only, 1= Read/Write
57 UINT64 UserSupervisor
:1; // 0 = Supervisor, 1=User
58 UINT64 WriteThrough
:1; // 0 = Write-Back caching, 1=Write-Through caching
59 UINT64 CacheDisabled
:1; // 0 = Cached, 1=Non-Cached
60 UINT64 Accessed
:1; // 0 = Not accessed, 1 = Accessed (set by CPU)
61 UINT64 Reserved
:1; // Reserved
62 UINT64 MustBeZero
:2; // Must Be Zero
63 UINT64 Available
:3; // Available for use by system software
64 UINT64 PageTableBaseAddress
:40; // Page Table Base Address
65 UINT64 AvabilableHigh
:11; // Available for use by system software
66 UINT64 Nx
:1; // No Execute bit
69 } PAGE_MAP_AND_DIRECTORY_POINTER
;
72 // Page Table Entry 2MB
76 UINT64 Present
:1; // 0 = Not present in memory, 1 = Present in memory
77 UINT64 ReadWrite
:1; // 0 = Read-Only, 1= Read/Write
78 UINT64 UserSupervisor
:1; // 0 = Supervisor, 1=User
79 UINT64 WriteThrough
:1; // 0 = Write-Back caching, 1=Write-Through caching
80 UINT64 CacheDisabled
:1; // 0 = Cached, 1=Non-Cached
81 UINT64 Accessed
:1; // 0 = Not accessed, 1 = Accessed (set by CPU)
82 UINT64 Dirty
:1; // 0 = Not Dirty, 1 = written by processor on access to page
83 UINT64 MustBe1
:1; // Must be 1
84 UINT64 Global
:1; // 0 = Not global page, 1 = global page TLB not cleared on CR3 write
85 UINT64 Available
:3; // Available for use by system software
87 UINT64 MustBeZero
:8; // Must be zero;
88 UINT64 PageTableBaseAddress
:31; // Page Table Base Address
89 UINT64 AvabilableHigh
:11; // Available for use by system software
90 UINT64 Nx
:1; // 0 = Execute Code, 1 = No Code Execution
98 Gets the buffer of legacy memory below 1 MB
99 This function is to get the buffer in legacy memory below 1MB that is required during S3 resume.
101 @param This A pointer to the EFI_ACPI_S3_SAVE_PROTOCOL instance.
102 @param Size The returned size of legacy memory below 1 MB.
104 @retval EFI_SUCCESS Size is successfully returned.
105 @retval EFI_INVALID_PARAMETER The pointer Size is NULL.
110 LegacyGetS3MemorySize (
111 IN EFI_ACPI_S3_SAVE_PROTOCOL
* This
,
116 Prepares all information that is needed in the S3 resume boot path.
118 Allocate the resources or prepare informations and save in ACPI variable set for S3 resume boot path
120 @param This A pointer to the EFI_ACPI_S3_SAVE_PROTOCOL instance.
121 @param LegacyMemoryAddress The base address of legacy memory.
123 @retval EFI_NOT_FOUND Some necessary information cannot be found.
124 @retval EFI_SUCCESS All information was saved successfully.
125 @retval EFI_OUT_OF_RESOURCES Resources were insufficient to save all the information.
126 @retval EFI_INVALID_PARAMETER The memory range is not located below 1 MB.
132 IN EFI_ACPI_S3_SAVE_PROTOCOL
*This
,
133 IN VOID
*LegacyMemoryAddress