From 2c40a813fc32c5c9aa204b10b037c48f42fe6422 Mon Sep 17 00:00:00 2001 From: qwang12 Date: Thu, 24 Jan 2008 06:37:35 +0000 Subject: 1) Sync EdkCompatibilityPkg with EDK 1.04. The changes includes: 1.1) Bug fixes. (For details, please check Documents & files: Snapshot/Release Notes at https://edk.tianocore.org/servlets/ProjectDocumentList?folderID=43&expandFolder=43&folderID=6) 1.2) Add new UEFI protocol definitions for AbsolutePointer, FormBrowser2, HiiConfigAccess, HiiConfigRouting, HiiDatabase, HiiFont, HiiImage, HiiString, SimpleTextInputEx, DPC protocol. 1.3) Add Smbios 2.5, 2.6 supports. Incompatible changes hilighted: 1) EFI_MANAGED_NETWORK_PROTOCOL_GUID changed. 2) EFI_IP4_IPCONFIG_DATA changed. 2) Add in EdkCompatibilityPkg/EdkCompatibilityPkg.dsc to build all libraries in this package. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4622 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Efi/Protocol/AbsolutePointer/AbsolutePointer.c | 29 ++ .../Efi/Protocol/AbsolutePointer/AbsolutePointer.h | 117 ++++++ .../Foundation/Efi/Protocol/Dhcp4/Dhcp4.h | 56 ++- .../Foundation/Efi/Protocol/EfiProtocolLib.inf | 18 + .../Efi/Protocol/FormBrowser2/FormBrowser2.c | 27 ++ .../Efi/Protocol/FormBrowser2/FormBrowser2.h | 136 +++++++ .../Efi/Protocol/HiiConfigAccess/HiiConfigAccess.c | 27 ++ .../Efi/Protocol/HiiConfigAccess/HiiConfigAccess.h | 147 +++++++ .../Protocol/HiiConfigRouting/HiiConfigRouting.c | 27 ++ .../Protocol/HiiConfigRouting/HiiConfigRouting.h | 314 ++++++++++++++ .../Efi/Protocol/HiiDatabase/HiiDatabase.c | 29 ++ .../Efi/Protocol/HiiDatabase/HiiDatabase.h | 450 +++++++++++++++++++++ .../Foundation/Efi/Protocol/HiiFont/HiiFont.c | 29 ++ .../Foundation/Efi/Protocol/HiiFont/HiiFont.h | 283 +++++++++++++ .../Foundation/Efi/Protocol/HiiImage/HiiImage.c | 29 ++ .../Foundation/Efi/Protocol/HiiImage/HiiImage.h | 254 ++++++++++++ .../Foundation/Efi/Protocol/HiiString/HiiString.c | 29 ++ .../Foundation/Efi/Protocol/HiiString/HiiString.h | 240 +++++++++++ .../Foundation/Efi/Protocol/Ip4Config/Ip4Config.h | 7 +- .../Efi/Protocol/ManagedNetwork/ManagedNetwork.h | 4 +- .../Protocol/SimpleTextInputEx/SimpleTextInputEx.c | 31 ++ .../Protocol/SimpleTextInputEx/SimpleTextInputEx.h | 255 ++++++++++++ .../Protocol/UnicodeCollation/UnicodeCollation.c | 2 + .../Protocol/UnicodeCollation/UnicodeCollation.h | 6 + 24 files changed, 2511 insertions(+), 35 deletions(-) create mode 100644 EdkCompatibilityPkg/Foundation/Efi/Protocol/AbsolutePointer/AbsolutePointer.c create mode 100644 EdkCompatibilityPkg/Foundation/Efi/Protocol/AbsolutePointer/AbsolutePointer.h create mode 100644 EdkCompatibilityPkg/Foundation/Efi/Protocol/FormBrowser2/FormBrowser2.c create mode 100644 EdkCompatibilityPkg/Foundation/Efi/Protocol/FormBrowser2/FormBrowser2.h create mode 100644 EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiConfigAccess/HiiConfigAccess.c create mode 100644 EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiConfigAccess/HiiConfigAccess.h create mode 100644 EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiConfigRouting/HiiConfigRouting.c create mode 100644 EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiConfigRouting/HiiConfigRouting.h create mode 100644 EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiDatabase/HiiDatabase.c create mode 100644 EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiDatabase/HiiDatabase.h create mode 100644 EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiFont/HiiFont.c create mode 100644 EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiFont/HiiFont.h create mode 100644 EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiImage/HiiImage.c create mode 100644 EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiImage/HiiImage.h create mode 100644 EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiString/HiiString.c create mode 100644 EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiString/HiiString.h create mode 100644 EdkCompatibilityPkg/Foundation/Efi/Protocol/SimpleTextInputEx/SimpleTextInputEx.c create mode 100644 EdkCompatibilityPkg/Foundation/Efi/Protocol/SimpleTextInputEx/SimpleTextInputEx.h (limited to 'EdkCompatibilityPkg/Foundation/Efi/Protocol') diff --git a/EdkCompatibilityPkg/Foundation/Efi/Protocol/AbsolutePointer/AbsolutePointer.c b/EdkCompatibilityPkg/Foundation/Efi/Protocol/AbsolutePointer/AbsolutePointer.c new file mode 100644 index 0000000000..2d1cd3f99d --- /dev/null +++ b/EdkCompatibilityPkg/Foundation/Efi/Protocol/AbsolutePointer/AbsolutePointer.c @@ -0,0 +1,29 @@ +/*++ + +Copyright (c) 2007, Intel Corporation +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. + +Module Name: + + AbsolutePointer.c + +Abstract: + + EFI_ABSOLUTE_POINTER_PROTOCOL from the UEFI 2.1 specification. + + This protocol specifies a simple method for accessing absolute pointer devices. + +--*/ + +#include "EfiSpec.h" +#include EFI_PROTOCOL_DEFINITION (AbsolutePointer) + +EFI_GUID gEfiAbsolutePointerProtocolGuid = EFI_ABSOLUTE_POINTER_PROTOCOL_GUID; + +EFI_GUID_STRING(&gEfiAbsolutePointerProtocolGuid, "Absolute Pointer Protocol", "UEFI 2.1 Absolute Pointer Protocol"); diff --git a/EdkCompatibilityPkg/Foundation/Efi/Protocol/AbsolutePointer/AbsolutePointer.h b/EdkCompatibilityPkg/Foundation/Efi/Protocol/AbsolutePointer/AbsolutePointer.h new file mode 100644 index 0000000000..7f5e0c4a82 --- /dev/null +++ b/EdkCompatibilityPkg/Foundation/Efi/Protocol/AbsolutePointer/AbsolutePointer.h @@ -0,0 +1,117 @@ +/*++ + +Copyright (c) 2007, Intel Corporation +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. + +Module Name: + + AbsolutePointer.h + +Abstract: + + EFI_ABSOLUTE_POINTER_PROTOCOL from the UEFI 2.1 specification. + + This protocol specifies a simple method for accessing absolute pointer devices. + +--*/ + +#ifndef __ABSOLUTE_POINTER_H__ +#define __ABSOLUTE_POINTER_H__ + +#define EFI_ABSOLUTE_POINTER_PROTOCOL_GUID \ + { \ + 0x8D59D32B, 0xC655, 0x4AE9, 0x9B, 0x15, 0xF2, 0x59, 0x04, 0x99, 0x2A, 0x43 \ + } + +EFI_FORWARD_DECLARATION (EFI_ABSOLUTE_POINTER_PROTOCOL); + +// +// Data structures +// + +typedef struct { + UINT64 AbsoluteMinX; + UINT64 AbsoluteMinY; + UINT64 AbsoluteMinZ; + UINT64 AbsoluteMaxX; + UINT64 AbsoluteMaxY; + UINT64 AbsoluteMaxZ; + UINT32 Attributes; +} EFI_ABSOLUTE_POINTER_MODE; + +typedef struct { + UINT64 CurrentX; + UINT64 CurrentY; + UINT64 CurrentZ; + UINT32 ActiveButtons; +} EFI_ABSOLUTE_POINTER_STATE; + +#define EFI_ABSP_SupportsAltActive 0x00000001 +#define EFI_ABSP_SupportsPressureAsZ 0x00000002 + +#define EFI_ABSP_TouchActive 0x00000001 +#define EFI_ABS_AltActive 0x00000002 + +typedef +EFI_STATUS +(EFIAPI *EFI_ABSOLUTE_POINTER_RESET) ( + IN EFI_ABSOLUTE_POINTER_PROTOCOL *This, + IN BOOLEAN ExtendedVerification + ) +/*++ + + Routine Description: + Resets the pointer device hardware. + + Arguments: + This - Protocol instance pointer. + ExtendedVerification - Driver may perform diagnostics on reset. + + Returns: + EFI_SUCCESS - The device was reset. + EFI_DEVICE_ERROR - The device is not functioning correctly and could + not be reset. + +--*/ +; + +typedef +EFI_STATUS +(EFIAPI *EFI_ABSOLUTE_POINTER_GET_STATE) ( + IN EFI_ABSOLUTE_POINTER_PROTOCOL *This, + IN OUT EFI_ABSOLUTE_POINTER_STATE *State + ) +/*++ + + Routine Description: + Retrieves the current state of a pointer device. + + Arguments: + This - Protocol instance pointer. + State - A pointer to the state information on the pointer device. + + Returns: + EFI_SUCCESS - The state of the pointer device was returned in State.. + EFI_NOT_READY - The state of the pointer device has not changed since the last call to + GetState(). + EFI_DEVICE_ERROR - A device error occurred while attempting to retrieve the pointer + device's current state. +--*/ +; + +typedef struct _EFI_ABSOLUTE_POINTER_PROTOCOL { + EFI_ABSOLUTE_POINTER_RESET Reset; + EFI_ABSOLUTE_POINTER_GET_STATE GetState; + EFI_EVENT WaitForInput; + EFI_ABSOLUTE_POINTER_MODE *Mode; +} EFI_ABSOLUTE_POINTER_PROTOCOL; + +extern EFI_GUID gEfiAbsolutePointerProtocolGuid; + +#endif diff --git a/EdkCompatibilityPkg/Foundation/Efi/Protocol/Dhcp4/Dhcp4.h b/EdkCompatibilityPkg/Foundation/Efi/Protocol/Dhcp4/Dhcp4.h index 3409ca06cb..a0205caf55 100644 --- a/EdkCompatibilityPkg/Foundation/Efi/Protocol/Dhcp4/Dhcp4.h +++ b/EdkCompatibilityPkg/Foundation/Efi/Protocol/Dhcp4/Dhcp4.h @@ -88,18 +88,18 @@ typedef enum{ Dhcp4SendDiscover = 0x01, Dhcp4RcvdOffer = 0x02, Dhcp4SelectOffer = 0x03, - Dhcp4SendRequest = 0x05, - Dhcp4RcvdAck = 0x06, - Dhcp4RcvdNak = 0x07, - Dhcp4SendDecline = 0x08, - Dhcp4BoundCompleted = 0x09, - Dhcp4EnterRenewing = 0x0a, - Dhcp4EnterRebinding = 0x0b, - Dhcp4AddressLost = 0x0c, - Dhcp4Fail = 0x0d + Dhcp4SendRequest = 0x04, + Dhcp4RcvdAck = 0x05, + Dhcp4RcvdNak = 0x06, + Dhcp4SendDecline = 0x07, + Dhcp4BoundCompleted = 0x08, + Dhcp4EnterRenewing = 0x09, + Dhcp4EnterRebinding = 0x0a, + Dhcp4AddressLost = 0x0b, + Dhcp4Fail = 0x0c } EFI_DHCP4_EVENT; -typedef EFI_STATUS (*EFI_DHCP4_CALLBACK)( +typedef EFI_STATUS (*EFI_DHCP4_CALLBACK) ( IN EFI_DHCP4_PROTOCOL *This, IN VOID *Context, IN EFI_DHCP4_STATE CurrentState, @@ -139,23 +139,22 @@ typedef struct { } EFI_DHCP4_LISTEN_POINT; typedef struct { - OUT EFI_STATUS Status; - IN EFI_EVENT CompletionEvent; - IN EFI_IPv4_ADDRESS RemoteAddress; - IN UINT16 RemotePort; - IN EFI_IPv4_ADDRESS GatewayAddress; - IN UINT32 ListenPointCount; - IN EFI_DHCP4_LISTEN_POINT *ListenPoints; - IN UINT32 TimeoutValue; - IN EFI_DHCP4_PACKET *Packet; - OUT UINT32 ResponseCount; - OUT EFI_DHCP4_PACKET *ResponseList; -}EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN; - + EFI_STATUS Status; + EFI_EVENT CompletionEvent; + EFI_IPv4_ADDRESS RemoteAddress; + UINT16 RemotePort; + EFI_IPv4_ADDRESS GatewayAddress; + UINT32 ListenPointCount; + EFI_DHCP4_LISTEN_POINT *ListenPoints; + UINT32 TimeoutValue; + EFI_DHCP4_PACKET *Packet; + UINT32 ResponseCount; + EFI_DHCP4_PACKET *ResponseList; +} EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN; typedef EFI_STATUS -(EFIAPI *EFI_DHCP4_GET_MODE_DATA)( +(EFIAPI *EFI_DHCP4_GET_MODE_DATA) ( IN EFI_DHCP4_PROTOCOL *This, OUT EFI_DHCP4_MODE_DATA *Dhcp4ModeData ); @@ -176,8 +175,8 @@ typedef EFI_STATUS typedef EFI_STATUS -(EFIAPI *EFI_DHCP4_RENEW) ( - IN EFI_DHCP4_PROTOCOL *This, +(EFIAPI *EFI_DHCP4_RENEW_REBIND) ( + IN EFI_DHCP4_PROTOCOL *This, IN BOOLEAN RebindRequest, IN EFI_EVENT CompletionEvent OPTIONAL ); @@ -201,7 +200,7 @@ EFI_STATUS IN UINT32 DeleteCount, IN UINT8 *DeleteList OPTIONAL, IN UINT32 AppendCount, - IN EFI_DHCP4_PACKET_OPTION *AppendList[] OPTIONAL, + IN EFI_DHCP4_PACKET_OPTION *AppendList[] OPTIONAL, OUT EFI_DHCP4_PACKET **NewPacket ); @@ -212,7 +211,6 @@ EFI_STATUS IN EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN *Token ); - typedef EFI_STATUS (EFIAPI *EFI_DHCP4_PARSE) ( @@ -226,7 +224,7 @@ typedef struct _EFI_DHCP4_PROTOCOL { EFI_DHCP4_GET_MODE_DATA GetModeData; EFI_DHCP4_CONFIGURE Configure; EFI_DHCP4_START Start; - EFI_DHCP4_RENEW RenewRebind; + EFI_DHCP4_RENEW_REBIND RenewRebind; EFI_DHCP4_RELEASE Release; EFI_DHCP4_STOP Stop; EFI_DHCP4_BUILD Build; diff --git a/EdkCompatibilityPkg/Foundation/Efi/Protocol/EfiProtocolLib.inf b/EdkCompatibilityPkg/Foundation/Efi/Protocol/EfiProtocolLib.inf index f1add5c8d8..2de56acdb1 100644 --- a/EdkCompatibilityPkg/Foundation/Efi/Protocol/EfiProtocolLib.inf +++ b/EdkCompatibilityPkg/Foundation/Efi/Protocol/EfiProtocolLib.inf @@ -37,6 +37,8 @@ COMPONENT_TYPE= LIBRARY [nmake.common] [sources.common] + AbsolutePointer\AbsolutePointer.h + AbsolutePointer\AbsolutePointer.c AcpiTable\AcpiTable.h AcpiTable\AcpiTable.c Arp\Arp.h @@ -93,8 +95,22 @@ COMPONENT_TYPE= LIBRARY FileSystemInfo\FileSystemInfo.c FileSystemVolumeLabelInfo\FileSystemVolumeLabelInfo.h FileSystemVolumeLabelInfo\FileSystemVolumeLabelInfo.c + FormBrowser2\FormBrowser2.h + FormBrowser2\FormBrowser2.c GraphicsOutput\GraphicsOutput.h GraphicsOutput\GraphicsOutput.c + HiiConfigAccess\HiiConfigAccess.h + HiiConfigAccess\HiiConfigAccess.c + HiiConfigRouting\HiiConfigRouting.h + HiiConfigRouting\HiiConfigRouting.c + HiiDatabase\HiiDatabase.h + HiiDatabase\HiiDatabase.c + HiiFont\HiiFont.h + HiiFont\HiiFont.c + HiiImage\HiiImage.h + HiiImage\HiiImage.c + HiiString\HiiString.h + HiiString\HiiString.c Ip4\Ip4.h Ip4\Ip4.c Ip4Config\Ip4Config.h @@ -129,6 +145,8 @@ COMPONENT_TYPE= LIBRARY SimplePointer\SimplePointer.c SimpleTextIn\SimpleTextIn.h SimpleTextIn\SimpleTextIn.c + SimpleTextInputEx\SimpleTextInputEx.h + SimpleTextInputEx\SimpleTextInputEx.c SimpleTextOut\SimpleTextOut.h SimpleTextOut\SimpleTextOut.c Udp4\Udp4.h diff --git a/EdkCompatibilityPkg/Foundation/Efi/Protocol/FormBrowser2/FormBrowser2.c b/EdkCompatibilityPkg/Foundation/Efi/Protocol/FormBrowser2/FormBrowser2.c new file mode 100644 index 0000000000..068bf3c78d --- /dev/null +++ b/EdkCompatibilityPkg/Foundation/Efi/Protocol/FormBrowser2/FormBrowser2.c @@ -0,0 +1,27 @@ +/*++ + +Copyright (c) 2007, Intel Corporation +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. + +Module Name: + + FormBrowser2.c + +Abstract: + + The EFI_FORM_BROWSER2_PROTOCOL is the interface to the UEFI configuration driver. + +--*/ + +#include "EfiSpec.h" +#include EFI_PROTOCOL_DEFINITION (FormBrowser2) + +EFI_GUID gEfiFormBrowser2ProtocolGuid = EFI_FORM_BROWSER2_PROTOCOL_GUID; + +EFI_GUID_STRING(&gEfiFormBrowser2ProtocolGuid, "Form Browser2 Protocol", "Form Browser 2.1 protocol"); diff --git a/EdkCompatibilityPkg/Foundation/Efi/Protocol/FormBrowser2/FormBrowser2.h b/EdkCompatibilityPkg/Foundation/Efi/Protocol/FormBrowser2/FormBrowser2.h new file mode 100644 index 0000000000..9e54e368b7 --- /dev/null +++ b/EdkCompatibilityPkg/Foundation/Efi/Protocol/FormBrowser2/FormBrowser2.h @@ -0,0 +1,136 @@ +/*++ + +Copyright (c) 2007, Intel Corporation +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. + +Module Name: + + FormBrowser2.h + +Abstract: + + The EFI_FORM_BROWSER2_PROTOCOL is the interface to the UEFI configuration driver. + +--*/ + +#ifndef _FORM_BROWSER2_H_ +#define _FORM_BROWSER2_H_ + +#include "EfiHii.h" + +#define EFI_FORM_BROWSER2_PROTOCOL_GUID \ + { \ + 0xb9d4c360, 0xbcfb, 0x4f9b, 0x92, 0x98, 0x53, 0xc1, 0x36, 0x98, 0x22, 0x58 \ + } + +// +// Forward reference for pure ANSI compatability +// +EFI_FORWARD_DECLARATION (EFI_FORM_BROWSER2_PROTOCOL); + +typedef struct _EFI_FORM_BROWSER2_PROTOCOL EFI_FORM_BROWSER2_PROTOCOL; + +typedef struct { + UINTN LeftColumn; + UINTN RightColumn; + UINTN TopRow; + UINTN BottomRow; +} EFI_SCREEN_DESCRIPTOR; + +typedef UINTN EFI_BROWSER_ACTION_REQUEST; + +#define EFI_BROWSER_ACTION_REQUEST_NONE 0 +#define EFI_BROWSER_ACTION_REQUEST_RESET 1 +#define EFI_BROWSER_ACTION_REQUEST_SUBMIT 2 +#define EFI_BROWSER_ACTION_REQUEST_EXIT 3 + +// +// The following types are currently defined: +// +typedef +EFI_STATUS +(EFIAPI *EFI_SEND_FORM2) ( + IN CONST EFI_FORM_BROWSER2_PROTOCOL *This, + IN EFI_HII_HANDLE *Handles, + IN UINTN HandleCount, + IN EFI_GUID *FormSetGuid, OPTIONAL + IN UINT16 FormId, OPTIONAL + IN CONST EFI_SCREEN_DESCRIPTOR *ScreenDimensions, OPTIONAL + OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest OPTIONAL + ) +/*++ + +Routine Description: + This is the routine which an external caller uses to direct the browser + where to obtain it's information. + +Arguments: + This - A pointer to the EFI_FORM_BROWSER2_PROTOCOL instance. + Handles - A pointer to an array of HII handles to display. + HandleCount - The number of handles in the array specified by Handle. + FormSetGuid - This field points to the EFI_GUID which must match the Guid field in the EFI_IFR_FORM_SET op-code for the specified + forms-based package. If FormSetGuid is NULL, then this function will display the first found forms package. + FormId - This field specifies which EFI_IFR_FORM to render as the first displayable page. + If this field has a value of 0x0000, then the forms browser will render the specified forms in their encoded order. + ScreenDimenions - This allows the browser to be called so that it occupies a portion of the physical screen instead of + dynamically determining the screen dimensions. + ActionRequest - Points to the action recommended by the form. + +Returns: + EFI_SUCCESS - The function completed successfully. + EFI_INVALID_PARAMETER - One of the parameters has an invalid value. + EFI_NOT_FOUND - No valid forms could be found to display. + +--*/ +; + +typedef +EFI_STATUS +(EFIAPI *EFI_BROWSER_CALLBACK2) ( + IN CONST EFI_FORM_BROWSER2_PROTOCOL *This, + IN OUT UINTN *ResultsDataSize, + IN OUT EFI_STRING ResultsData, + IN BOOLEAN RetrieveData, + IN CONST EFI_GUID *VariableGuid, OPTIONAL + IN CONST CHAR16 *VariableName OPTIONAL + ) +/*++ + +Routine Description: + This function is called by a callback handler to retrieve uncommitted state + data from the browser. + +Arguments: + This - A pointer to the EFI_FORM_BROWSER2_PROTOCOL instance. + ResultsDataSize - A pointer to the size of the buffer associated with ResultsData. + On input, the size in bytes of ResultsData. + On output, the size of data returned in ResultsData. + ResultsData - A string returned from an IFR browser or equivalent. + The results string will have no routing information in them. + RetrieveData - A BOOLEAN field which allows an agent to retrieve (if RetrieveData = TRUE) + data from the uncommitted browser state information or set + (if RetrieveData = FALSE) data in the uncommitted browser state information. + VariableGuid - An optional field to indicate the target variable GUID name to use. + VariableName - An optional field to indicate the target human-readable variable name. + +Returns: + EFI_SUCCESS - The results have been distributed or are awaiting distribution. + EFI_BUFFER_TOO_SMALL - The ResultsDataSize specified was too small to contain the results data. + +--*/ +; + +typedef struct _EFI_FORM_BROWSER2_PROTOCOL { + EFI_SEND_FORM2 SendForm; + EFI_BROWSER_CALLBACK2 BrowserCallback; +} EFI_FORM_BROWSER2_PROTOCOL; + +extern EFI_GUID gEfiFormBrowser2ProtocolGuid; + +#endif diff --git a/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiConfigAccess/HiiConfigAccess.c b/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiConfigAccess/HiiConfigAccess.c new file mode 100644 index 0000000000..6820b76dad --- /dev/null +++ b/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiConfigAccess/HiiConfigAccess.c @@ -0,0 +1,27 @@ +/*++ + +Copyright (c) 2007, Intel Corporation +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. + +Module Name: + + HiiConfigAccess.c + +Abstract: + + EFI_HII_CONFIG_ACCESS_PROTOCOL as defined in UEFI 2.1 spec. + +--*/ + +#include "EfiSpec.h" +#include EFI_PROTOCOL_DEFINITION (HiiConfigAccess) + +EFI_GUID gEfiHiiConfigAccessProtocolGuid = EFI_HII_CONFIG_ACCESS_PROTOCOL_GUID; + +EFI_GUID_STRING(&gEfiHiiConfigAccessProtocolGuid, "HII Config Access Protocol", "HII Config Access 2.1 protocol"); diff --git a/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiConfigAccess/HiiConfigAccess.h b/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiConfigAccess/HiiConfigAccess.h new file mode 100644 index 0000000000..4683647a61 --- /dev/null +++ b/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiConfigAccess/HiiConfigAccess.h @@ -0,0 +1,147 @@ +/*++ + +Copyright (c) 2007, Intel Corporation +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. + +Module Name: + + HiiConfigAccess.h + +Abstract: + + EFI_HII_CONFIG_ACCESS_PROTOCOL as defined in UEFI 2.1 spec. + +--*/ + +#ifndef _HII_CONFIG_ACCESS_H_ +#define _HII_CONFIG_ACCESS_H_ + +#include EFI_PROTOCOL_DEFINITION (FormBrowser2) + +#define EFI_HII_CONFIG_ACCESS_PROTOCOL_GUID \ + { \ + 0x330d4706, 0xf2a0, 0x4e4f, 0xa3, 0x69, 0xb6, 0x6f, 0xa8, 0xd5, 0x43, 0x85 \ + } + +// +// Forward reference for pure ANSI compatability +// +EFI_FORWARD_DECLARATION (EFI_HII_CONFIG_ACCESS_PROTOCOL); + +typedef UINTN EFI_BROWSER_ACTION; + +#define EFI_BROWSER_ACTION_CHANGING 0 +#define EFI_BROWSER_ACTION_CHANGED 1 + + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_ACCESS_EXTRACT_CONFIG) ( + IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, + IN CONST EFI_STRING Request, + OUT EFI_STRING *Progress, + OUT EFI_STRING *Results + ) +/*++ + + Routine Description: + This function allows a caller to extract the current configuration for one + or more named elements from the target driver. + + Arguments: + This - Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL. + Request - A null-terminated Unicode string in format. + Progress - On return, points to a character in the Request string. + Points to the string's null terminator if request was successful. + Points to the most recent '&' before the first failing name/value + pair (or the beginning of the string if the failure is in the + first name/value pair) if the request was not successful. + Results - A null-terminated Unicode string in format which + has all values filled in for the names in the Request string. + String to be allocated by the called function. + + Returns: + EFI_SUCCESS - The Results is filled with the requested values. + EFI_OUT_OF_RESOURCES - Not enough memory to store the results. + EFI_INVALID_PARAMETER - Request is NULL, illegal syntax, or unknown name. + EFI_NOT_FOUND - Routing data doesn't match any storage in this driver. + +--*/ +; + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_ACCESS_ROUTE_CONFIG) ( + IN EFI_HII_CONFIG_ACCESS_PROTOCOL *This, + IN CONST EFI_STRING Configuration, + OUT EFI_STRING *Progress + ) +/*++ + + Routine Description: + This function processes the results of changes in configuration. + + Arguments: + This - Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL. + Configuration - A null-terminated Unicode string in format. + Progress - A pointer to a string filled in with the offset of the most + recent '&' before the first failing name/value pair (or the + beginning of the string if the failure is in the first + name/value pair) or the terminating NULL if all was successful. + + Returns: + EFI_SUCCESS - The Results is processed successfully. + EFI_INVALID_PARAMETER - Configuration is NULL. + EFI_NOT_FOUND - Routing data doesn't match any storage in this driver. + +--*/ +; + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_ACCESS_FORM_CALLBACK) ( + IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, + IN EFI_BROWSER_ACTION Action, + IN EFI_QUESTION_ID QuestionId, + IN UINT8 Type, + IN EFI_IFR_TYPE_VALUE *Value, + OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest + ) +/*++ + + Routine Description: + This function processes the results of changes in configuration. + + Arguments: + This - Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL. + Action - Specifies the type of action taken by the browser. + QuestionId - A unique value which is sent to the original exporting driver + so that it can identify the type of data to expect. + Type - The type of value for the question. + Value - A pointer to the data being sent to the original exporting driver. + ActionRequest - On return, points to the action requested by the callback function. + + Returns: + EFI_SUCCESS - The callback successfully handled the action. + EFI_OUT_OF_RESOURCES - Not enough storage is available to hold the variable and its data. + EFI_DEVICE_ERROR - The variable could not be saved. + EFI_UNSUPPORTED - The specified Action is not supported by the callback. + +--*/ +; + +typedef struct _EFI_HII_CONFIG_ACCESS_PROTOCOL { + EFI_HII_ACCESS_EXTRACT_CONFIG ExtractConfig; + EFI_HII_ACCESS_ROUTE_CONFIG RouteConfig; + EFI_HII_ACCESS_FORM_CALLBACK Callback; +} EFI_HII_CONFIG_ACCESS_PROTOCOL; + +extern EFI_GUID gEfiHiiConfigAccessProtocolGuid; + +#endif diff --git a/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiConfigRouting/HiiConfigRouting.c b/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiConfigRouting/HiiConfigRouting.c new file mode 100644 index 0000000000..0bbf9a18d0 --- /dev/null +++ b/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiConfigRouting/HiiConfigRouting.c @@ -0,0 +1,27 @@ +/*++ + +Copyright (c) 2007, Intel Corporation +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. + +Module Name: + + HiiConfigRouting.c + +Abstract: + + EFI_HII_CONFIG_ROUTING_PROTOCOL as defined in UEFI 2.1 spec. + +--*/ + +#include "EfiSpec.h" +#include EFI_PROTOCOL_DEFINITION (HiiConfigRouting) + +EFI_GUID gEfiHiiConfigRoutingProtocolGuid = EFI_HII_CONFIG_ROUTING_PROTOCOL_GUID; + +EFI_GUID_STRING(&gEfiHiiConfigRoutingProtocolGuid, "HII Config Routing Protocol", "HII Config Routing 2.1 protocol"); diff --git a/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiConfigRouting/HiiConfigRouting.h b/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiConfigRouting/HiiConfigRouting.h new file mode 100644 index 0000000000..de46fce14d --- /dev/null +++ b/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiConfigRouting/HiiConfigRouting.h @@ -0,0 +1,314 @@ +/*++ + +Copyright (c) 2007, Intel Corporation +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. + +Module Name: + + HiiConfigRouting.h + +Abstract: + + EFI_HII_CONFIG_ROUTING_PROTOCOL as defined in UEFI 2.1 spec. + +--*/ + +#ifndef __EFI_HII_CONFIG_ROUTING_H__ +#define __EFI_HII_CONFIG_ROUTING_H__ + +#include "EfiHii.h" + +#define EFI_HII_CONFIG_ROUTING_PROTOCOL_GUID \ + { \ + 0x587e72d7, 0xcc50, 0x4f79, 0x82, 0x09, 0xca, 0x29, 0x1f, 0xc1, 0xa1, 0x0f \ + } + +// +// Forward reference for pure ANSI compatability +// +EFI_FORWARD_DECLARATION (EFI_HII_CONFIG_ROUTING_PROTOCOL); + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_EXTRACT_CONFIG) ( + IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, + IN CONST EFI_STRING Request, + OUT EFI_STRING *Progress, + OUT EFI_STRING *Results + ) +/*++ + + Routine Description: + This function allows a caller to extract the current configuration + for one or more named elements from one or more drivers. + + Arguments: + This - A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance. + Request - A null-terminated Unicode string in format. + Progress - On return, points to a character in the Request string. Points to the string's null + terminator if request was successful. Points to the most recent '&' before the first + failing name / value pair (or the beginning of the string if the failure is in the first + name / value pair) if the request was not successful. + Results - Null-terminated Unicode string in format which has all + values filled in for the names in the Request string. String to be allocated by the called + function. + + Returns: + EFI_SUCCESS - The Results string is filled with the values + corresponding to all requested names. + EFI_OUT_OF_RESOURCES - Not enough memory to store the parts of the results + that must be stored awaiting possible future + protocols. + EFI_NOT_FOUND - Routing data doesn't match any known driver. + Progress set to the 'G' in "GUID" of the routing + header that doesn't match. Note: There is no + requirement that all routing data be validated before + any configuration extraction. + EFI_INVALID_PARAMETER - For example, passing in a NULL for the Request + parameter would result in this type of error. The + Progress parameter is set to NULL. + + EFI_INVALID_PARAMETER - Illegal syntax. Progress set to most recent & before + the error or the beginning of the string. + + EFI_INVALID_PARAMETER - Unknown name. Progress points to the & before + the name in question. + +--*/ +; + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_EXPORT_CONFIG) ( + IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, + OUT EFI_STRING *Results + ) +/*++ + + Routine Description: + This function allows the caller to request the current configuration for the + entirety of the current HII database and returns the data in a null-terminated Unicode string. + + Arguments: + This - A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance. + Results - Null-terminated Unicode string in format which has all + values filled in for the names in the Request string. String to be allocated by the called + function. De-allocation is up to the caller. + + Returns: + EFI_SUCCESS - The Results string is filled with the values + corresponding to all requested names. + EFI_OUT_OF_RESOURCES - Not enough memory to store the parts of the results + that must be stored awaiting possible future + protocols. + EFI_INVALID_PARAMETER - For example, passing in a NULL for the Results + parameter would result in this type of error. + +--*/ +; + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_ROUTE_CONFIG) ( + IN EFI_HII_CONFIG_ROUTING_PROTOCOL *This, + IN CONST EFI_STRING Configuration, + OUT EFI_STRING *Progress + ) +/*++ + + Routine Description: + This function processes the results of processing forms and routes it to the + appropriate handlers or storage. + + Arguments: + This - A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance. + Configuration - A null-terminated Unicode string in format. + Progress - A pointer to a string filled in with the offset of the most recent "&" before the first + failing name / value pair (or the beginning of the string if the failure is in the first + name / value pair) or the terminating NULL if all was successful. + + Returns: + EFI_SUCCESS - The results have been distributed or are awaiting + distribution. + EFI_OUT_OF_RESOURCES - Not enough memory to store the parts of the results + that must be stored awaiting possible future + protocols. + EFI_INVALID_PARAMETER - Passing in a NULL for the Configuration + parameter would result in this type of error. + EFI_NOT_FOUND - Target for the specified routing data was not found. + +--*/ +; + + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_BLOCK_TO_CONFIG) ( + IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, + IN CONST EFI_STRING ConfigRequest, + IN CONST UINT8 *Block, + IN CONST UINTN BlockSize, + OUT EFI_STRING *Config, + OUT EFI_STRING *Progress + ) +/*++ + + Routine Description: + This helper function is to be called by drivers to map configuration data stored + in byte array ("block") formats such as UEFI Variables into current configuration strings. + + Arguments: + This - A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance. + ConfigRequest - A null-terminated Unicode string in format. + Block - Array of bytes defining the block's configuration. + BlockSize - Length in bytes of Block. + Config - Filled-in configuration string. String allocated by the function. + Returned only if call is successful. + Progress - A pointer to a string filled in with the offset of the most recent "&" before the first + failing name / value pair (or the beginning of the string if the failure is in the first + name / value pair) or the terminating NULL if all was successful. + + Returns: + EFI_SUCCESS - The request succeeded. Progress points to the null + terminator at the end of the ConfigRequest + string. + EFI_OUT_OF_RESOURCES - Not enough memory to allocate Config. + Progress points to the first character of + ConfigRequest. + EFI_INVALID_PARAMETER - Passing in a NULL for the ConfigRequest or + Block parameter would result in this type of + error. Progress points to the first character of + ConfigRequest. + EFI_NOT_FOUND - Target for the specified routing data was not found. + Progress points to the "G" in "GUID" of the + errant routing data. + EFI_DEVICE_ERROR - Block not large enough. Progress undefined. + EFI_INVALID_PARAMETER - Encountered non formatted string. + Block is left updated and Progress points at the "&" + preceding the first non-. + +--*/ +; + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_CONFIG_TO_BLOCK) ( + IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, + IN CONST EFI_STRING ConfigResp, + IN OUT UINT8 *Block, + IN OUT UINTN *BlockSize, + OUT EFI_STRING *Progress + ) +/*++ + + Routine Description: + This helper function is to be called by drivers to map configuration strings + to configurations stored in byte array ("block") formats such as UEFI Variables. + + Arguments: + This - A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance. + ConfigResp - A null-terminated Unicode string in format. + Block - A possibly null array of bytes representing the current block. + Only bytes referenced in the ConfigResp string in the block are modified. + If this parameter is null or if the *BlockSize parameter is (on input) + shorter than required by the Configuration string, only the BlockSize + parameter is updated and an appropriate status (see below) is returned. + + BlockSize - The length of the Block in units of UINT8. On input, this is the size of the Block. + On output, if successful, contains the index of the last modified byte in the Block. + + Progress - On return, points to an element of the ConfigResp string filled in with the offset of + the most recent "&" before the first failing name / value pair (or the beginning of the + string if the failure is in the first name / value pair) or the terminating NULL if all was + successful. + Returns: + EFI_SUCCESS - The request succeeded. Progress points to the null + terminator at the end of the ConfigResp + string. + EFI_OUT_OF_RESOURCES - Not enough memory to allocate Config. + Progress points to the first character of + ConfigResp. + EFI_INVALID_PARAMETER - Passing in a NULL for the ConfigResp or + Block parameter would result in this type of error. + Progress points to the first character of + ConfigResp. + EFI_NOT_FOUND - Target for the specified routing data was not found. + Progress points to the "G" in "GUID" of the + errant routing data. + EFI_INVALID_PARAMETER - Encountered non formatted name / + value pair. Block is left updated and + Progress points at the "&" preceding the first + non-. + +--*/ +; + +typedef +EFI_STATUS +(EFIAPI * EFI_HII_GET_ALT_CFG) ( + IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, + IN CONST EFI_STRING Configuration, + IN CONST EFI_GUID *Guid, + IN CONST EFI_STRING Name, + IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, + IN CONST UINT16 *AltCfgId, + OUT EFI_STRING *AltCfgResp + ) +/*++ + + Routine Description: + This helper function is to be called by drivers to extract portions of + a larger configuration string. + + Arguments: + This - A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance. + Configuration - A null-terminated Unicode string in format. + Guid - A pointer to the GUID value to search for in the + routing portion of the ConfigResp string when retrieving + the requested data. If Guid is NULL, then all GUID + values will be searched for. + Name - A pointer to the NAME value to search for in the + routing portion of the ConfigResp string when retrieving + the requested data. If Name is NULL, then all Name + values will be searched for. + DevicePath - A pointer to the PATH value to search for in the + routing portion of the ConfigResp string when retrieving + the requested data. If DevicePath is NULL, then all + DevicePath values will be searched for. + AltCfgId - A pointer to the ALTCFG value to search for in the + routing portion of the ConfigResp string when retrieving + the requested data. If this parameter is NULL, + then the current setting will be retrieved. + AltCfgResp - A pointer to a buffer which will be allocated by the + function which contains the retrieved string as requested. + This buffer is only allocated if the call was successful. + + Returns: + EFI_SUCCESS - The request succeeded. The requested data was extracted + and placed in the newly allocated AltCfgResp buffer. + EFI_OUT_OF_RESOURCES - Not enough memory to allocate AltCfgResp. + EFI_INVALID_PARAMETER - Any parameter is invalid. + EFI_NOT_FOUND - Target for the specified routing data was not found. + +--*/ +; + + +typedef struct _EFI_HII_CONFIG_ROUTING_PROTOCOL { + EFI_HII_EXTRACT_CONFIG ExtractConfig; + EFI_HII_EXPORT_CONFIG ExportConfig; + EFI_HII_ROUTE_CONFIG RouteConfig; + EFI_HII_BLOCK_TO_CONFIG BlockToConfig; + EFI_HII_CONFIG_TO_BLOCK ConfigToBlock; + EFI_HII_GET_ALT_CFG GetAltConfig; +} EFI_HII_CONFIG_ROUTING_PROTOCOL; + +extern EFI_GUID gEfiHiiConfigRoutingProtocolGuid; + +#endif diff --git a/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiDatabase/HiiDatabase.c b/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiDatabase/HiiDatabase.c new file mode 100644 index 0000000000..1d706f4f62 --- /dev/null +++ b/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiDatabase/HiiDatabase.c @@ -0,0 +1,29 @@ +/*++ + +Copyright (c) 2007, Intel Corporation +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. + +Module Name: + + HiiDatabase.c + +Abstract: + + EFI_HII_DATABASE_PROTOCOL + +Revision History + +--*/ + +#include "EfiSpec.h" +#include EFI_PROTOCOL_DEFINITION (HiiDatabase) + +EFI_GUID gEfiHiiDatabaseProtocolGuid = EFI_HII_DATABASE_PROTOCOL_GUID; + +EFI_GUID_STRING(&gEfiHiiDatabaseProtocolGuid, "EFI HII DATABASE Protocol", "UEFI 2.1 HII DATABASE Protocol"); diff --git a/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiDatabase/HiiDatabase.h b/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiDatabase/HiiDatabase.h new file mode 100644 index 0000000000..5c47e6c1db --- /dev/null +++ b/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiDatabase/HiiDatabase.h @@ -0,0 +1,450 @@ +/*++ + +Copyright (c) 2007, Intel Corporation +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. + +Module Name: + + HiiDatabase.h + +Abstract: + + EFI_HII_DATABASE_PROTOCOL from UEFI 2.1 specification. + + This protocol is a database manager for HII related data structures. + +Revision History + +--*/ + +#ifndef __EFI_HII_DATABASE_PROTOCOL_H__ +#define __EFI_HII_DATABASE_PROTOCOL_H__ + +#include "EfiHii.h" + +// +// Global ID for the Hii Database Protocol. +// + +#define EFI_HII_DATABASE_PROTOCOL_GUID \ + { \ + 0xef9fc172, 0xa1b2, 0x4693, 0xb3, 0x27, 0x6d, 0x32, 0xfc, 0x41, 0x60, 0x42 \ + } + +#define EFI_HII_SET_KEYBOARD_LAYOUT_EVENT_GUID \ + { \ + 0x14982a4f, 0xb0ed, 0x45b8, 0xa8, 0x11, 0x5a, 0x7a, 0x9b, 0xc2, 0x32, 0xdf \ + } + +EFI_FORWARD_DECLARATION (EFI_HII_DATABASE_PROTOCOL); + +typedef UINTN EFI_HII_DATABASE_NOTIFY_TYPE; + +#define EFI_HII_DATABASE_NOTIFY_NEW_PACK 0x00000001 +#define EFI_HII_DATABASE_NOTIFY_REMOVE_PACK 0x00000002 +#define EFI_HII_DATABASE_NOTIFY_EXPORT_PACK 0x00000004 +#define EFI_HII_DATABASE_NOTIFY_ADD_PACK 0x00000008 + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_DATABASE_NOTIFY) ( + IN UINT8 PackageType, + IN CONST EFI_GUID *PackageGuid, + IN CONST EFI_HII_PACKAGE_HEADER *Package, + IN EFI_HII_HANDLE Handle, + IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType + ) +/*++ + + Routine Description: + Functions which are registered to receive notification of database events have this prototype. The + actual event is encoded in NotifyType. The following table describes how PackageType, + PackageGuid, Handle, and Package are used for each of the notification types. + + Arguments: + PackageType - Package type of the notification. + PackageGuid - If PackageType is EFI_HII_PACKAGE_TYPE_GUID, then this is the pointer to + the GUID which must match the Guid field of + EFI_HII_GUID_PACKAGE_GUID_HDR. Otherwise, it must be NULL. + Package - Points to the package referred to by the notification. + Handle - The handle of the package list which contains the specified package. + NotifyType - The type of change concerning the database. + + Returns: + EFI status code. + +--*/ +; + +// +// EFI_HII_DATABASE_PROTOCOL protocol prototypes +// + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_DATABASE_NEW_PACK) ( + IN CONST EFI_HII_DATABASE_PROTOCOL *This, + IN CONST EFI_HII_PACKAGE_LIST_HEADER *PackageList, + IN CONST EFI_HANDLE DriverHandle, + OUT EFI_HII_HANDLE *Handle + ) +/*++ + + Routine Description: + This function adds the packages in the package list to the database and returns a handle. If there is a + EFI_DEVICE_PATH_PROTOCOL associated with the DriverHandle, then this function will + create a package of type EFI_PACKAGE_TYPE_DEVICE_PATH and add it to the package list. + + Arguments: + This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance. + PackageList - A pointer to an EFI_HII_PACKAGE_LIST_HEADER structure. + DriverHandle - Associate the package list with this EFI handle. + Handle - A pointer to the EFI_HII_HANDLE instance. + + Returns: + EFI_SUCCESS - The package list associated with the Handle + was added to the HII database. + EFI_OUT_OF_RESOURCES - Unable to allocate necessary resources for the + new database contents. + EFI_INVALID_PARAMETER - PackageList is NULL or Handle is NULL. + +--*/ +; + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_DATABASE_REMOVE_PACK) ( + IN CONST EFI_HII_DATABASE_PROTOCOL *This, + IN EFI_HII_HANDLE Handle + ) +/*++ + + Routine Description: + This function removes the package list that is associated with a handle Handle + from the HII database. Before removing the package, any registered functions + with the notification type REMOVE_PACK and the same package type will be called. + + Arguments: + This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance. + Handle - The handle that was registered to the data that is requested + for removal. + + Returns: + EFI_SUCCESS - The data associated with the Handle was removed from + the HII database. + EFI_NOT_FOUND - The specified PackageList could not be found in database. + EFI_INVALID_PARAMETER - The Handle was not valid. + +--*/ +; + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_DATABASE_UPDATE_PACK) ( + IN CONST EFI_HII_DATABASE_PROTOCOL *This, + IN EFI_HII_HANDLE Handle, + IN CONST EFI_HII_PACKAGE_LIST_HEADER *PackageList + ) +/*++ + + Routine Description: + This function updates the existing package list (which has the specified Handle) + in the HII databases, using the new package list specified by PackageList. + + Arguments: + This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance. + Handle - The handle that was registered to the data that is + requested to be updated. + PackageList - A pointer to an EFI_HII_PACKAGE_LIST_HEADER package. + + Returns: + EFI_SUCCESS - The HII database was successfully updated. + EFI_OUT_OF_RESOURCES - Unable to allocate enough memory for the updated database. + EFI_INVALID_PARAMETER - Handle or PackageList was NULL. + EFI_NOT_FOUND - The Handle was not valid or could not be found in database. + +--*/ +; + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_DATABASE_LIST_PACKS) ( + IN CONST EFI_HII_DATABASE_PROTOCOL *This, + IN UINT8 PackageType, + IN CONST EFI_GUID *PackageGuid, + IN OUT UINTN *HandleBufferLength, + OUT EFI_HII_HANDLE *Handle + ) +/*++ + + Routine Description: + This function returns a list of the package handles of the specified type + that are currently active in the database. The pseudo-type + EFI_HII_PACKAGE_TYPE_ALL will cause all package handles to be listed. + + Arguments: + This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance. + PackageType - Specifies the package type of the packages to list or + EFI_HII_PACKAGE_TYPE_ALL for all packages to be listed. + PackageGuid - If PackageType is EFI_HII_PACKAGE_TYPE_GUID, then this + is the pointer to the GUID which must match the Guid + field of EFI_HII_GUID_PACKAGE_GUID_HDR. Otherwise, + it must be NULL. + HandleBufferLength - On input, a pointer to the length of the handle buffer. + On output, the length of the handle buffer that is + required for the handles found. + Handle - An array of EFI_HII_HANDLE instances returned. + + Returns: + EFI_SUCCESS - The matching handles are outputed successfully. + EFI_BUFFER_TO_SMALL - The HandleBufferLength parameter indicates that + Handle is too small to support the number of handles. + HandleBufferLength is updated with a value that will + enable the data to fit. + EFI_NOT_FOUND - No matching handle could not be found in database. + EFI_INVALID_PARAMETER - Handle or HandleBufferLength was NULL. + +--*/ +; + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_DATABASE_EXPORT_PACKS) ( + IN CONST EFI_HII_DATABASE_PROTOCOL *This, + IN EFI_HII_HANDLE Handle, + IN OUT UINTN *BufferSize, + OUT EFI_HII_PACKAGE_LIST_HEADER *Buffer + ) +/*++ + + Routine Description: + This function will export one or all package lists in the database to a buffer. + For each package list exported, this function will call functions registered + with EXPORT_PACK and then copy the package list to the buffer. + + Arguments: + This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance. + Handle - An EFI_HII_HANDLE that corresponds to the desired package + list in the HII database to export or NULL to indicate + all package lists should be exported. + BufferSize - On input, a pointer to the length of the buffer. + On output, the length of the buffer that is required for + the exported data. + Buffer - A pointer to a buffer that will contain the results of + the export function. + + Returns: + EFI_SUCCESS - Package exported. + EFI_BUFFER_TO_SMALL - The HandleBufferLength parameter indicates that Handle + is too small to support the number of handles. + HandleBufferLength is updated with a value that will + enable the data to fit. + EFI_NOT_FOUND - The specifiecd Handle could not be found in the current + database. + EFI_INVALID_PARAMETER - Handle or Buffer or BufferSize was NULL. + +--*/ +; + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_DATABASE_REGISTER_NOTIFY) ( + IN CONST EFI_HII_DATABASE_PROTOCOL *This, + IN UINT8 PackageType, + IN CONST EFI_GUID *PackageGuid, + IN CONST EFI_HII_DATABASE_NOTIFY PackageNotifyFn, + IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType, + OUT EFI_HANDLE *NotifyHandle + ) +/*++ + + Routine Description: + This function registers a function which will be called when specified actions related to packages of + the specified type occur in the HII database. By registering a function, other HII-related drivers are + notified when specific package types are added, removed or updated in the HII database. + Each driver or application which registers a notification should use + EFI_HII_DATABASE_PROTOCOL.UnregisterPackageNotify() before exiting. + + Arguments: + This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance. + PackageType - Specifies the package type of the packages to list or + EFI_HII_PACKAGE_TYPE_ALL for all packages to be listed. + PackageGuid - If PackageType is EFI_HII_PACKAGE_TYPE_GUID, then this is the pointer to + the GUID which must match the Guid field of + EFI_HII_GUID_PACKAGE_GUID_HDR. Otherwise, it must be NULL. + PackageNotifyFn - Points to the function to be called when the event specified by + NotificationType occurs. + NotifyType - Describes the types of notification which this function will be receiving. + NotifyHandle - Points to the unique handle assigned to the registered notification. Can be used in + EFI_HII_DATABASE_PROTOCOL.UnregisterPackageNotify() to stop notifications. + + Returns: + EFI_SUCCESS - Notification registered successfully. + EFI_OUT_OF_RESOURCES - Unable to allocate necessary data structures + EFI_INVALID_PARAMETER - NotifyHandle is NULL. + EFI_INVALID_PARAMETER - PackageGuid is not NULL when PackageType is not + EFI_HII_PACKAGE_TYPE_GUID. + EFI_INVALID_PARAMETER - PackageGuid is NULL when PackageType is EFI_HII_PACKAGE_TYPE_GUID. + +--*/ +; + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_DATABASE_UNREGISTER_NOTIFY) ( + IN CONST EFI_HII_DATABASE_PROTOCOL *This, + IN EFI_HANDLE NotificationHandle + ) +/*++ + + Routine Description: + Removes the specified HII database package-related notification. + + Arguments: + This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance. + NotifyHandle - The handle of the notification function being unregistered. + + Returns: + EFI_SUCCESS - Notification is unregistered successfully. + EFI_INVALID_PARAMETER - The Handle is invalid. + +--*/ +; + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_FIND_KEYBOARD_LAYOUTS) ( + IN EFI_HII_DATABASE_PROTOCOL *This, + IN OUT UINT16 *KeyGuidBufferLength, + OUT EFI_GUID *KeyGuidBuffer + ) +/*++ + + Routine Description: + This routine retrieves an array of GUID values for each keyboard layout that + was previously registered in the system. + + Arguments: + This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance. + KeyGuidBufferLength - On input, a pointer to the length of the keyboard GUID + buffer. On output, the length of the handle buffer + that is required for the handles found. + KeyGuidBuffer - An array of keyboard layout GUID instances returned. + + Returns: + EFI_SUCCESS - KeyGuidBuffer was updated successfully. + EFI_BUFFER_TOO_SMALL - The KeyGuidBufferLength parameter indicates + that KeyGuidBuffer is too small to support the + number of GUIDs. KeyGuidBufferLength is + updated with a value that will enable the data to fit. + EFI_INVALID_PARAMETER - The KeyGuidBuffer or KeyGuidBufferLength was NULL. + EFI_NOT_FOUND - There was no keyboard layout. + +--*/ +; + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_GET_KEYBOARD_LAYOUT) ( + IN EFI_HII_DATABASE_PROTOCOL *This, + IN EFI_GUID *KeyGuid, + IN OUT UINT16 *KeyboardLayoutLength, + OUT EFI_HII_KEYBOARD_LAYOUT *KeyboardLayout + ) +/*++ + + Routine Description: + This routine retrieves the requested keyboard layout. The layout is a physical description of the keys + on a keyboard and the character(s) that are associated with a particular set of key strokes. + + Arguments: + This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance. + KeyGuid - A pointer to the unique ID associated with a given keyboard layout. If KeyGuid is + NULL then the current layout will be retrieved. + KeyboardLayoutLength - On input, a pointer to the length of the KeyboardLayout buffer. + On output, the length of the data placed into KeyboardLayout. + KeyboardLayout - A pointer to a buffer containing the retrieved keyboard layout. + + Returns: + EFI_SUCCESS - The keyboard layout was retrieved successfully. + EFI_NOT_FOUND - The requested keyboard layout was not found. + EFI_INVALID_PARAMETER - The KeyboardLayout or KeyboardLayoutLength was NULL. + +--*/ +; + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_SET_KEYBOARD_LAYOUT) ( + IN EFI_HII_DATABASE_PROTOCOL *This, + IN EFI_GUID *KeyGuid + ) +/*++ + + Routine Description: + This routine sets the default keyboard layout to the one referenced by KeyGuid. When this routine + is called, an event will be signaled of the EFI_HII_SET_KEYBOARD_LAYOUT_EVENT_GUID + group type. This is so that agents which are sensitive to the current keyboard layout being changed + can be notified of this change. + + Arguments: + This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance. + KeyGuid - A pointer to the unique ID associated with a given keyboard layout. + + Returns: + EFI_SUCCESS - The current keyboard layout was successfully set. + EFI_NOT_FOUND - The referenced keyboard layout was not found, so action was taken. + EFI_INVALID_PARAMETER - The KeyGuid was NULL. + +--*/ +; + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_DATABASE_GET_PACK_HANDLE) ( + IN EFI_HII_DATABASE_PROTOCOL *This, + IN EFI_HII_HANDLE PackageListHandle, + OUT EFI_HANDLE *DriverHandle + ) +/*++ + + Routine Description: + Return the EFI handle associated with a package list. + + Arguments: + This - A pointer to the EFI_HII_DATABASE_PROTOCOL instance. + PackageListHandle - An EFI_HII_HANDLE that corresponds to the desired package list in the + HIIdatabase. + DriverHandle - On return, contains the EFI_HANDLE which was registered with the package list in + NewPackageList(). + + Returns: + EFI_SUCCESS - The DriverHandle was returned successfully. + EFI_INVALID_PARAMETER - The PackageListHandle was not valid or DriverHandle was NULL. + +--*/ +; + +typedef struct _EFI_HII_DATABASE_PROTOCOL { + EFI_HII_DATABASE_NEW_PACK NewPackageList; + EFI_HII_DATABASE_REMOVE_PACK RemovePackageList; + EFI_HII_DATABASE_UPDATE_PACK UpdatePackageList; + EFI_HII_DATABASE_LIST_PACKS ListPackageLists; + EFI_HII_DATABASE_EXPORT_PACKS ExportPackageLists; + EFI_HII_DATABASE_REGISTER_NOTIFY RegisterPackageNotify; + EFI_HII_DATABASE_UNREGISTER_NOTIFY UnregisterPackageNotify; + EFI_HII_FIND_KEYBOARD_LAYOUTS FindKeyboardLayouts; + EFI_HII_GET_KEYBOARD_LAYOUT GetKeyboardLayout; + EFI_HII_SET_KEYBOARD_LAYOUT SetKeyboardLayout; + EFI_HII_DATABASE_GET_PACK_HANDLE GetPackageListHandle; +} EFI_HII_DATABASE_PROTOCOL; + +extern EFI_GUID gEfiHiiDatabaseProtocolGuid; + +#endif diff --git a/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiFont/HiiFont.c b/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiFont/HiiFont.c new file mode 100644 index 0000000000..9e3213fb3d --- /dev/null +++ b/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiFont/HiiFont.c @@ -0,0 +1,29 @@ +/*++ + +Copyright (c) 2007, Intel Corporation +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. + +Module Name: + + HiiFont.c + +Abstract: + + EFI_HII_FONT_PROTOCOL + +Revision History + +--*/ + +#include "EfiSpec.h" +#include EFI_PROTOCOL_DEFINITION (HiiFont) + +EFI_GUID gEfiHiiFontProtocolGuid = EFI_HII_FONT_PROTOCOL_GUID; + +EFI_GUID_STRING(&gEfiHiiFontProtocolGuid, "EFI HII FONT Protocol", "UEFI 2.1 HII FONT Protocol"); diff --git a/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiFont/HiiFont.h b/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiFont/HiiFont.h new file mode 100644 index 0000000000..741f4d7335 --- /dev/null +++ b/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiFont/HiiFont.h @@ -0,0 +1,283 @@ +/*++ + +Copyright (c) 2007, Intel Corporation +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. + +Module Name: + + HiiFont.h + +Abstract: + + EFI_HII_FONT_PROTOCOL from UEFI 2.1 specification. + + This protocol provides interfaces to retrieve font information. + +Revision History + +--*/ + +#ifndef __EFI_HII_FONT_PROTOCOL_H__ +#define __EFI_HII_FONT_PROTOCOL_H__ + +#include EFI_PROTOCOL_DEFINITION (GraphicsOutput) +#include EFI_PROTOCOL_DEFINITION (HiiImage) + +// +// Global ID for the Hii Font Protocol. +// + +#define EFI_HII_FONT_PROTOCOL_GUID \ + { \ + 0xe9ca4775, 0x8657, 0x47fc, 0x97, 0xe7, 0x7e, 0xd6, 0x5a, 0x8, 0x43, 0x24 \ + } + +EFI_FORWARD_DECLARATION (EFI_HII_FONT_PROTOCOL); + +typedef UINT32 EFI_HII_OUT_FLAGS; +typedef UINT32 EFI_FONT_INFO_MASK; +typedef VOID* EFI_FONT_HANDLE; + +typedef struct _EFI_HII_ROW_INFO { + UINTN StartIndex; + UINTN EndIndex; + UINTN LineHeight; + UINTN LineWidth; + UINTN BaselineOffset; +} EFI_HII_ROW_INFO; + +typedef struct { + UINT32 FontStyle; + UINT16 FontSize; // character cell size in pixels + CHAR16 FontName[1]; +} EFI_FONT_INFO; + +typedef struct _EFI_FONT_DISPLAY_INFO { + EFI_GRAPHICS_OUTPUT_BLT_PIXEL ForegroundColor; + EFI_GRAPHICS_OUTPUT_BLT_PIXEL BackgroundColor; + EFI_FONT_INFO_MASK FontInfoMask; + EFI_FONT_INFO FontInfo; +} EFI_FONT_DISPLAY_INFO; + +#define EFI_HII_OUT_FLAG_CLIP 0x00000001 +#define EFI_HII_OUT_FLAG_WRAP 0x00000002 +#define EFI_HII_OUT_FLAG_CLEAN_Y 0x00000004 +#define EFI_HII_OUT_FLAG_CLEAN_X 0x00000008 +#define EFI_HII_OUT_FLAG_TRANSPARENT 0x00000010 +#define EFI_HII_IGNORE_IF_NO_GLYPH 0x00000020 +#define EFI_HII_IGNORE_LINE_BREAK 0x00000040 +#define EFI_HII_DIRECT_TO_SCREEN 0x00000080 + +#define EFI_FONT_INFO_SYS_FONT 0x00000001 +#define EFI_FONT_INFO_SYS_SIZE 0x00000002 +#define EFI_FONT_INFO_SYS_STYLE 0x00000004 +#define EFI_FONT_INFO_SYS_FORE_COLOR 0x00000010 +#define EFI_FONT_INFO_SYS_BACK_COLOR 0x00000020 +#define EFI_FONT_INFO_RESIZE 0x00001000 +#define EFI_FONT_INFO_RESTYLE 0x00002000 +#define EFI_FONT_INFO_ANY_FONT 0x00010000 +#define EFI_FONT_INFO_ANY_SIZE 0x00020000 +#define EFI_FONT_INFO_ANY_STYLE 0x00040000 + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_STRING_TO_IMAGE) ( + IN CONST EFI_HII_FONT_PROTOCOL *This, + IN EFI_HII_OUT_FLAGS Flags, + IN CONST EFI_STRING String, + IN CONST EFI_FONT_DISPLAY_INFO *StringInfo OPTIONAL, + IN OUT EFI_IMAGE_OUTPUT **Blt, + IN UINTN BltX, + IN UINTN BltY, + OUT EFI_HII_ROW_INFO **RowInfoArray OPTIONAL, + OUT UINTN *RowInfoArraySize OPTIONAL, + OUT UINTN *ColumnInfoArray OPTIONAL + ) +/*++ + + Routine Description: + Renders a string to a bitmap or to the display. + + Arguments: + This - A pointer to the EFI_HII_FONT_PROTOCOL instance. + Flags - Describes how the string is to be drawn. + String - Points to the null-terminated string to be displayed. + StringInfo - Points to the string output information, including the color and font. + If NULL, then the string will be output in the default system font and color. + Blt - If this points to a non-NULL on entry, this points to the image, which is Width pixels + wide and Height pixels high. The string will be drawn onto this image and + EFI_HII_OUT_FLAG_CLIP is implied. If this points to a NULL on entry, then a + buffer will be allocated to hold the generated image and the pointer updated on exit. It + is the callerĄ¯s responsibility to free this buffer. + BltX,BLTY - Specifies the offset from the left and top edge of the image of the first character cell in + the image. + RowInfoArray - If this is non-NULL on entry, then on exit, this will point to an allocated buffer + containing row information and RowInfoArraySize will be updated to contain the + number of elements. This array describes the characters which were at least partially + drawn and the heights of the rows. It is the callerĄ¯s responsibility to free this buffer. + RowInfoArraySize - If this is non-NULL on entry, then on exit it contains the number of elements in + RowInfoArray. + ColumnInfoArray - If this is non-NULL, then on return it will be filled with the horizontal offset for each + character in the string on the row where it is displayed. Non-printing characters will + have the offset ~0. The caller is responsible to allocate a buffer large enough so that + there is one entry for each character in the string, not including the null-terminator. It + is possible when character display is normalized that some character cells overlap. + + Returns: + EFI_SUCCESS - The string was successfully rendered. + EFI_OUT_OF_RESOURCES - Unable to allocate an output buffer for RowInfoArray or Blt. + EFI_INVALID_PARAMETER - The String was NULL. + +--*/ +; + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_STRING_ID_TO_IMAGE) ( + IN CONST EFI_HII_FONT_PROTOCOL *This, + IN EFI_HII_OUT_FLAGS Flags, + IN EFI_HII_HANDLE PackageList, + IN EFI_STRING_ID StringId, + IN CONST CHAR8* Language, + IN CONST EFI_FONT_DISPLAY_INFO *StringInfo OPTIONAL, + IN OUT EFI_IMAGE_OUTPUT **Blt, + IN UINTN BltX, + IN UINTN BltY, + OUT EFI_HII_ROW_INFO **RowInfoArray OPTIONAL, + OUT UINTN *RowInfoArraySize OPTIONAL, + OUT UINTN *ColumnInfoArray OPTIONAL + ) +/*++ + + Routine Description: + Render a string to a bitmap or the screen containing the contents of the specified string. + + Arguments: + This - A pointer to the EFI_HII_FONT_PROTOCOL instance. + Flags - Describes how the string is to be drawn. + PackageList - The package list in the HII database to search for the specified string. + StringId - The stringĄ¯s id, which is unique within PackageList. + Language - Points to the language for the retrieved string. If NULL, then the current system + language is used. + StringInfo - Points to the string output information, including the color and font. + If NULL, then the string will be output in the default system font and color. + Blt - If this points to a non-NULL on entry, this points to the image, which is Width pixels + wide and Height pixels high. The string will be drawn onto this image and + EFI_HII_OUT_FLAG_CLIP is implied. If this points to a NULL on entry, then a + buffer will be allocated to hold the generated image and the pointer updated on exit. It + is the callerĄ¯s responsibility to free this buffer. + BltX,BLTY - Specifies the offset from the left and top edge of the image of the first character cell in + the image. + RowInfoArray - If this is non-NULL on entry, then on exit, this will point to an allocated buffer + containing row information and RowInfoArraySize will be updated to contain the + number of elements. This array describes the characters which were at least partially + drawn and the heights of the rows. It is the callerĄ¯s responsibility to free this buffer. + RowInfoArraySize - If this is non-NULL on entry, then on exit it contains the number of elements in + RowInfoArray. + ColumnInfoArray - If this is non-NULL, then on return it will be filled with the horizontal offset for each + character in the string on the row where it is displayed. Non-printing characters will + have the offset ~0. The caller is responsible to allocate a buffer large enough so that + there is one entry for each character in the string, not including the null-terminator. It + is possible when character display is normalized that some character cells overlap. + + Returns: + EFI_SUCCESS - The string was successfully rendered. + EFI_OUT_OF_RESOURCES - Unable to allocate an output buffer for RowInfoArray or Blt. + EFI_INVALID_PARAMETER - The String was NULL. + +--*/ +; + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_GET_GLYPH) ( + IN CONST EFI_HII_FONT_PROTOCOL *This, + IN CHAR16 Char, + IN CONST EFI_FONT_DISPLAY_INFO *StringInfo, + OUT EFI_IMAGE_OUTPUT **Blt, + OUT UINTN *Baseline OPTIONAL + ) +/*++ + + Routine Description: + Convert the glyph for a single character into a bitmap. + + Arguments: + This - A pointer to the EFI_HII_FONT_PROTOCOL instance. + Char - Character to retrieve. + StringInfo - Points to the string font and color information or NULL if the string should use the + default system font and color. + Blt - Thus must point to a NULL on entry. A buffer will be allocated to hold the output and + the pointer updated on exit. It is the callerĄ¯s responsibility to free this buffer. + Baseline - Number of pixels from the bottom of the bitmap to the baseline. + + Returns: + EFI_SUCCESS - Glyph bitmap created. + EFI_OUT_OF_RESOURCES - Unable to allocate the output buffer Blt. + EFI_WARN_UNKNOWN_GLYPH - The glyph was unknown and was + replaced with the glyph for Unicode + character 0xFFFD. + EFI_INVALID_PARAMETER - Blt is NULL or *Blt is not NULL. + +--*/ +; + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_GET_FONT_INFO) ( + IN CONST EFI_HII_FONT_PROTOCOL *This, + IN OUT EFI_FONT_HANDLE *FontHandle, + IN CONST EFI_FONT_DISPLAY_INFO *StringInfoIn, + OUT EFI_FONT_DISPLAY_INFO **StringInfoOut, + IN CONST EFI_STRING String OPTIONAL + ) +/*++ + + Routine Description: + This function iterates through fonts which match the specified font, using + the specified criteria. If String is non-NULL, then all of the characters in + the string must exist in order for a candidate font to be returned. + + Arguments: + This - A pointer to the EFI_HII_FONT_PROTOCOL instance. + FontHandle - On entry, points to the font handle returned by a + previous call to GetFontInfo() or NULL to start with the + first font. On return, points to the returned font handle or + points to NULL if there are no more matching fonts. + StringInfoIn - Upon entry, points to the font to return information about. + StringInfoOut - Upon return, contains the matching fontĄ¯s information. + If NULL, then no information is returned. + It's caller's responsibility to free this buffer. + String - Points to the string which will be tested to determine + if all characters are available. If NULL, then any font + is acceptable. + + Returns: + EFI_SUCCESS - Matching font returned successfully. + EFI_NOT_FOUND - No matching font was found. + EFI_INVALID_PARAMETER - StringInfoIn is NULL. + EFI_OUT_OF_RESOURCES - There were insufficient resources to complete the request. + +--*/ +; + + +// +// Interface structure for the EFI_HII_FONT_PROTOCOL +// +typedef struct _EFI_HII_FONT_PROTOCOL { + EFI_HII_STRING_TO_IMAGE StringToImage; + EFI_HII_STRING_ID_TO_IMAGE StringIdToImage; + EFI_HII_GET_GLYPH GetGlyph; + EFI_HII_GET_FONT_INFO GetFontInfo; +} EFI_HII_FONT_PROTOCOL; + +extern EFI_GUID gEfiHiiFontProtocolGuid; + +#endif diff --git a/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiImage/HiiImage.c b/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiImage/HiiImage.c new file mode 100644 index 0000000000..e1e643dcc9 --- /dev/null +++ b/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiImage/HiiImage.c @@ -0,0 +1,29 @@ +/*++ + +Copyright (c) 2007, Intel Corporation +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. + +Module Name: + + HiiImage.c + +Abstract: + + EFI_HII_IMAGE_PROTOCOL + +Revision History + +--*/ + +#include "EfiSpec.h" +#include EFI_PROTOCOL_DEFINITION (HiiImage) + +EFI_GUID gEfiHiiImageProtocolGuid = EFI_HII_IMAGE_PROTOCOL_GUID; + +EFI_GUID_STRING(&gEfiHiiImageProtocolGuid, "EFI HII IMAGE Protocol", "UEFI 2.1 HII IMAGE Protocol"); diff --git a/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiImage/HiiImage.h b/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiImage/HiiImage.h new file mode 100644 index 0000000000..dcd4889df0 --- /dev/null +++ b/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiImage/HiiImage.h @@ -0,0 +1,254 @@ +/*++ + +Copyright (c) 2007, Intel Corporation +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. + +Module Name: + + HiiImage.h + +Abstract: + + EFI_HII_IMAGE_PROTOCOL from UEFI 2.1 specification. + + This protocol provides access to images in the images database. + +Revision History + +--*/ + +#ifndef __EFI_HII_IMAGE_PROTOCOL_H__ +#define __EFI_HII_IMAGE_PROTOCOL_H__ + +#include "EfiHii.h" +#include EFI_PROTOCOL_DEFINITION (GraphicsOutput) + +// +// Global ID for the Hii Image Protocol. +// +#define EFI_HII_IMAGE_PROTOCOL_GUID \ + { \ + 0x31a6406a, 0x6bdf, 0x4e46, 0xb2, 0xa2, 0xeb, 0xaa, 0x89, 0xc4, 0x9, 0x20 \ + } + +EFI_FORWARD_DECLARATION (EFI_HII_IMAGE_PROTOCOL); + +typedef UINT32 EFI_HII_DRAW_FLAGS; + +typedef struct _EFI_IMAGE_INPUT { + UINT32 Flags; + UINT16 Width; + UINT16 Height; + EFI_GRAPHICS_OUTPUT_BLT_PIXEL Bitmap[1]; +} EFI_IMAGE_INPUT; + +#define EFI_IMAGE_TRANSPARENT 0x00000001 + +typedef struct _EFI_IMAGE_OUTPUT { + UINT16 Width; + UINT16 Height; + union { + EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Bitmap; + EFI_GRAPHICS_OUTPUT_PROTOCOL *Screen; + } Image; +} EFI_IMAGE_OUTPUT; + +#define EFI_HII_DRAW_FLAG_CLIP 0x00000001 +#define EFI_HII_DRAW_FLAG_TRANSPARENT 0x00000030 +#define EFI_HII_DRAW_FLAG_DEFAULT 0x00000000 +#define EFI_HII_DRAW_FLAG_FORCE_TRANS 0x00000010 +#define EFI_HII_DRAW_FLAG_FORCE_OPAQUE 0x00000020 +#define EFI_HII_DIRECT_TO_SCREEN 0x00000080 + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_NEW_IMAGE) ( + IN CONST EFI_HII_IMAGE_PROTOCOL *This, + IN EFI_HII_HANDLE PackageList, + OUT EFI_IMAGE_ID *ImageId, + IN CONST EFI_IMAGE_INPUT *Image + ) +/*++ + + Routine Description: + This function adds the image Image to the group of images owned by PackageList, and returns + a new image identifier (ImageId). + + Arguments: + This - A pointer to the EFI_HII_IMAGE_PROTOCOL instance. + PackageList - Handle of the package list where this image will be added. + ImageId - On return, contains the new image id, which is unique within PackageList. + Image - Points to the image. + + Returns: + EFI_SUCCESS - The new image was added successfully. + EFI_NOT_FOUND - The specified PackageList could not be found in database. + EFI_OUT_OF_RESOURCES - Could not add the image due to lack of resources. + EFI_INVALID_PARAMETER - Image is NULL or ImageId is NULL. + +--*/ +; + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_GET_IMAGE) ( + IN CONST EFI_HII_IMAGE_PROTOCOL *This, + IN EFI_HII_HANDLE PackageList, + IN EFI_IMAGE_ID ImageId, + OUT EFI_IMAGE_INPUT *Image, + OUT UINTN *ImageSize + ) +/*++ + + Routine Description: + This function retrieves the image specified by ImageId which is associated with + the specified PackageList and copies it into the buffer specified by Image. + + Arguments: + This - A pointer to the EFI_HII_IMAGE_PROTOCOL instance. + PackageList - Handle of the package list where this image will be searched. + ImageId - The imageĄ¯s id,, which is unique within PackageList. + Image - Points to the image. + ImageSize - On entry, points to the size of the buffer pointed to by Image, in bytes. On return, + points to the length of the image, in bytes. + + Returns: + EFI_SUCCESS - The new image was returned successfully. + EFI_NOT_FOUND - The image specified by ImageId is not available. + EFI_BUFFER_TOO_SMALL - The buffer specified by ImageSize is too small to hold the image. + EFI_INVALID_PARAMETER - The Image or ImageSize was NULL. + +--*/ +; + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_SET_IMAGE) ( + IN CONST EFI_HII_IMAGE_PROTOCOL *This, + IN EFI_HII_HANDLE PackageList, + IN EFI_IMAGE_ID ImageId, + IN CONST EFI_IMAGE_INPUT *Image + ) +/*++ + + Routine Description: + This function updates the image specified by ImageId in the specified PackageListHandle to + the image specified by Image. + + Arguments: + This - A pointer to the EFI_HII_IMAGE_PROTOCOL instance. + PackageList - The package list containing the images. + ImageId - The imageĄ¯s id,, which is unique within PackageList. + Image - Points to the image. + + Returns: + EFI_SUCCESS - The new image was updated successfully. + EFI_NOT_FOUND - The image specified by ImageId is not in the database. + EFI_INVALID_PARAMETER - The Image was NULL. + +--*/ +; + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_DRAW_IMAGE) ( + IN CONST EFI_HII_IMAGE_PROTOCOL *This, + IN EFI_HII_DRAW_FLAGS Flags, + IN CONST EFI_IMAGE_INPUT *Image, + IN OUT EFI_IMAGE_OUTPUT **Blt, + IN UINTN BltX, + IN UINTN BltY + ) +/*++ + + Routine Description: + This function renders an image to a bitmap or the screen using the specified + color and options. It draws the image on an existing bitmap, allocates a new + bitmap or uses the screen. The images can be clipped. + + Arguments: + This - A pointer to the EFI_HII_IMAGE_PROTOCOL instance. + Flags - Describes how the image is to be drawn. + Image - Points to the image to be displayed. + Blt - If this points to a non-NULL on entry, this points to the + image, which is Width pixels wide and Height pixels high. + The image will be drawn onto this image and + EFI_HII_DRAW_FLAG_CLIP is implied. If this points to a + NULL on entry, then a buffer will be allocated to hold + the generated image and the pointer updated on exit. It + is the callerĄ¯s responsibility to free this buffer. + BltX, BltY - Specifies the offset from the left and top edge of the + output image of the first pixel in the image. + + Returns: + EFI_SUCCESS - The image was successfully drawn. + EFI_OUT_OF_RESOURCES - Unable to allocate an output buffer for Blt. + EFI_INVALID_PARAMETER - The Image or Blt was NULL. + EFI_INVALID_PARAMETER - Any combination of Flags is invalid. + +--*/ +; + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_DRAW_IMAGE_ID) ( + IN CONST EFI_HII_IMAGE_PROTOCOL *This, + IN EFI_HII_DRAW_FLAGS Flags, + IN EFI_HII_HANDLE PackageList, + IN EFI_IMAGE_ID ImageId, + IN OUT EFI_IMAGE_OUTPUT **Blt, + IN UINTN BltX, + IN UINTN BltY + ) + +/*++ + + Routine Description: + This function renders an image to a bitmap or the screen using the specified + color and options. It draws the image on an existing bitmap, allocates a new + bitmap or uses the screen. The images can be clipped. + + Arguments: + This - A pointer to the EFI_HII_IMAGE_PROTOCOL instance. + Flags - Describes how the image is to be drawn. + PackageList - The package list in the HII database to search for the + specified image. + ImageId - The image's id, which is unique within PackageList. + Blt - If this points to a non-NULL on entry, this points to the + image, which is Width pixels wide and Height pixels high. + The image will be drawn onto this image and + EFI_HII_DRAW_FLAG_CLIP is implied. If this points to a + NULL on entry, then a buffer will be allocated to hold + the generated image and the pointer updated on exit. It + is the callerĄ¯s responsibility to free this buffer. + BltX, BltY - Specifies the offset from the left and top edge of the + output image of the first pixel in the image. + + Returns: + EFI_SUCCESS - The image was successfully drawn. + EFI_OUT_OF_RESOURCES - Unable to allocate an output buffer for Blt. + EFI_INVALID_PARAMETER - The Image was NULL. + +--*/ +; + +// +// Interface structure for the EFI_HII_IMAGE_PROTOCOL +// +typedef struct _EFI_HII_IMAGE_PROTOCOL { + EFI_HII_NEW_IMAGE NewImage; + EFI_HII_GET_IMAGE GetImage; + EFI_HII_SET_IMAGE SetImage; + EFI_HII_DRAW_IMAGE DrawImage; + EFI_HII_DRAW_IMAGE_ID DrawImageId; +} EFI_HII_IMAGE_PROTOCOL; + +extern EFI_GUID gEfiHiiImageProtocolGuid; + +#endif diff --git a/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiString/HiiString.c b/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiString/HiiString.c new file mode 100644 index 0000000000..6c18995d7f --- /dev/null +++ b/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiString/HiiString.c @@ -0,0 +1,29 @@ +/*++ + +Copyright (c) 2007, Intel Corporation +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. + +Module Name: + + HiiString.c + +Abstract: + + EFI_HII_STRING_PROTOCOL + +Revision History + +--*/ + +#include "EfiSpec.h" +#include EFI_PROTOCOL_DEFINITION (HiiString) + +EFI_GUID gEfiHiiStringProtocolGuid = EFI_HII_STRING_PROTOCOL_GUID; + +EFI_GUID_STRING(&gEfiHiiStringProtocolGuid, "EFI HII STRING Protocol", "UEFI 2.1 HII STRING Protocol"); diff --git a/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiString/HiiString.h b/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiString/HiiString.h new file mode 100644 index 0000000000..d1fc9fde44 --- /dev/null +++ b/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiString/HiiString.h @@ -0,0 +1,240 @@ +/*++ + +Copyright (c) 2007, Intel Corporation +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. + +Module Name: + + HiiString.h + +Abstract: + + EFI_HII_STRING_PROTOCOL from UEFI 2.1 specification. + + This protocol provides interfaces to manipulate string data. + +Revision History + +--*/ + +#ifndef __EFI_HII_STRING_PROTOCOL_H__ +#define __EFI_HII_STRING_PROTOCOL_H__ + +#include EFI_PROTOCOL_DEFINITION (HiiFont) + +// +// Global ID for the Hii String Protocol. +// +#define EFI_HII_STRING_PROTOCOL_GUID \ + { \ + 0xfd96974, 0x23aa, 0x4cdc, 0xb9, 0xcb, 0x98, 0xd1, 0x77, 0x50, 0x32, 0x2a \ + } + +EFI_FORWARD_DECLARATION (EFI_HII_STRING_PROTOCOL); + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_NEW_STRING) ( + IN CONST EFI_HII_STRING_PROTOCOL *This, + IN EFI_HII_HANDLE PackageList, + OUT EFI_STRING_ID *StringId, + IN CONST CHAR8 *Language, + IN CONST CHAR16 *LanguageName, OPTIONAL + IN CONST EFI_STRING String, + IN CONST EFI_FONT_INFO *StringFontInfo OPTIONAL + ) +/*++ + + Routine Description: + This function adds the string String to the group of strings owned by PackageList, with the + specified font information StringFontInfo and returns a new string id. + + Arguments: + This - A pointer to the EFI_HII_STRING_PROTOCOL instance. + PackageList - Handle of the package list where this string will be added. + StringId - On return, contains the new strings id, which is unique within PackageList. + Language - Points to the language for the new string. + LanguageName - Points to the printable language name to associate with the passed in + Language field.If LanguageName is not NULL and the string package header's LanguageName + associated with a given Language is not zero, the LanguageName being passed + in will be ignored. + String - Points to the new null-terminated string. + StringFontInfo - Points to the new stringĄ¯s font information or NULL if the string should have the + default system font, size and style. + + Returns: + EFI_SUCCESS - The new string was added successfully. + EFI_NOT_FOUND - The specified PackageList could not be found in database. + EFI_OUT_OF_RESOURCES - Could not add the string due to lack of resources. + EFI_INVALID_PARAMETER - String is NULL or StringId is NULL or Language is NULL. + +--*/ +; + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_GET_STRING) ( + IN CONST EFI_HII_STRING_PROTOCOL *This, + IN CONST CHAR8 *Language, + IN EFI_HII_HANDLE PackageList, + IN EFI_STRING_ID StringId, + OUT EFI_STRING String, + IN OUT UINTN *StringSize, + OUT EFI_FONT_INFO **StringFontInfo OPTIONAL + ) +/*++ + + Routine Description: + This function retrieves the string specified by StringId which is associated + with the specified PackageList in the language Language and copies it into + the buffer specified by String. + + Arguments: + This - A pointer to the EFI_HII_STRING_PROTOCOL instance. + Language - Points to the language for the retrieved string. + PackageList - The package list in the HII database to search for the + specified string. + StringId - The string's id, which is unique within PackageList. + String - Points to the new null-terminated string. + StringSize - On entry, points to the size of the buffer pointed to by + String, in bytes. On return, + points to the length of the string, in bytes. + StringFontInfo - If not NULL, points to the stringĄ¯s font information. + It's caller's responsibility to free this buffer. + + Returns: + EFI_SUCCESS - The string was returned successfully. + EFI_NOT_FOUND - The string specified by StringId is not available. + EFI_BUFFER_TOO_SMALL - The buffer specified by StringSize is too small to + hold the string. + EFI_INVALID_PARAMETER - The String or Language or StringSize was NULL. + EFI_OUT_OF_RESOURCES - There were insufficient resources to complete the + request. + +--*/ +; + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_SET_STRING) ( + IN CONST EFI_HII_STRING_PROTOCOL *This, + IN EFI_HII_HANDLE PackageList, + IN EFI_STRING_ID StringId, + IN CONST CHAR8 *Language, + IN CONST EFI_STRING String, + IN CONST EFI_FONT_INFO *StringFontInfo OPTIONAL + ) +/*++ + + Routine Description: + This function updates the string specified by StringId in the specified PackageList to the text + specified by String and, optionally, the font information specified by StringFontInfo. + + Arguments: + This - A pointer to the EFI_HII_STRING_PROTOCOL instance. + PackageList - The package list containing the strings. + StringId - The stringĄ¯s id, which is unique within PackageList. + Language - Points to the language for the updated string. + String - Points to the new null-terminated string. + StringFontInfo - Points to the stringĄ¯s font information or NULL if the string font information is not + changed. + + Returns: + EFI_SUCCESS - The string was updated successfully. + EFI_NOT_FOUND - The string specified by StringId is not in the database. + EFI_INVALID_PARAMETER - The String or Language was NULL. + EFI_OUT_OF_RESOURCES - The system is out of resources to accomplish the task. + +--*/ +; + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_GET_LANGUAGES) ( + IN CONST EFI_HII_STRING_PROTOCOL *This, + IN EFI_HII_HANDLE PackageList, + IN OUT CHAR8 *Languages, + IN OUT UINTN *LanguagesSize + ) +/*++ + + Routine Description: + This function returns the list of supported languages, in the format specified + in Appendix M of UEFI 2.1 spec. + + Arguments: + This - A pointer to the EFI_HII_STRING_PROTOCOL instance. + PackageList - The package list to examine. + Languages - Points to the buffer to hold the returned string. + LanguagesSize - On entry, points to the size of the buffer pointed to by + Languages, in bytes. On + return, points to the length of Languages, in bytes. + + Returns: + EFI_SUCCESS - The languages were returned successfully. + EFI_INVALID_PARAMETER - The Languages or LanguagesSize was NULL. + EFI_BUFFER_TOO_SMALL - The LanguagesSize is too small to hold the list of + supported languages. LanguageSize is updated to + contain the required size. + +--*/ +; + +typedef +EFI_STATUS +(EFIAPI *EFI_HII_GET_2ND_LANGUAGES) ( + IN CONST EFI_HII_STRING_PROTOCOL *This, + IN EFI_HII_HANDLE PackageList, + IN CONST CHAR8 *FirstLanguage, + IN OUT CHAR8 *SecondLanguages, + IN OUT UINTN *SecondLanguagesSize + ) +/*++ + + Routine Description: + Each string package has associated with it a single primary language and zero + or more secondary languages. This routine returns the secondary languages + associated with a package list. + + Arguments: + This - A pointer to the EFI_HII_STRING_PROTOCOL instance. + PackageList - The package list to examine. + FirstLanguage - Points to the primary language. + SecondaryLanguages - Points to the buffer to hold the returned list of + secondary languages for the specified FirstLanguage. + If there are no secondary languages, the function + returns successfully, but this is set to NULL. + SecondaryLanguageSize - On entry, points to the size of the buffer pointed to + by SecondLanguages, in bytes. On return, points to + the length of SecondLanguages in bytes. + + Returns: + EFI_SUCCESS - Secondary languages were correctly returned. + EFI_INVALID_PARAMETER - FirstLanguage or SecondLanguages or SecondLanguagesSize was NULL. + EFI_BUFFER_TOO_SMALL - The buffer specified by SecondLanguagesSize is + too small to hold the returned information. + SecondLanguageSize is updated to hold the size of + the buffer required. + +--*/ +; +// +// Interface structure for the EFI_HII_STRING_PROTOCOL +// +typedef struct _EFI_HII_STRING_PROTOCOL { + EFI_HII_NEW_STRING NewString; + EFI_HII_GET_STRING GetString; + EFI_HII_SET_STRING SetString; + EFI_HII_GET_LANGUAGES GetLanguages; + EFI_HII_GET_2ND_LANGUAGES GetSecondaryLanguages; +} EFI_HII_STRING_PROTOCOL; + +extern EFI_GUID gEfiHiiStringProtocolGuid; + +#endif diff --git a/EdkCompatibilityPkg/Foundation/Efi/Protocol/Ip4Config/Ip4Config.h b/EdkCompatibilityPkg/Foundation/Efi/Protocol/Ip4Config/Ip4Config.h index 2b752681f6..350a1cca47 100644 --- a/EdkCompatibilityPkg/Foundation/Efi/Protocol/Ip4Config/Ip4Config.h +++ b/EdkCompatibilityPkg/Foundation/Efi/Protocol/Ip4Config/Ip4Config.h @@ -22,19 +22,18 @@ Abstract: #include EFI_PROTOCOL_DEFINITION (Ip4) - #define EFI_IP4_CONFIG_PROTOCOL_GUID \ - {0x25c98279, 0x3d9c, 0x43f2, 0xa7, 0x0e, 0xe1, 0xea, 0x4e, 0x0d, 0xed, 0x1b} + { 0x3b95aa31, 0x3793, 0x434b, 0x86, 0x67, 0xc8, 0x07, 0x08, 0x92, 0xe0, 0x5e } EFI_FORWARD_DECLARATION (EFI_IP4_CONFIG_PROTOCOL); -#define IP4_CONFIG_VARIABLE_ATTRIBUTES (EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS ) +#define IP4_CONFIG_VARIABLE_ATTRIBUTES (EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS) typedef struct { EFI_IPv4_ADDRESS StationAddress; EFI_IPv4_ADDRESS SubnetMask; UINT32 RouteTableSize; - EFI_IP4_ROUTE_TABLE RouteTable[1]; + EFI_IP4_ROUTE_TABLE *RouteTable; } EFI_IP4_IPCONFIG_DATA; diff --git a/EdkCompatibilityPkg/Foundation/Efi/Protocol/ManagedNetwork/ManagedNetwork.h b/EdkCompatibilityPkg/Foundation/Efi/Protocol/ManagedNetwork/ManagedNetwork.h index 274bb10773..c0ae939d19 100644 --- a/EdkCompatibilityPkg/Foundation/Efi/Protocol/ManagedNetwork/ManagedNetwork.h +++ b/EdkCompatibilityPkg/Foundation/Efi/Protocol/ManagedNetwork/ManagedNetwork.h @@ -26,10 +26,10 @@ Abstract: #include EFI_PROTOCOL_DEFINITION (ServiceBinding) #define EFI_MANAGED_NETWORK_SERVICE_BINDING_PROTOCOL_GUID \ - {0xf36ff770, 0xa7e1, 0x42cf, 0x9e, 0xd2, 0x56, 0xf0, 0xf2, 0x71, 0xf4, 0x4c} + { 0xf36ff770, 0xa7e1, 0x42cf, 0x9e, 0xd2, 0x56, 0xf0, 0xf2, 0x71, 0xf4, 0x4c } #define EFI_MANAGED_NETWORK_PROTOCOL_GUID \ - { 0x3b95aa31, 0x3793, 0x434b, 0x86, 0x67, 0xc8, 0x7, 0x8, 0x92, 0xe0, 0x5e } + { 0x7ab33a91, 0xace5, 0x4326, 0xb5, 0x72, 0xe7, 0xee, 0x33, 0xd3, 0x9f, 0x16 } EFI_FORWARD_DECLARATION (EFI_MANAGED_NETWORK_PROTOCOL); diff --git a/EdkCompatibilityPkg/Foundation/Efi/Protocol/SimpleTextInputEx/SimpleTextInputEx.c b/EdkCompatibilityPkg/Foundation/Efi/Protocol/SimpleTextInputEx/SimpleTextInputEx.c new file mode 100644 index 0000000000..bab98bf6bb --- /dev/null +++ b/EdkCompatibilityPkg/Foundation/Efi/Protocol/SimpleTextInputEx/SimpleTextInputEx.c @@ -0,0 +1,31 @@ +/*++ + +Copyright (c) 2007, Intel Corporation +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. + +Module Name: + + SimpleTextInputEx.c + +Abstract: + + EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL from the UEFI 2.1 specification. + + This protocol defines an extension to the EFI_SIMPLE_TEXT_INPUT_PROTOCOL + which exposes much more state and modifier information from the input device, + also allows one to register a notification for a particular keystroke. + +--*/ + +#include "EfiSpec.h" +#include EFI_PROTOCOL_DEFINITION (SimpleTextInputEx) + +EFI_GUID gEfiSimpleTextInputExProtocolGuid = EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID; + +EFI_GUID_STRING(&gEfiSimpleTextInputExProtocolGuid, "Simple Text Input Ex Protocol", "UEFI 2.1 Simple Text Input Ex Protocol"); diff --git a/EdkCompatibilityPkg/Foundation/Efi/Protocol/SimpleTextInputEx/SimpleTextInputEx.h b/EdkCompatibilityPkg/Foundation/Efi/Protocol/SimpleTextInputEx/SimpleTextInputEx.h new file mode 100644 index 0000000000..1c0fe72607 --- /dev/null +++ b/EdkCompatibilityPkg/Foundation/Efi/Protocol/SimpleTextInputEx/SimpleTextInputEx.h @@ -0,0 +1,255 @@ +/*++ + +Copyright (c) 2007, Intel Corporation +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. + +Module Name: + + SimpleTextInputEx.h + +Abstract: + + EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL from the UEFI 2.1 specification. + + This protocol defines an extension to the EFI_SIMPLE_TEXT_INPUT_PROTOCOL + which exposes much more state and modifier information from the input device, + also allows one to register a notification for a particular keystroke. + +--*/ + +#ifndef __SIMPLE_TEXT_INPUT_EX_H__ +#define __SIMPLE_TEXT_INPUT_EX_H__ + +#include EFI_PROTOCOL_DEFINITION (SimpleTextIn) + +#define EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID \ + { \ + 0xdd9e7534, 0x7762, 0x4698, 0x8c, 0x14, 0xf5, 0x85, 0x17, 0xa6, 0x25, 0xaa\ + } + +EFI_FORWARD_DECLARATION (EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL); + +// +// Data structures +// + +typedef UINT8 EFI_KEY_TOGGLE_STATE; +// +// Any Shift or Toggle State that is valid should have +// high order bit set. +// +typedef struct EFI_KEY_STATE { + UINT32 KeyShiftState; + EFI_KEY_TOGGLE_STATE KeyToggleState; +} EFI_KEY_STATE; + +typedef struct { + EFI_INPUT_KEY Key; + EFI_KEY_STATE KeyState; +} EFI_KEY_DATA; + +// +// Shift state +// +#define EFI_SHIFT_STATE_VALID 0x80000000 +#define EFI_RIGHT_SHIFT_PRESSED 0x00000001 +#define EFI_LEFT_SHIFT_PRESSED 0x00000002 +#define EFI_RIGHT_CONTROL_PRESSED 0x00000004 +#define EFI_LEFT_CONTROL_PRESSED 0x00000008 +#define EFI_RIGHT_ALT_PRESSED 0x00000010 +#define EFI_LEFT_ALT_PRESSED 0x00000020 +#define EFI_RIGHT_LOGO_PRESSED 0x00000040 +#define EFI_LEFT_LOGO_PRESSED 0x00000080 +#define EFI_MENU_KEY_PRESSED 0x00000100 +#define EFI_SYS_REQ_PRESSED 0x00000200 + +// +// Toggle state +// +#define EFI_TOGGLE_STATE_VALID 0x80 +#define EFI_SCROLL_LOCK_ACTIVE 0x01 +#define EFI_NUM_LOCK_ACTIVE 0x02 +#define EFI_CAPS_LOCK_ACTIVE 0x04 + +// +// EFI Scan codes +// +#define SCAN_F13 0x0068 +#define SCAN_F14 0x0069 +#define SCAN_F15 0x006A +#define SCAN_F16 0x006B +#define SCAN_F17 0x006C +#define SCAN_F18 0x006D +#define SCAN_F19 0x006E +#define SCAN_F20 0x006F +#define SCAN_F21 0x0070 +#define SCAN_F22 0x0071 +#define SCAN_F23 0x0072 +#define SCAN_F24 0x0073 +#define SCAN_MUTE 0x007F +#define SCAN_VOLUME_UP 0x0080 +#define SCAN_VOLUME_DOWN 0x0081 +#define SCAN_BRIGHTNESS_UP 0x0100 +#define SCAN_BRIGHTNESS_DOWN 0x0101 +#define SCAN_SUSPEND 0x0102 +#define SCAN_HIBERNATE 0x0103 +#define SCAN_TOGGLE_DISPLAY 0x0104 +#define SCAN_RECOVERY 0x0105 +#define SCAN_EJECT 0x0106 + + +// +// EFI Key Notfication Function +// +typedef +EFI_STATUS +(EFIAPI *EFI_KEY_NOTIFY_FUNCTION) ( + IN EFI_KEY_DATA *KeyData + ) +; + +typedef +EFI_STATUS +(EFIAPI *EFI_INPUT_RESET_EX) ( + IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, + IN BOOLEAN ExtendedVerification + ) +/*++ + + Routine Description: + Reset the input device and optionaly run diagnostics + + Arguments: + This - Protocol instance pointer. + ExtendedVerification - Driver may perform diagnostics on reset. + + Returns: + EFI_SUCCESS - The device was reset. + EFI_DEVICE_ERROR - The device is not functioning properly and could + not be reset. + +--*/ +; + +typedef +EFI_STATUS +(EFIAPI *EFI_INPUT_READ_KEY_EX) ( + IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, + OUT EFI_KEY_DATA *KeyData + ) +/*++ + + Routine Description: + Reads the next keystroke from the input device. The WaitForKey Event can + be used to test for existance of a keystroke via WaitForEvent () call. + + Arguments: + This - Protocol instance pointer. + KeyData - A pointer to a buffer that is filled in with the keystroke + state data for the key that was pressed. + + Returns: + EFI_SUCCESS - The keystroke information was returned. + EFI_NOT_READY - There was no keystroke data availiable. + EFI_DEVICE_ERROR - The keystroke information was not returned due to + hardware errors. + EFI_INVALID_PARAMETER - KeyData is NULL. +--*/ +; + +typedef +EFI_STATUS +(EFIAPI *EFI_SET_STATE) ( + IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, + IN EFI_KEY_TOGGLE_STATE *KeyToggleState + ) +/*++ + + Routine Description: + Set certain state for the input device. + + Arguments: + This - Protocol instance pointer. + KeyToggleState - A pointer to the EFI_KEY_TOGGLE_STATE to set the + state for the input device. + + Returns: + EFI_SUCCESS - The device state was set successfully. + EFI_DEVICE_ERROR - The device is not functioning correctly and could + not have the setting adjusted. + EFI_UNSUPPORTED - The device does not have the ability to set its state. + EFI_INVALID_PARAMETER - KeyToggleState is NULL. + +--*/ +; + +typedef +EFI_STATUS +(EFIAPI *EFI_REGISTER_KEYSTROKE_NOTIFY) ( + IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, + IN EFI_KEY_DATA *KeyData, + IN EFI_KEY_NOTIFY_FUNCTION KeyNotificationFunction, + OUT EFI_HANDLE *NotifyHandle + ) +/*++ + + Routine Description: + Register a notification function for a particular keystroke for the input device. + + Arguments: + This - Protocol instance pointer. + KeyData - A pointer to a buffer that is filled in with the keystroke + information data for the key that was pressed. + KeyNotificationFunction - Points to the function to be called when the key + sequence is typed specified by KeyData. + NotifyHandle - Points to the unique handle assigned to the registered notification. + + Returns: + EFI_SUCCESS - The notification function was registered successfully. + EFI_OUT_OF_RESOURCES - Unable to allocate resources for necesssary data structures. + EFI_INVALID_PARAMETER - KeyData or NotifyHandle is NULL. + +--*/ +; + +typedef +EFI_STATUS +(EFIAPI *EFI_UNREGISTER_KEYSTROKE_NOTIFY) ( + IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, + IN EFI_HANDLE NotificationHandle + ) +/*++ + + Routine Description: + Remove a registered notification function from a particular keystroke. + + Arguments: + This - Protocol instance pointer. + NotificationHandle - The handle of the notification function being unregistered. + + Returns: + EFI_SUCCESS - The notification function was unregistered successfully. + EFI_INVALID_PARAMETER - The NotificationHandle is invalid. + EFI_NOT_FOUND - Can not find the matching entry in database. + +--*/ +; + +typedef struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL { + EFI_INPUT_RESET_EX Reset; + EFI_INPUT_READ_KEY_EX ReadKeyStrokeEx; + EFI_EVENT WaitForKeyEx; + EFI_SET_STATE SetState; + EFI_REGISTER_KEYSTROKE_NOTIFY RegisterKeyNotify; + EFI_UNREGISTER_KEYSTROKE_NOTIFY UnregisterKeyNotify; +} EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL; + +extern EFI_GUID gEfiSimpleTextInputExProtocolGuid; + +#endif diff --git a/EdkCompatibilityPkg/Foundation/Efi/Protocol/UnicodeCollation/UnicodeCollation.c b/EdkCompatibilityPkg/Foundation/Efi/Protocol/UnicodeCollation/UnicodeCollation.c index e9c3e6c07e..6484a768db 100644 --- a/EdkCompatibilityPkg/Foundation/Efi/Protocol/UnicodeCollation/UnicodeCollation.c +++ b/EdkCompatibilityPkg/Foundation/Efi/Protocol/UnicodeCollation/UnicodeCollation.c @@ -23,5 +23,7 @@ Abstract: #include EFI_PROTOCOL_DEFINITION (UnicodeCollation) EFI_GUID gEfiUnicodeCollationProtocolGuid = EFI_UNICODE_COLLATION_PROTOCOL_GUID; +EFI_GUID gEfiUnicodeCollation2ProtocolGuid = EFI_UNICODE_COLLATION2_PROTOCOL_GUID; EFI_GUID_STRING(&gEfiUnicodeCollationProtocolGuid, "Unicode Collation Protocol", "EFI 1.0 Unicode Collation Protocol"); +EFI_GUID_STRING(&gEfiUnicodeCollation2ProtocolGuid, "Unicode Collation Protocol", "UEFI 2.10 Unicode Collation Protocol"); diff --git a/EdkCompatibilityPkg/Foundation/Efi/Protocol/UnicodeCollation/UnicodeCollation.h b/EdkCompatibilityPkg/Foundation/Efi/Protocol/UnicodeCollation/UnicodeCollation.h index 0c84796f91..f4930b1b71 100644 --- a/EdkCompatibilityPkg/Foundation/Efi/Protocol/UnicodeCollation/UnicodeCollation.h +++ b/EdkCompatibilityPkg/Foundation/Efi/Protocol/UnicodeCollation/UnicodeCollation.h @@ -27,6 +27,11 @@ Abstract: 0x1d85cd7f, 0xf43d, 0x11d2, 0x9a, 0xc, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d \ } +#define EFI_UNICODE_COLLATION2_PROTOCOL_GUID \ + { \ + 0xa4c751fc, 0x23ae, 0x4c3e, 0x92, 0xe9, 0x49, 0x64, 0xcf, 0x63, 0xf3, 0x49 \ + } + EFI_FORWARD_DECLARATION (EFI_UNICODE_COLLATION_PROTOCOL); // @@ -207,5 +212,6 @@ typedef struct _EFI_UNICODE_COLLATION_PROTOCOL { } EFI_UNICODE_COLLATION_PROTOCOL; extern EFI_GUID gEfiUnicodeCollationProtocolGuid; +extern EFI_GUID gEfiUnicodeCollation2ProtocolGuid; #endif -- cgit v1.2.3