VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteTraditionalMm.c@ 98942

最後變更 在這個檔案從98942是 80721,由 vboxsync 提交於 6 年 前

Devices/EFI/FirmwareNew: Start upgrade process to edk2-stable201908 (compiles on Windows and works to some extent), bugref:4643

  • 屬性 svn:eol-style 設為 native
檔案大小: 2.9 KB
 
1/** @file
2
3 Parts of the SMM/MM implementation that are specific to traditional MM
4
5Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved. <BR>
6Copyright (c) 2018, Linaro, Ltd. All rights reserved. <BR>
7SPDX-License-Identifier: BSD-2-Clause-Patent
8
9**/
10
11#include <Library/SmmMemLib.h>
12#include <Library/UefiBootServicesTableLib.h>
13#include "FaultTolerantWrite.h"
14#include "FaultTolerantWriteSmmCommon.h"
15
16/**
17 This function checks if the buffer is valid per processor architecture and
18 does not overlap with SMRAM.
19
20 @param Buffer The buffer start address to be checked.
21 @param Length The buffer length to be checked.
22
23 @retval TRUE This buffer is valid per processor architecture and does not
24 overlap with SMRAM.
25 @retval FALSE This buffer is not valid per processor architecture or overlaps
26 with SMRAM.
27**/
28BOOLEAN
29FtwSmmIsBufferOutsideSmmValid (
30 IN EFI_PHYSICAL_ADDRESS Buffer,
31 IN UINT64 Length
32 )
33{
34 return SmmIsBufferOutsideSmmValid (Buffer, Length);
35}
36
37/**
38 Internal implementation of CRC32. Depending on the execution context
39 (traditional SMM or DXE vs standalone MM), this function is implemented
40 via a call to the CalculateCrc32 () boot service, or via a library
41 call.
42
43 If Buffer is NULL, then ASSERT().
44 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
45
46 @param[in] Buffer A pointer to the buffer on which the 32-bit CRC is
47 to be computed.
48 @param[in] Length The number of bytes in the buffer Data.
49
50 @retval Crc32 The 32-bit CRC was computed for the data buffer.
51
52**/
53UINT32
54FtwCalculateCrc32 (
55 IN VOID *Buffer,
56 IN UINTN Length
57 )
58{
59 EFI_STATUS Status;
60 UINT32 ReturnValue;
61
62 Status = gBS->CalculateCrc32 (Buffer, Length, &ReturnValue);
63 ASSERT_EFI_ERROR (Status);
64
65 return ReturnValue;
66}
67
68/**
69 Notify the system that the SMM FTW driver is ready.
70**/
71VOID
72FtwNotifySmmReady (
73 VOID
74 )
75{
76 EFI_HANDLE FtwHandle;
77 EFI_STATUS Status;
78
79 FtwHandle = NULL;
80 Status = gBS->InstallProtocolInterface (
81 &FtwHandle,
82 &gEfiSmmFaultTolerantWriteProtocolGuid,
83 EFI_NATIVE_INTERFACE,
84 NULL
85 );
86 ASSERT_EFI_ERROR (Status);
87}
88
89/**
90 This function is the entry point of the Fault Tolerant Write driver.
91
92 @param[in] ImageHandle A handle for the image that is initializing this driver
93 @param[in] SystemTable A pointer to the EFI system table
94
95 @retval EFI_SUCCESS The initialization finished successfully.
96 @retval EFI_OUT_OF_RESOURCES Allocate memory error
97 @retval EFI_INVALID_PARAMETER Workspace or Spare block does not exist
98
99**/
100EFI_STATUS
101EFIAPI
102SmmFaultTolerantWriteInitialize (
103 IN EFI_HANDLE ImageHandle,
104 IN EFI_SYSTEM_TABLE *SystemTable
105 )
106{
107 return MmFaultTolerantWriteInitialize ();
108}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette