diff --git a/MdePkg/Test/Mock/Include/GoogleTest/Protocol/MockSmmAccess2.h b/MdePkg/Test/Mock/Include/GoogleTest/Protocol/MockSmmAccess2.h new file mode 100644 index 0000000000..29eb51a212 --- /dev/null +++ b/MdePkg/Test/Mock/Include/GoogleTest/Protocol/MockSmmAccess2.h @@ -0,0 +1,68 @@ +/** @file MockSmmAccess2.h + Declare mock SMM Access2 Protocol. + + Copyright (c) Microsoft Corporation. + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#ifndef MOCK_SMM_ACCESS2_H_ +#define MOCK_SMM_ACCESS2_H_ + +#include +#include +extern "C" { + #include + #include + #include +} + +struct MockSmmAccess2Protocol { + MOCK_INTERFACE_DECLARATION (MockSmmAccess2Protocol); + + MOCK_FUNCTION_DECLARATION ( + EFI_STATUS, + Open, + (IN EFI_MM_ACCESS_PROTOCOL *This) + ); + + MOCK_FUNCTION_DECLARATION ( + EFI_STATUS, + Close, + (IN EFI_MM_ACCESS_PROTOCOL *This) + ); + + MOCK_FUNCTION_DECLARATION ( + EFI_STATUS, + Lock, + (IN EFI_MM_ACCESS_PROTOCOL *This) + ); + + MOCK_FUNCTION_DECLARATION ( + EFI_STATUS, + GetCapabilities, + (IN CONST EFI_MM_ACCESS_PROTOCOL *This, + IN OUT UINTN *MmramMapSize, + IN OUT EFI_MMRAM_DESCRIPTOR *MmramMap) + ); +}; + +MOCK_INTERFACE_DEFINITION (MockSmmAccess2Protocol); +MOCK_FUNCTION_DEFINITION (MockSmmAccess2Protocol, Open, 1, EFIAPI); +MOCK_FUNCTION_DEFINITION (MockSmmAccess2Protocol, Close, 1, EFIAPI); +MOCK_FUNCTION_DEFINITION (MockSmmAccess2Protocol, Lock, 1, EFIAPI); +MOCK_FUNCTION_DEFINITION (MockSmmAccess2Protocol, GetCapabilities, 3, EFIAPI); + +EFI_SMM_ACCESS2_PROTOCOL SMM_ACCESS2_PROTOCOL_INSTANCE = { + Open, + Close, + Lock, + GetCapabilities, + FALSE, + FALSE +}; + +extern "C" { + EFI_SMM_ACCESS2_PROTOCOL *gSmmAccess2Protocol = &SMM_ACCESS2_PROTOCOL_INSTANCE; +} + +#endif