Skip to content

Commit e82643f

Browse files
committed
Update description and Support SMM and MM protocol
Signed-off-by: TsunFeng <[email protected]>
1 parent 779c5a6 commit e82643f

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

MdePkg/Test/Mock/Include/GoogleTest/Protocol/MockSmmSxDispatch2.h renamed to MdePkg/Test/Mock/Include/GoogleTest/Protocol/MockSxDispatch.h

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
/** @file MockSmmSxDispatch2.h
2-
This file declares a mock of SMM Software Dispatch Protocol
1+
/** @file MockSxDispatch.h
2+
This file declares a mock of SMM/MM Sx Dispatch Protocol
33
44
Copyright (c) Microsoft Corporation.
55
SPDX-License-Identifier: BSD-2-Clause-Patent
66
**/
77

8-
#ifndef MOCK_SMM_SX_DISPATCH2_H_
9-
#define MOCK_SMM_SX_DISPATCH2_H_
8+
#ifndef MOCK_SX_DISPATCH_H_
9+
#define MOCK_SX_DISPATCH_H_
1010

1111
#include <Library/GoogleTestLib.h>
1212
#include <Library/FunctionMockLib.h>
@@ -16,9 +16,9 @@ extern "C" {
1616
#include <Protocol/SmmSxDispatch2.h>
1717
}
1818

19-
// Declarations to handle usage of the EFI_SMM_SX_DISPATCH2_PROTOCOL
20-
struct MockEfiSmmSxDispatch2Protocol {
21-
MOCK_INTERFACE_DECLARATION (MockEfiSmmSxDispatch2Protocol);
19+
// Declarations to handle usage of the Sx Dispatch Protocol
20+
struct MockEfiSxDispatch2Protocol {
21+
MOCK_INTERFACE_DECLARATION (MockEfiSxDispatch2Protocol);
2222

2323
MOCK_FUNCTION_DECLARATION (
2424
EFI_STATUS,
@@ -39,14 +39,19 @@ struct MockEfiSmmSxDispatch2Protocol {
3939
);
4040
};
4141

42-
MOCK_INTERFACE_DEFINITION (MockEfiSmmSxDispatch2Protocol);
43-
MOCK_FUNCTION_DEFINITION (MockEfiSmmSxDispatch2Protocol, Register, 4, EFIAPI);
44-
MOCK_FUNCTION_DEFINITION (MockEfiSmmSxDispatch2Protocol, UnRegister, 2, EFIAPI);
42+
MOCK_INTERFACE_DEFINITION (MockEfiSxDispatch2Protocol);
43+
MOCK_FUNCTION_DEFINITION (MockEfiSxDispatch2Protocol, Register, 4, EFIAPI);
44+
MOCK_FUNCTION_DEFINITION (MockEfiSxDispatch2Protocol, UnRegister, 2, EFIAPI);
4545

4646
#define MOCK_EFI_SMM_SX_DISPATCH2_PROTOCOL_INSTANCE(NAME) \
4747
EFI_SMM_SX_DISPATCH2_PROTOCOL NAME##_INSTANCE = { \
4848
Register, \
4949
UnRegister }; \
5050
EFI_SMM_SX_DISPATCH2_PROTOCOL *NAME = &NAME##_INSTANCE;
5151

52-
#endif // MOCK_SMM_SW_DISPATCH2_H_
52+
#define MOCK_EFI_MM_SX_DISPATCH_PROTOCOL_INSTANCE(NAME) \
53+
EFI_MM_SX_DISPATCH_PROTOCOL NAME##_INSTANCE = { \
54+
Register, \
55+
UnRegister }; \
56+
EFI_MM_SX_DISPATCH_PROTOCOL *NAME = &NAME##_INSTANCE;
57+
#endif // MOCK_SX_DISPATCH_H_

0 commit comments

Comments
 (0)