]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/AcpiS3SaveDxe/AcpiS3Save.c
OvmfPkg: PlatformDxe: add an empty HII form
[mirror_edk2.git] / OvmfPkg / AcpiS3SaveDxe / AcpiS3Save.c
1 /** @file
2 This is an implementation of the ACPI S3 Save protocol. This is defined in
3 S3 boot path specification 0.9.
4
5 Copyright (c) 2006 - 2013, 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 #include <PiDxe.h>
19 #include <Library/BaseLib.h>
20 #include <Library/BaseMemoryLib.h>
21 #include <Library/UefiBootServicesTableLib.h>
22 #include <Library/UefiRuntimeServicesTableLib.h>
23 #include <Library/HobLib.h>
24 #include <Library/LockBoxLib.h>
25 #include <Library/PcdLib.h>
26 #include <Library/DebugLib.h>
27 #include <Guid/AcpiVariableCompatibility.h>
28 #include <Guid/AcpiS3Context.h>
29 #include <Guid/Acpi.h>
30 #include <Protocol/AcpiS3Save.h>
31 #include <Protocol/S3SaveState.h>
32 #include <Protocol/DxeSmmReadyToLock.h>
33 #include <Protocol/LockBox.h>
34 #include <IndustryStandard/Acpi.h>
35
36 #include "AcpiS3Save.h"
37
38 UINTN mLegacyRegionSize;
39
40 EFI_ACPI_S3_SAVE_PROTOCOL mS3Save = {
41 LegacyGetS3MemorySize,
42 S3Ready,
43 };
44
45 EFI_GUID mAcpiS3IdtrProfileGuid = {
46 0xdea652b0, 0xd587, 0x4c54, { 0xb5, 0xb4, 0xc6, 0x82, 0xe7, 0xa0, 0xaa, 0x3d }
47 };
48
49 /**
50 Allocate memory below 4G memory address.
51
52 This function allocates memory below 4G memory address.
53
54 @param MemoryType Memory type of memory to allocate.
55 @param Size Size of memory to allocate.
56
57 @return Allocated address for output.
58
59 **/
60 VOID*
61 AllocateMemoryBelow4G (
62 IN EFI_MEMORY_TYPE MemoryType,
63 IN UINTN Size
64 )
65 {
66 UINTN Pages;
67 EFI_PHYSICAL_ADDRESS Address;
68 EFI_STATUS Status;
69 VOID* Buffer;
70
71 Pages = EFI_SIZE_TO_PAGES (Size);
72 Address = 0xffffffff;
73
74 Status = gBS->AllocatePages (
75 AllocateMaxAddress,
76 MemoryType,
77 Pages,
78 &Address
79 );
80 ASSERT_EFI_ERROR (Status);
81
82 Buffer = (VOID *) (UINTN) Address;
83 ZeroMem (Buffer, Size);
84
85 return Buffer;
86 }
87
88 /**
89
90 This function scan ACPI table in RSDT.
91
92 @param Rsdt ACPI RSDT
93 @param Signature ACPI table signature
94
95 @return ACPI table
96
97 **/
98 VOID *
99 ScanTableInRSDT (
100 IN EFI_ACPI_DESCRIPTION_HEADER *Rsdt,
101 IN UINT32 Signature
102 )
103 {
104 UINTN Index;
105 UINT32 EntryCount;
106 UINT32 *EntryPtr;
107 EFI_ACPI_DESCRIPTION_HEADER *Table;
108
109 if (Rsdt == NULL) {
110 return NULL;
111 }
112
113 EntryCount = (Rsdt->Length - sizeof (EFI_ACPI_DESCRIPTION_HEADER)) / sizeof(UINT32);
114
115 EntryPtr = (UINT32 *)(Rsdt + 1);
116 for (Index = 0; Index < EntryCount; Index ++, EntryPtr ++) {
117 Table = (EFI_ACPI_DESCRIPTION_HEADER *)((UINTN)(*EntryPtr));
118 if (Table->Signature == Signature) {
119 return Table;
120 }
121 }
122
123 return NULL;
124 }
125
126 /**
127
128 This function scan ACPI table in XSDT.
129
130 @param Xsdt ACPI XSDT
131 @param Signature ACPI table signature
132
133 @return ACPI table
134
135 **/
136 VOID *
137 ScanTableInXSDT (
138 IN EFI_ACPI_DESCRIPTION_HEADER *Xsdt,
139 IN UINT32 Signature
140 )
141 {
142 UINTN Index;
143 UINT32 EntryCount;
144 UINT64 EntryPtr;
145 UINTN BasePtr;
146 EFI_ACPI_DESCRIPTION_HEADER *Table;
147
148 if (Xsdt == NULL) {
149 return NULL;
150 }
151
152 EntryCount = (Xsdt->Length - sizeof (EFI_ACPI_DESCRIPTION_HEADER)) / sizeof(UINT64);
153
154 BasePtr = (UINTN)(Xsdt + 1);
155 for (Index = 0; Index < EntryCount; Index ++) {
156 CopyMem (&EntryPtr, (VOID *)(BasePtr + Index * sizeof(UINT64)), sizeof(UINT64));
157 Table = (EFI_ACPI_DESCRIPTION_HEADER *)((UINTN)(EntryPtr));
158 if (Table->Signature == Signature) {
159 return Table;
160 }
161 }
162
163 return NULL;
164 }
165
166 /**
167 To find Facs in FADT.
168
169 @param Fadt FADT table pointer
170
171 @return Facs table pointer.
172 **/
173 EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *
174 FindAcpiFacsFromFadt (
175 IN EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE *Fadt
176 )
177 {
178 EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *Facs;
179 UINT64 Data64;
180
181 if (Fadt == NULL) {
182 return NULL;
183 }
184
185 if (Fadt->Header.Revision < EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION) {
186 Facs = (EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *)(UINTN)Fadt->FirmwareCtrl;
187 } else {
188 if (Fadt->FirmwareCtrl != 0) {
189 Facs = (EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *)(UINTN)Fadt->FirmwareCtrl;
190 } else {
191 CopyMem (&Data64, &Fadt->XFirmwareCtrl, sizeof(UINT64));
192 Facs = (EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *)(UINTN)Data64;
193 }
194 }
195 return Facs;
196 }
197
198 /**
199 To find Facs in Acpi tables.
200
201 To find Firmware ACPI control strutcure in Acpi Tables since the S3 waking vector is stored
202 in the table.
203
204 @param AcpiTableGuid The guid used to find ACPI table in UEFI ConfigurationTable.
205
206 @return Facs table pointer.
207 **/
208 EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *
209 FindAcpiFacsTableByAcpiGuid (
210 IN EFI_GUID *AcpiTableGuid
211 )
212 {
213 EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER *Rsdp;
214 EFI_ACPI_DESCRIPTION_HEADER *Rsdt;
215 EFI_ACPI_DESCRIPTION_HEADER *Xsdt;
216 EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE *Fadt;
217 EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *Facs;
218 UINTN Index;
219
220 Rsdp = NULL;
221 //
222 // found ACPI table RSD_PTR from system table
223 //
224 for (Index = 0; Index < gST->NumberOfTableEntries; Index++) {
225 if (CompareGuid (&(gST->ConfigurationTable[Index].VendorGuid), AcpiTableGuid)) {
226 //
227 // A match was found.
228 //
229 Rsdp = gST->ConfigurationTable[Index].VendorTable;
230 break;
231 }
232 }
233
234 if (Rsdp == NULL) {
235 return NULL;
236 }
237
238 //
239 // Search XSDT
240 //
241 if (Rsdp->Revision >= EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION) {
242 Xsdt = (EFI_ACPI_DESCRIPTION_HEADER *)(UINTN) Rsdp->XsdtAddress;
243 Fadt = ScanTableInXSDT (Xsdt, EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE);
244 if (Fadt != NULL) {
245 Facs = FindAcpiFacsFromFadt (Fadt);
246 if (Facs != NULL) {
247 return Facs;
248 }
249 }
250 }
251
252 //
253 // Search RSDT
254 //
255 Rsdt = (EFI_ACPI_DESCRIPTION_HEADER *)(UINTN) Rsdp->RsdtAddress;
256 Fadt = ScanTableInRSDT (Rsdt, EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE);
257 if (Fadt != NULL) {
258 Facs = FindAcpiFacsFromFadt (Fadt);
259 if (Facs != NULL) {
260 return Facs;
261 }
262 }
263
264 return NULL;
265 }
266
267 /**
268 To find Facs in Acpi tables.
269
270 To find Firmware ACPI control strutcure in Acpi Tables since the S3 waking vector is stored
271 in the table.
272
273 @return Facs table pointer.
274 **/
275 EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *
276 FindAcpiFacsTable (
277 VOID
278 )
279 {
280 EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *Facs;
281
282 Facs = FindAcpiFacsTableByAcpiGuid (&gEfiAcpi20TableGuid);
283 if (Facs != NULL) {
284 return Facs;
285 }
286
287 return FindAcpiFacsTableByAcpiGuid (&gEfiAcpi10TableGuid);
288 }
289
290 /**
291 Allocates and fills in the Page Directory and Page Table Entries to
292 establish a 1:1 Virtual to Physical mapping.
293 If BootScriptExector driver will run in 64-bit mode, this function will establish the 1:1
294 virtual to physical mapping page table.
295 If BootScriptExector driver will not run in 64-bit mode, this function will do nothing.
296
297 @return the 1:1 Virtual to Physical identity mapping page table base address.
298
299 **/
300 EFI_PHYSICAL_ADDRESS
301 S3CreateIdentityMappingPageTables (
302 VOID
303 )
304 {
305 if (FeaturePcdGet (PcdDxeIplSwitchToLongMode)) {
306 UINT32 RegEax;
307 UINT32 RegEdx;
308 UINT8 PhysicalAddressBits;
309 UINT32 NumberOfPml4EntriesNeeded;
310 UINT32 NumberOfPdpEntriesNeeded;
311 EFI_PHYSICAL_ADDRESS S3NvsPageTableAddress;
312 UINTN TotalPageTableSize;
313 VOID *Hob;
314 BOOLEAN Page1GSupport;
315
316 Page1GSupport = FALSE;
317 if (PcdGetBool(PcdUse1GPageTable)) {
318 AsmCpuid (0x80000000, &RegEax, NULL, NULL, NULL);
319 if (RegEax >= 0x80000001) {
320 AsmCpuid (0x80000001, NULL, NULL, NULL, &RegEdx);
321 if ((RegEdx & BIT26) != 0) {
322 Page1GSupport = TRUE;
323 }
324 }
325 }
326
327 //
328 // Get physical address bits supported.
329 //
330 Hob = GetFirstHob (EFI_HOB_TYPE_CPU);
331 if (Hob != NULL) {
332 PhysicalAddressBits = ((EFI_HOB_CPU *) Hob)->SizeOfMemorySpace;
333 } else {
334 AsmCpuid (0x80000000, &RegEax, NULL, NULL, NULL);
335 if (RegEax >= 0x80000008) {
336 AsmCpuid (0x80000008, &RegEax, NULL, NULL, NULL);
337 PhysicalAddressBits = (UINT8) RegEax;
338 } else {
339 PhysicalAddressBits = 36;
340 }
341 }
342
343 //
344 // IA-32e paging translates 48-bit linear addresses to 52-bit physical addresses.
345 //
346 ASSERT (PhysicalAddressBits <= 52);
347 if (PhysicalAddressBits > 48) {
348 PhysicalAddressBits = 48;
349 }
350
351 //
352 // Calculate the table entries needed.
353 //
354 if (PhysicalAddressBits <= 39 ) {
355 NumberOfPml4EntriesNeeded = 1;
356 NumberOfPdpEntriesNeeded = (UINT32)LShiftU64 (1, (PhysicalAddressBits - 30));
357 } else {
358 NumberOfPml4EntriesNeeded = (UINT32)LShiftU64 (1, (PhysicalAddressBits - 39));
359 NumberOfPdpEntriesNeeded = 512;
360 }
361
362 //
363 // We need calculate whole page size then allocate once, because S3 restore page table does not know each page in Nvs.
364 //
365 if (!Page1GSupport) {
366 TotalPageTableSize = (UINTN)(1 + NumberOfPml4EntriesNeeded + NumberOfPml4EntriesNeeded * NumberOfPdpEntriesNeeded);
367 } else {
368 TotalPageTableSize = (UINTN)(1 + NumberOfPml4EntriesNeeded);
369 }
370 DEBUG ((EFI_D_ERROR, "TotalPageTableSize - %x pages\n", TotalPageTableSize));
371
372 //
373 // By architecture only one PageMapLevel4 exists - so lets allocate storage for it.
374 //
375 S3NvsPageTableAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)AllocateMemoryBelow4G (EfiReservedMemoryType, EFI_PAGES_TO_SIZE(TotalPageTableSize));
376 ASSERT (S3NvsPageTableAddress != 0);
377 return S3NvsPageTableAddress;
378 } else {
379 //
380 // If DXE is running 32-bit mode, no need to establish page table.
381 //
382 return (EFI_PHYSICAL_ADDRESS) 0;
383 }
384 }
385
386 /**
387 Gets the buffer of legacy memory below 1 MB
388 This function is to get the buffer in legacy memory below 1MB that is required during S3 resume.
389
390 @param This A pointer to the EFI_ACPI_S3_SAVE_PROTOCOL instance.
391 @param Size The returned size of legacy memory below 1 MB.
392
393 @retval EFI_SUCCESS Size is successfully returned.
394 @retval EFI_INVALID_PARAMETER The pointer Size is NULL.
395
396 **/
397 EFI_STATUS
398 EFIAPI
399 LegacyGetS3MemorySize (
400 IN EFI_ACPI_S3_SAVE_PROTOCOL *This,
401 OUT UINTN *Size
402 )
403 {
404 if (Size == NULL) {
405 return EFI_INVALID_PARAMETER;
406 }
407
408 *Size = mLegacyRegionSize;
409 return EFI_SUCCESS;
410 }
411
412 /**
413 Save the S3 boot script.
414
415 Note that we trigger DxeSmmReadyToLock here -- otherwise the script wouldn't
416 be saved actually. Triggering this protocol installation event in turn locks
417 down SMM, so no further changes to LockBoxes or SMRAM are possible
418 afterwards.
419 **/
420 STATIC
421 VOID
422 EFIAPI
423 SaveS3BootScript (
424 VOID
425 )
426 {
427 EFI_STATUS Status;
428 EFI_S3_SAVE_STATE_PROTOCOL *BootScript;
429 EFI_HANDLE Handle;
430 STATIC CONST UINT8 Info[] = { 0xDE, 0xAD, 0xBE, 0xEF };
431
432 Status = gBS->LocateProtocol (&gEfiS3SaveStateProtocolGuid, NULL,
433 (VOID **) &BootScript);
434 ASSERT_EFI_ERROR (Status);
435
436 //
437 // Despite the opcode documentation in the PI spec, the protocol
438 // implementation embeds a deep copy of the info in the boot script, rather
439 // than storing just a pointer to runtime or NVS storage.
440 //
441 Status = BootScript->Write(BootScript, EFI_BOOT_SCRIPT_INFORMATION_OPCODE,
442 (UINT32) sizeof Info,
443 (EFI_PHYSICAL_ADDRESS)(UINTN) &Info);
444 ASSERT_EFI_ERROR (Status);
445
446 Handle = NULL;
447 Status = gBS->InstallProtocolInterface (&Handle,
448 &gEfiDxeSmmReadyToLockProtocolGuid, EFI_NATIVE_INTERFACE,
449 NULL);
450 ASSERT_EFI_ERROR (Status);
451 }
452
453
454 /**
455 Prepares all information that is needed in the S3 resume boot path.
456
457 Allocate the resources or prepare informations and save in ACPI variable set for S3 resume boot path
458
459 @param This A pointer to the EFI_ACPI_S3_SAVE_PROTOCOL instance.
460 @param LegacyMemoryAddress The base address of legacy memory.
461
462 @retval EFI_NOT_FOUND Some necessary information cannot be found.
463 @retval EFI_SUCCESS All information was saved successfully.
464 @retval EFI_OUT_OF_RESOURCES Resources were insufficient to save all the information.
465 @retval EFI_INVALID_PARAMETER The memory range is not located below 1 MB.
466
467 **/
468 EFI_STATUS
469 EFIAPI
470 S3Ready (
471 IN EFI_ACPI_S3_SAVE_PROTOCOL *This,
472 IN VOID *LegacyMemoryAddress
473 )
474 {
475 EFI_STATUS Status;
476 EFI_PHYSICAL_ADDRESS AcpiS3ContextBuffer;
477 ACPI_S3_CONTEXT *AcpiS3Context;
478 STATIC BOOLEAN AlreadyEntered;
479 IA32_DESCRIPTOR *Idtr;
480 IA32_IDT_GATE_DESCRIPTOR *IdtGate;
481
482 DEBUG ((EFI_D_INFO, "S3Ready!\n"));
483
484 //
485 // Platform may invoke AcpiS3Save->S3Save() before ExitPmAuth, because we need save S3 information there, while BDS ReadyToBoot may invoke it again.
486 // So if 2nd S3Save() is triggered later, we need ignore it.
487 //
488 if (AlreadyEntered) {
489 return EFI_SUCCESS;
490 }
491 AlreadyEntered = TRUE;
492
493 AcpiS3Context = AllocateMemoryBelow4G (EfiReservedMemoryType, sizeof(*AcpiS3Context));
494 ASSERT (AcpiS3Context != NULL);
495 AcpiS3ContextBuffer = (EFI_PHYSICAL_ADDRESS)(UINTN)AcpiS3Context;
496
497 //
498 // Get ACPI Table because we will save its position to variable
499 //
500 AcpiS3Context->AcpiFacsTable = (EFI_PHYSICAL_ADDRESS)(UINTN)FindAcpiFacsTable ();
501 ASSERT (AcpiS3Context->AcpiFacsTable != 0);
502
503 IdtGate = AllocateMemoryBelow4G (EfiReservedMemoryType, sizeof(IA32_IDT_GATE_DESCRIPTOR) * 0x100 + sizeof(IA32_DESCRIPTOR));
504 Idtr = (IA32_DESCRIPTOR *)(IdtGate + 0x100);
505 Idtr->Base = (UINTN)IdtGate;
506 Idtr->Limit = (UINT16)(sizeof(IA32_IDT_GATE_DESCRIPTOR) * 0x100 - 1);
507 AcpiS3Context->IdtrProfile = (EFI_PHYSICAL_ADDRESS)(UINTN)Idtr;
508
509 Status = SaveLockBox (
510 &mAcpiS3IdtrProfileGuid,
511 (VOID *)(UINTN)Idtr,
512 (UINTN)sizeof(IA32_DESCRIPTOR)
513 );
514 ASSERT_EFI_ERROR (Status);
515
516 Status = SetLockBoxAttributes (&mAcpiS3IdtrProfileGuid, LOCK_BOX_ATTRIBUTE_RESTORE_IN_PLACE);
517 ASSERT_EFI_ERROR (Status);
518
519 //
520 // Allocate page table
521 //
522 AcpiS3Context->S3NvsPageTableAddress = S3CreateIdentityMappingPageTables ();
523
524 //
525 // Allocate stack
526 //
527 AcpiS3Context->BootScriptStackSize = PcdGet32 (PcdS3BootScriptStackSize);
528 AcpiS3Context->BootScriptStackBase = (EFI_PHYSICAL_ADDRESS)(UINTN)AllocateMemoryBelow4G (EfiReservedMemoryType, PcdGet32 (PcdS3BootScriptStackSize));
529 ASSERT (AcpiS3Context->BootScriptStackBase != 0);
530
531 //
532 // Allocate a code buffer < 4G for S3 debug to load external code, set invalid code instructions in it.
533 //
534 AcpiS3Context->S3DebugBufferAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)AllocateMemoryBelow4G (EfiReservedMemoryType, EFI_PAGE_SIZE);
535 SetMem ((VOID *)(UINTN)AcpiS3Context->S3DebugBufferAddress, EFI_PAGE_SIZE, 0xff);
536
537 DEBUG((EFI_D_INFO, "AcpiS3Context: AcpiFacsTable is 0x%8x\n", AcpiS3Context->AcpiFacsTable));
538 DEBUG((EFI_D_INFO, "AcpiS3Context: IdtrProfile is 0x%8x\n", AcpiS3Context->IdtrProfile));
539 DEBUG((EFI_D_INFO, "AcpiS3Context: S3NvsPageTableAddress is 0x%8x\n", AcpiS3Context->S3NvsPageTableAddress));
540 DEBUG((EFI_D_INFO, "AcpiS3Context: S3DebugBufferAddress is 0x%8x\n", AcpiS3Context->S3DebugBufferAddress));
541
542 Status = SaveLockBox (
543 &gEfiAcpiVariableGuid,
544 &AcpiS3ContextBuffer,
545 sizeof(AcpiS3ContextBuffer)
546 );
547 ASSERT_EFI_ERROR (Status);
548
549 Status = SaveLockBox (
550 &gEfiAcpiS3ContextGuid,
551 (VOID *)(UINTN)AcpiS3Context,
552 (UINTN)sizeof(*AcpiS3Context)
553 );
554 ASSERT_EFI_ERROR (Status);
555
556 Status = SetLockBoxAttributes (&gEfiAcpiS3ContextGuid, LOCK_BOX_ATTRIBUTE_RESTORE_IN_PLACE);
557 ASSERT_EFI_ERROR (Status);
558
559 //
560 // Save the boot script too. Note that this requires/includes emitting the
561 // DxeSmmReadyToLock event, which in turn locks down SMM.
562 //
563 SaveS3BootScript ();
564 return EFI_SUCCESS;
565 }
566
567 /**
568 The Driver Entry Point.
569
570 The function is the driver Entry point which will produce AcpiS3SaveProtocol.
571
572 @param ImageHandle A handle for the image that is initializing this driver
573 @param SystemTable A pointer to the EFI system table
574
575 @retval EFI_SUCCESS: Driver initialized successfully
576 @retval EFI_LOAD_ERROR: Failed to Initialize or has been loaded
577 @retval EFI_OUT_OF_RESOURCES Could not allocate needed resources
578
579 **/
580 EFI_STATUS
581 EFIAPI
582 InstallAcpiS3Save (
583 IN EFI_HANDLE ImageHandle,
584 IN EFI_SYSTEM_TABLE *SystemTable
585 )
586 {
587 EFI_STATUS Status;
588
589 if (!FeaturePcdGet(PcdPlatformCsmSupport)) {
590 //
591 // More memory for no CSM tip, because GDT need relocation
592 //
593 mLegacyRegionSize = 0x250;
594 } else {
595 mLegacyRegionSize = 0x100;
596 }
597
598 Status = gBS->InstallMultipleProtocolInterfaces (
599 &ImageHandle,
600 &gEfiAcpiS3SaveProtocolGuid, &mS3Save,
601 &gEfiLockBoxProtocolGuid, NULL,
602 NULL
603 );
604 ASSERT_EFI_ERROR (Status);
605 return Status;
606 }