-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Memory Protection Debug Protocol
- Loading branch information
1 parent
0df0cca
commit b57bda6
Showing
6 changed files
with
226 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/** @file -- MemoryProtectionDebug.h | ||
This protocol provides debug access to memory protection functionality for validation and testing. | ||
This protocol will be installed on every boot, so no functionality exposed within should be | ||
a sensitive or a security concern. Any potentially sensitive debug info/logic which needs to be exposed | ||
for testing should be attached to a new protocol whose installation is blocked behind a check | ||
that the device is not for broad consumer use (manufacturing mode, unit test mode, etc.). | ||
Copyright (c) Microsoft Corporation. All rights reserved. | ||
SPDX-License-Identifier: BSD-2-Clause-Patent | ||
**/ | ||
|
||
#ifndef __MEMORY_PROTECTION_DEBUG_PROTOCOL__ | ||
#define __MEMORY_PROTECTION_DEBUG_PROTOCOL__ | ||
|
||
#define MEMORY_PROTECTION_DEBUG_PROTOCOL_GUID \ | ||
{ \ | ||
0xe8150630, 0x6366, 0x4294, { 0xa3, 0x47, 0x89, 0x2c, 0x3a, 0x7d, 0xe4, 0xaf } \ | ||
} | ||
|
||
#define IMAGE_RANGE_DESCRIPTOR_SIGNATURE SIGNATURE_32 ('I','R','D','S') | ||
|
||
typedef enum _IMAGE_RANGE_TYPE { | ||
Code, | ||
Data | ||
} IMAGE_RANGE_TYPE; | ||
|
||
typedef enum _IMAGE_RANGE_PROTECTION_STATUS { | ||
Protected, | ||
NonProtected | ||
} IMAGE_RANGE_PROTECTION_STATUS; | ||
|
||
typedef struct _IMAGE_RANGE_DESCRIPTOR { | ||
UINT32 Signature; | ||
LIST_ENTRY Link; | ||
EFI_PHYSICAL_ADDRESS Base; | ||
EFI_PHYSICAL_ADDRESS Length; | ||
IMAGE_RANGE_TYPE Type; | ||
} IMAGE_RANGE_DESCRIPTOR; | ||
|
||
typedef | ||
BOOLEAN | ||
(EFIAPI *IS_GUARD_PAGE)( | ||
EFI_PHYSICAL_ADDRESS Address | ||
); | ||
|
||
typedef | ||
EFI_STATUS | ||
(EFIAPI *GET_IMAGE_LIST)( | ||
IMAGE_RANGE_DESCRIPTOR **ImageList, | ||
IMAGE_RANGE_PROTECTION_STATUS ProtectedOrNonProtected | ||
); | ||
|
||
typedef struct _MEMORY_PROTECTION_DEBUG_PROTOCOL { | ||
IS_GUARD_PAGE IsGuardPage; | ||
GET_IMAGE_LIST GetImageList; | ||
} MEMORY_PROTECTION_DEBUG_PROTOCOL; | ||
|
||
extern EFI_GUID gMemoryProtectionDebugProtocolGuid; | ||
|
||
#endif |