diff options
author | niruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-07-30 03:50:42 +0000 |
---|---|---|
committer | niruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-07-30 03:50:42 +0000 |
commit | 402e4a9d777677296945afa020194bf4123885e2 (patch) | |
tree | 9bc0e66d4413d25b7f816a2e87d96fe06a063a93 /MdeModulePkg | |
parent | 6b8ebcb8de52ae5cab543181712e53eeb94340a7 (diff) | |
download | edk2-platforms-402e4a9d777677296945afa020194bf4123885e2.tar.xz |
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
Diffstat (limited to 'MdeModulePkg')
6 files changed, 24 insertions, 30 deletions
diff --git a/MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.c b/MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.c index 001158018f..5ccc71d24a 100644 --- a/MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.c +++ b/MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.c @@ -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
//
diff --git a/MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.h b/MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.h index 3ce383b33e..58edb3f65f 100644 --- a/MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.h +++ b/MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.h @@ -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
);
/**
diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c index 38004bb31c..c1edd5dccf 100644 --- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c +++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c @@ -3606,7 +3606,7 @@ ConSplitterTextInRegisterKeyNotify ( 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
)
{
TEXT_IN_SPLITTER_PRIVATE_DATA *Private;
@@ -3630,7 +3630,7 @@ ConSplitterTextInRegisterKeyNotify ( CurrentNotify = TEXT_IN_EX_SPLITTER_NOTIFY_FROM_THIS (Link);
if (IsKeyRegistered (&CurrentNotify->KeyData, KeyData)) {
if (CurrentNotify->KeyNotificationFn == KeyNotificationFunction) {
- *NotifyHandle = CurrentNotify->NotifyHandle;
+ *NotifyHandle = CurrentNotify;
return EFI_SUCCESS;
}
}
@@ -3650,7 +3650,6 @@ ConSplitterTextInRegisterKeyNotify ( }
NewNotify->Signature = TEXT_IN_EX_SPLITTER_NOTIFY_SIGNATURE;
NewNotify->KeyNotificationFn = KeyNotificationFunction;
- NewNotify->NotifyHandle = (EFI_HANDLE) NewNotify;
CopyMem (&NewNotify->KeyData, KeyData, sizeof (EFI_KEY_DATA));
//
@@ -3682,7 +3681,7 @@ ConSplitterTextInRegisterKeyNotify ( InsertTailList (&mConIn.NotifyList, &NewNotify->NotifyEntry);
- *NotifyHandle = NewNotify->NotifyHandle;
+ *NotifyHandle = NewNotify;
return EFI_SUCCESS;
@@ -3705,7 +3704,7 @@ EFI_STATUS EFIAPI
ConSplitterTextInUnregisterKeyNotify (
IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
- IN EFI_HANDLE NotificationHandle
+ IN VOID *NotificationHandle
)
{
TEXT_IN_SPLITTER_PRIVATE_DATA *Private;
@@ -3721,7 +3720,7 @@ ConSplitterTextInUnregisterKeyNotify ( for (Link = Private->NotifyList.ForwardLink; Link != &Private->NotifyList; Link = Link->ForwardLink) {
CurrentNotify = TEXT_IN_EX_SPLITTER_NOTIFY_FROM_THIS (Link);
- if (CurrentNotify->NotifyHandle == NotificationHandle) {
+ if (CurrentNotify == NotificationHandle) {
for (Index = 0; Index < Private->CurrentNumberOfExConsoles; Index++) {
Private->TextInExList[Index]->UnregisterKeyNotify (
Private->TextInExList[Index],
diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.h b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.h index 0a9fe7dfc6..22c9e19c74 100644 --- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.h +++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.h @@ -95,8 +95,7 @@ typedef struct { //
typedef struct _TEXT_IN_EX_SPLITTER_NOTIFY {
UINTN Signature;
- EFI_HANDLE *NotifyHandleList;
- EFI_HANDLE NotifyHandle;
+ VOID **NotifyHandleList;
EFI_KEY_DATA KeyData;
EFI_KEY_NOTIFY_FUNCTION KeyNotificationFn;
LIST_ENTRY NotifyEntry;
@@ -1405,7 +1404,7 @@ ConSplitterTextInRegisterKeyNotify ( 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
);
@@ -1426,7 +1425,7 @@ EFI_STATUS EFIAPI
ConSplitterTextInUnregisterKeyNotify (
IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
- IN EFI_HANDLE NotificationHandle
+ IN VOID *NotificationHandle
);
/**
diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h index 9387998e01..5269995d1d 100644 --- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h +++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h @@ -1,7 +1,7 @@ /** @file
Header file for Terminal driver.
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 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
@@ -74,7 +74,6 @@ typedef struct { typedef struct _TERMINAL_CONSOLE_IN_EX_NOTIFY {
UINTN Signature;
- EFI_HANDLE NotifyHandle;
EFI_KEY_DATA KeyData;
EFI_KEY_NOTIFY_FUNCTION KeyNotificationFn;
LIST_ENTRY NotifyEntry;
@@ -350,7 +349,7 @@ TerminalConInRegisterKeyNotify ( 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
);
/**
@@ -370,7 +369,7 @@ EFI_STATUS EFIAPI
TerminalConInUnregisterKeyNotify (
IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
- IN EFI_HANDLE NotificationHandle
+ IN VOID *NotificationHandle
);
/**
diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c index 547ef832f6..6179b55b04 100644 --- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c +++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c @@ -324,7 +324,7 @@ TerminalConInRegisterKeyNotify ( 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
)
{
TERMINAL_DEV *TerminalDevice;
@@ -352,7 +352,7 @@ TerminalConInRegisterKeyNotify ( );
if (IsKeyRegistered (&CurrentNotify->KeyData, KeyData)) {
if (CurrentNotify->KeyNotificationFn == KeyNotificationFunction) {
- *NotifyHandle = CurrentNotify->NotifyHandle;
+ *NotifyHandle = CurrentNotify;
return EFI_SUCCESS;
}
}
@@ -368,11 +368,10 @@ TerminalConInRegisterKeyNotify ( NewNotify->Signature = TERMINAL_CONSOLE_IN_EX_NOTIFY_SIGNATURE;
NewNotify->KeyNotificationFn = KeyNotificationFunction;
- NewNotify->NotifyHandle = (EFI_HANDLE) NewNotify;
CopyMem (&NewNotify->KeyData, KeyData, sizeof (KeyData));
InsertTailList (&TerminalDevice->NotifyList, &NewNotify->NotifyEntry);
- *NotifyHandle = NewNotify->NotifyHandle;
+ *NotifyHandle = NewNotify;
return EFI_SUCCESS;
}
@@ -394,7 +393,7 @@ EFI_STATUS EFIAPI
TerminalConInUnregisterKeyNotify (
IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
- IN EFI_HANDLE NotificationHandle
+ IN VOID *NotificationHandle
)
{
TERMINAL_DEV *TerminalDevice;
@@ -416,7 +415,7 @@ TerminalConInUnregisterKeyNotify ( NotifyEntry,
TERMINAL_CONSOLE_IN_EX_NOTIFY_SIGNATURE
);
- if (CurrentNotify->NotifyHandle == NotificationHandle) {
+ if (CurrentNotify == NotificationHandle) {
//
// Remove the notification function from NotifyList and free resources
//
|