diff --git a/Include/Protocol/OcFirmwareRuntime.h b/Include/Protocol/OcFirmwareRuntime.h new file mode 100644 index 00000000..608a5975 --- /dev/null +++ b/Include/Protocol/OcFirmwareRuntime.h @@ -0,0 +1,60 @@ +/** @file + Copyright (C) 2019, vit9696. All rights reserved. + + All rights reserved. + + This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +**/ + +#ifndef OC_FIRMWARE_RUNTIME_PROTOCOL_H +#define OC_FIRMWARE_RUNTIME_PROTOCOL_H + +#define OC_FIRMWARE_RUNTIME_REVISION 1 + +// +// OC_FIRMWARE_RUNTIME_PROTOCOL_GUID +// 9C820F96-F16C-4FFD-B266-DF0A8FDFC455 +// +#define OC_FIRMWARE_RUNTIME_PROTOCOL_GUID \ + { 0x9C820F96, 0xF16C, 0x4FFD, \ + { 0xB2, 0x66, 0xDF, 0x0A, 0x8F, 0xDF, 0xC4, 0x55 } } + +// +// Set NVRAM routing, returns previous value. +// +typedef +BOOLEAN +EFIAPI +(*OC_FWRT_NVRAM_REDIRECT) ( + IN BOOLEAN NewValue + ); + +// +// Set GetVariable override for customising values. +// +typedef +EFI_STATUS +EFIAPI +(*OC_FWRT_ON_GET_VARIABLE) ( + IN EFI_GET_VARIABLE GetVariable, + OUT EFI_GET_VARIABLE *OrgGetVariable OPTIONAL + ); + +// +// Check for revision to ensure binary compatibility. +// +typedef struct { + UINTN Revision; + OC_FWRT_NVRAM_REDIRECT SetNvram; + OC_FWRT_ON_GET_VARIABLE OnGetVariable; +} OC_FIRMWARE_RUNTIME_PROTOCOL; + +extern EFI_GUID gOcFirmwareRuntimeProtocolGuid; + +#endif // OC_FIRMWARE_RUNTIME_PROTOCOL_H diff --git a/OcSupportPkg.dec b/OcSupportPkg.dec index 2235aadc..5804c223 100644 --- a/OcSupportPkg.dec +++ b/OcSupportPkg.dec @@ -41,6 +41,9 @@ ## Include/Protocol/OcLog.h gOcLogProtocolGuid = { 0xDBB6008F, 0x89E4, 0x4272, { 0x98, 0x81, 0xCE, 0x3A, 0xFD, 0x97, 0x24, 0xD0 }} + ## Include/Protocol/OcFirmwareRuntime.h + gOcFirmwareRuntimeProtocolGuid = { 0x9C820F96, 0xF16C, 0x4FFD, { 0xB2, 0x66, 0xDF, 0x0A, 0x8F, 0xDF, 0xC4, 0x55 }} + ## Include/Protocol/LegacyRegion.h gEfiLegacyRegionProtocolGuid = { 0x0fc9013a, 0x0568, 0x4ba9, { 0x9b, 0x7e, 0xc9, 0xc3, 0x90, 0xa6, 0x60, 0x9b }}