TianoCore EDK2 master
Loading...
Searching...
No Matches
PrmSampleContextBufferModule.c
Go to the documentation of this file.
1
11#include <PrmModule.h>
12
13#include <Library/BaseLib.h>
14#include <Library/PrintLib.h>
15#include <Library/UefiLib.h>
16
18
19//
20// PRM Handler GUIDs
21//
22
23// {e1466081-7562-430f-896b-b0e523dc335a}
24#define CHECK_STATIC_DATA_BUFFER_PRM_HANDLER_GUID {0xe1466081, 0x7562, 0x430f, {0x89, 0x6b, 0xb0, 0xe5, 0x23, 0xdc, 0x33, 0x5a}}
25
38PRM_HANDLER_EXPORT (CheckStaticDataBufferPrmHandler) {
39 if (ContextBuffer == NULL) {
40 return EFI_INVALID_PARAMETER;
41 }
42
43 if (ContextBuffer->StaticDataBuffer == NULL) {
44 return EFI_INVALID_PARAMETER;
45 }
46
47 //
48 // Verify PRM data buffer signature is valid
49 //
50 if (
51 (ContextBuffer->Signature != PRM_CONTEXT_BUFFER_SIGNATURE) ||
52 (ContextBuffer->StaticDataBuffer->Header.Signature != PRM_DATA_BUFFER_HEADER_SIGNATURE))
53 {
54 return EFI_NOT_FOUND;
55 }
56
57 return EFI_SUCCESS;
58}
59
60//
61// Register the PRM export information for this PRM Module
62//
64 PRM_HANDLER_EXPORT_ENTRY (CHECK_STATIC_DATA_BUFFER_PRM_HANDLER_GUID, CheckStaticDataBufferPrmHandler)
65 );
66
77EFIAPI
79 IN EFI_HANDLE ImageHandle,
80 IN EFI_SYSTEM_TABLE *SystemTable
81 )
82{
83 return EFI_SUCCESS;
84}
#define NULL
Definition: Base.h:319
#define IN
Definition: Base.h:279
#define PRM_MODULE_EXPORT(...)
#define PRM_HANDLER_EXPORT_ENTRY(Guid, Name)
#define PRM_HANDLER_EXPORT(Name)
Definition: PrmModule.h:26
EFI_STATUS EFIAPI PrmSampleContextBufferModuleInit(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
#define EFI_SUCCESS
Definition: UefiBaseType.h:112