Change the type of NotifyHandle from EFI_HANDLE to VOID * for SimpleTextInEx protocol.

Clean up the code to remove unnecessary NotifyHandle in the private data structure.

Signed-off-by: Ruiyu Ni<ruiyu.ni@intel.com>
Reviewed-by: Elvin Li<elvin.li@intel.com>

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13565 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
niruiyu
2012-07-30 03:50:42 +00:00
parent 6b8ebcb8de
commit 402e4a9d77
17 changed files with 68 additions and 82 deletions

View File

@@ -1042,7 +1042,7 @@ USBKeyboardRegisterKeyNotify (
IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
IN EFI_KEY_DATA *KeyData,
IN EFI_KEY_NOTIFY_FUNCTION KeyNotificationFunction,
OUT EFI_HANDLE *NotifyHandle
OUT VOID **NotifyHandle
)
{
USB_KB_DEV *UsbKeyboardDevice;
@@ -1073,7 +1073,7 @@ USBKeyboardRegisterKeyNotify (
);
if (IsKeyRegistered (&CurrentNotify->KeyData, KeyData)) {
if (CurrentNotify->KeyNotificationFn == KeyNotificationFunction) {
*NotifyHandle = CurrentNotify->NotifyHandle;
*NotifyHandle = CurrentNotify;
return EFI_SUCCESS;
}
}
@@ -1089,12 +1089,11 @@ USBKeyboardRegisterKeyNotify (
NewNotify->Signature = USB_KB_CONSOLE_IN_EX_NOTIFY_SIGNATURE;
NewNotify->KeyNotificationFn = KeyNotificationFunction;
NewNotify->NotifyHandle = (EFI_HANDLE) NewNotify;
CopyMem (&NewNotify->KeyData, KeyData, sizeof (EFI_KEY_DATA));
InsertTailList (&UsbKeyboardDevice->NotifyList, &NewNotify->NotifyEntry);
*NotifyHandle = NewNotify->NotifyHandle;
*NotifyHandle = NewNotify;
return EFI_SUCCESS;
@@ -1114,7 +1113,7 @@ EFI_STATUS
EFIAPI
USBKeyboardUnregisterKeyNotify (
IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
IN EFI_HANDLE NotificationHandle
IN VOID *NotificationHandle
)
{
USB_KB_DEV *UsbKeyboardDevice;
@@ -1141,7 +1140,7 @@ USBKeyboardUnregisterKeyNotify (
NotifyEntry,
USB_KB_CONSOLE_IN_EX_NOTIFY_SIGNATURE
);
if (CurrentNotify->NotifyHandle == NotificationHandle) {
if (CurrentNotify == NotificationHandle) {
//
// Remove the notification function from NotifyList and free resources
//

View File

@@ -1,7 +1,7 @@
/** @file
Header file for USB Keyboard Driver's Data Structures.
Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
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
@@ -72,7 +72,6 @@ typedef struct {
typedef struct _KEYBOARD_CONSOLE_IN_EX_NOTIFY {
UINTN Signature;
EFI_HANDLE NotifyHandle;
EFI_KEY_DATA KeyData;
EFI_KEY_NOTIFY_FUNCTION KeyNotificationFn;
LIST_ENTRY NotifyEntry;
@@ -518,7 +517,7 @@ USBKeyboardRegisterKeyNotify (
IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
IN EFI_KEY_DATA *KeyData,
IN EFI_KEY_NOTIFY_FUNCTION KeyNotificationFunction,
OUT EFI_HANDLE *NotifyHandle
OUT VOID **NotifyHandle
);
/**
@@ -536,7 +535,7 @@ EFI_STATUS
EFIAPI
USBKeyboardUnregisterKeyNotify (
IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
IN EFI_HANDLE NotificationHandle
IN VOID *NotificationHandle
);
/**