summaryrefslogtreecommitdiff
path: root/PrmPkg/Application/PrmInfo/PrmInfo.h
diff options
context:
space:
mode:
authorMichael Kubacki <michael.kubacki@microsoft.com>2020-06-10 11:06:07 -0700
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-04-05 00:42:38 +0000
commit4348c72ad0328fcf8ef37930cf51a5dbc2388038 (patch)
treee3b1e938c5f9b6c1c00ac0fb0eefa2fe0726211c /PrmPkg/Application/PrmInfo/PrmInfo.h
parent6b7dde7cdd1649e59e228535a29aa8d80761a1ba (diff)
downloadedk2-4348c72ad0328fcf8ef37930cf51a5dbc2388038.zip
edk2-4348c72ad0328fcf8ef37930cf51a5dbc2388038.tar.gz
edk2-4348c72ad0328fcf8ef37930cf51a5dbc2388038.tar.bz2
PrmPkg/Application/PrmInfo: Add initial application
Adds a new UEFI application called "PrmInfo" that allows a user to display and test Platform Runtime Mechanism (PRM) modules. Execute the application help command for detailed usage instructions and examples of how to use the application: "PrmInfo -?" This application is intended to be helpful during PRM enabling by allowing the user to: 1. Confirm that their firmware port of the PRM infrastructure implemented in this package is functioning correctly. 2. Quickly get information about what PRM modules and handlers are present on a given system. 3. Quickly test PRM handlers without booting to a fully featured operating system. 4. Develop and exercise PRM handlers prior to the availability of an operating system that is PRM aware. Adds a brief section to Readme.md about the PrmInfo UEFI application with a link to allow the reader to find more information about the application if interested. Cc: Andrew Fish <afish@apple.com> Cc: Kang Gao <kang.gao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Michael Kubacki <michael.kubacki@microsoft.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Benjamin You <benjamin.you@intel.com> Cc: Liu Yun <yun.y.liu@intel.com> Cc: Ankit Sinha <ankit.sinha@intel.com> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Acked-by: Michael D Kinney <michael.d.kinney@intel.com> Acked-by: Liming Gao <gaoliming@byosoft.com.cn> Acked-by: Leif Lindholm <quic_llindhol@quicinc.com> Reviewed-by: Ankit Sinha <ankit.sinha@intel.com>
Diffstat (limited to 'PrmPkg/Application/PrmInfo/PrmInfo.h')
-rw-r--r--PrmPkg/Application/PrmInfo/PrmInfo.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/PrmPkg/Application/PrmInfo/PrmInfo.h b/PrmPkg/Application/PrmInfo/PrmInfo.h
new file mode 100644
index 0000000..c2c3fa2
--- /dev/null
+++ b/PrmPkg/Application/PrmInfo/PrmInfo.h
@@ -0,0 +1,49 @@
+/** @file
+ Prints information about the PRM configuration loaded by the system firmware.
+
+ Copyright (C) Microsoft Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef PRM_INFO_H_
+#define PRM_INFO_H_
+
+#include <Base.h>
+#include <Prm.h>
+#include <PrmDataBuffer.h>
+#include <Uefi.h>
+
+#define APPLICATION_NAME L"PrmInfo"
+
+#define PRM_HANDLER_CONTEXT_LIST_ENTRY_SIGNATURE SIGNATURE_32('P','R','H','E')
+
+#pragma pack(push, 1)
+
+typedef struct {
+ CHAR8 *Name;
+ EFI_GUID *Guid;
+ PRM_DATA_BUFFER *StaticDataBuffer;
+ CHAR8 *ModuleName;
+ PRM_HANDLER *Handler;
+} PRM_HANDLER_CONTEXT;
+
+typedef struct {
+ UINTN Signature;
+ LIST_ENTRY Link;
+ PRM_HANDLER_CONTEXT Context;
+} PRM_HANDLER_CONTEXT_LIST_ENTRY;
+
+#pragma pack(pop)
+
+//
+// Iterate through the double linked list. NOT delete safe.
+//
+#define EFI_LIST_FOR_EACH(Entry, ListHead) \
+ for(Entry = (ListHead)->ForwardLink; Entry != (ListHead); Entry = Entry->ForwardLink)
+
+#define ONE_MICROSECOND (1000)
+#define ONE_MILLISECOND (1000 * ONE_MICROSECOND)
+#define ONE_SECOND (1000 * ONE_MILLISECOND)
+
+#endif