3 Parts of the SMM/MM implementation that are specific to standalone MM
5 Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
6 Copyright (c) 2018, Linaro, Ltd. All rights reserved.<BR>
7 SPDX-License-Identifier: BSD-2-Clause-Patent
11 #include <Library/SmmMemLib.h>
12 #include <Library/UefiBootServicesTableLib.h>
13 #include "FaultTolerantWrite.h"
14 #include "FaultTolerantWriteSmmCommon.h"
17 This function checks if the buffer is valid per processor architecture and
18 does not overlap with SMRAM.
20 @param Buffer The buffer start address to be checked.
21 @param Length The buffer length to be checked.
23 @retval TRUE This buffer is valid per processor architecture and does not
25 @retval FALSE This buffer is not valid per processor architecture or overlaps
29 FtwSmmIsBufferOutsideSmmValid (
30 IN EFI_PHYSICAL_ADDRESS Buffer
,
38 Internal implementation of CRC32. Depending on the execution context
39 (standalone SMM or DXE vs standalone MM), this function is implemented
40 via a call to the CalculateCrc32 () boot service, or via a library
43 If Buffer is NULL, then ASSERT().
44 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
46 @param[in] Buffer A pointer to the buffer on which the 32-bit CRC is to be computed.
47 @param[in] Length The number of bytes in the buffer Data.
49 @retval Crc32 The 32-bit CRC was computed for the data buffer.
58 return CalculateCrc32 (Buffer
, Length
);
62 Notify the system that the SMM FTW driver is ready.
72 This function is the entry point of the Fault Tolerant Write driver.
74 @param[in] ImageHandle A handle for the image that is initializing this driver
75 @param[in] MmSystemTable A pointer to the MM system table
77 @retval EFI_SUCCESS The initialization finished successfully.
78 @retval EFI_OUT_OF_RESOURCES Allocate memory error
79 @retval EFI_INVALID_PARAMETER Workspace or Spare block does not exist
84 StandaloneMmFaultTolerantWriteInitialize (
85 IN EFI_HANDLE ImageHandle
,
86 IN EFI_MM_SYSTEM_TABLE
*MmSystemTable
89 return MmFaultTolerantWriteInitialize ();