Change the EFI_BOOT_KEY_DATA definition to use macro instead of bit fields.

Change the BDS module in IntelFrameworkModulePkg to use the new EFI_BOOT_KEY_DATA definition.

Signed-off-by: Ruiyu Ni<ruiyu.ni@intel.com>
Reviewed-by: Eric Dong<eric.dong@intel.com>
Reviewed-by: Kinney Michael D<michael.d.kinney@intel.com>

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13659 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
niruiyu
2012-08-22 02:24:40 +00:00
parent b92b1209f7
commit 53cdd43979
3 changed files with 125 additions and 58 deletions

View File

@@ -19,13 +19,89 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "Bds.h"
#include "String.h"
#define GET_BOOT_OPTION_SUPPORT_KEY_COUNT(a) (((a) & EFI_BOOT_OPTION_SUPPORT_COUNT) >> 8)
#define SET_BOOT_OPTION_SUPPORT_KEY_COUNT(a, c) { \
(a) = ((a) & ~EFI_BOOT_OPTION_SUPPORT_COUNT) | (((c) << 8) & EFI_BOOT_OPTION_SUPPORT_COUNT); \
(a) = ((a) & ~EFI_BOOT_OPTION_SUPPORT_COUNT) | (((c) << LowBitSet32 (EFI_BOOT_OPTION_SUPPORT_COUNT)) & EFI_BOOT_OPTION_SUPPORT_COUNT); \
}
#define BDS_HOTKEY_OPTION_SIGNATURE SIGNATURE_32 ('B', 'd', 'K', 'O')
/**
Get the revision of the EFI_KEY_OPTION structure.
@param KeyOption Pointer to the EFI_KEY_OPTION structure.
@return Revision.
**/
#define KEY_OPTION_REVISION(KeyOption) ((KeyOption)->KeyData & EFI_KEY_OPTION_REVISION_MASK)
/**
Get the actual number of entries in EFI_KEY_OPTION.Keys, from 0-3.
@param KeyOption Pointer to the EFI_KEY_OPTION structure.
@return Actual number of entries in EFI_KEY_OPTION.Keys.
**/
#define KEY_OPTION_INPUT_KEY_COUNT(KeyOption) (((KeyOption)->KeyData & EFI_KEY_OPTION_INPUT_KEY_COUNT_MASK) >> LowBitSet32 (EFI_KEY_OPTION_INPUT_KEY_COUNT_MASK))
/**
Return whether the Shift key needs pressed.
@param KeyOption Pointer to the EFI_KEY_OPTION structure.
@retval TRUE Shift key needs pressed.
@retval FALSE Shift key needn't pressed.
**/
#define KEY_OPTION_SHIFT_PRESSED(KeyOption) (BOOLEAN) (((KeyOption)->KeyData & EFI_KEY_OPTION_SHIFT_PRESSED_MASK) != 0)
/**
Return whether the Control key needs pressed.
@param KeyOption Pointer to the EFI_KEY_OPTION structure.
@retval TRUE Control key needs pressed.
@retval FALSE Control key needn't pressed.
**/
#define KEY_OPTION_CONTROL_PRESSED(KeyOption) (BOOLEAN) (((KeyOption)->KeyData & EFI_KEY_OPTION_CONTROL_PRESSED_MASK) != 0)
/**
Return whether the Alt key needs pressed.
@param KeyOption Pointer to the EFI_KEY_OPTION structure.
@retval TRUE Alt key needs pressed.
@retval FALSE Alt key needn't pressed.
**/
#define KEY_OPTION_ALT_PRESSED(KeyOption) (BOOLEAN) (((KeyOption)->KeyData & EFI_KEY_OPTION_ALT_PRESSED_MASK) != 0)
/**
Return whether the Logo key needs pressed.
@param KeyOption Pointer to the EFI_KEY_OPTION structure.
@retval TRUE Logo key needs pressed.
@retval FALSE Logo key needn't pressed.
**/
#define KEY_OPTION_LOGO_PRESSED(KeyOption) (BOOLEAN) (((KeyOption)->KeyData & EFI_KEY_OPTION_LOGO_PRESSED_MASK) != 0)
/**
Return whether the Menu key needs pressed.
@param KeyOption Pointer to the EFI_KEY_OPTION structure.
@retval TRUE Menu key needs pressed.
@retval FALSE Menu key needn't pressed.
**/
#define KEY_OPTION_MENU_PRESSED(KeyOption) (BOOLEAN) (((KeyOption)->KeyData & EFI_KEY_OPTION_MENU_PRESSED_MASK) != 0)
/**
Return whether the SysReq key needs pressed.
@param KeyOption Pointer to the EFI_KEY_OPTION structure.
@retval TRUE SysReq key needs pressed.
@retval FALSE SysReq key needn't pressed.
**/
#define KEY_OPTION_SYS_REQ_PRESSED(KeyOption) (BOOLEAN) (((KeyOption)->KeyData & EFI_KEY_OPTION_SYS_REQ_PRESSED_MASK) != 0)
typedef struct {
UINTN Signature;