EmbeddedPkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the EmbeddedPkg package Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Andrew Fish <afish@apple.com>
This commit is contained in:
committed by
mergify[bot]
parent
731c67e1d7
commit
e7108d0e96
@@ -13,7 +13,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
//
|
||||
// RAM Keyboard Driver Binding Protocol Instance
|
||||
//
|
||||
EFI_DRIVER_BINDING_PROTOCOL gVirtualKeyboardDriverBinding = {
|
||||
EFI_DRIVER_BINDING_PROTOCOL gVirtualKeyboardDriverBinding = {
|
||||
VirtualKeyboardDriverBindingSupported,
|
||||
VirtualKeyboardDriverBindingStart,
|
||||
VirtualKeyboardDriverBindingStop,
|
||||
@@ -45,13 +45,13 @@ VirtualKeyboardDriverBindingSupported (
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
PLATFORM_VIRTUAL_KBD_PROTOCOL *PlatformVirtual;
|
||||
EFI_STATUS Status;
|
||||
PLATFORM_VIRTUAL_KBD_PROTOCOL *PlatformVirtual;
|
||||
|
||||
Status = gBS->OpenProtocol (
|
||||
Controller,
|
||||
&gPlatformVirtualKeyboardProtocolGuid,
|
||||
(VOID **) &PlatformVirtual,
|
||||
(VOID **)&PlatformVirtual,
|
||||
This->DriverBindingHandle,
|
||||
Controller,
|
||||
EFI_OPEN_PROTOCOL_BY_DRIVER
|
||||
@@ -59,6 +59,7 @@ VirtualKeyboardDriverBindingSupported (
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
gBS->CloseProtocol (
|
||||
Controller,
|
||||
&gPlatformVirtualKeyboardProtocolGuid,
|
||||
@@ -88,14 +89,14 @@ VirtualKeyboardDriverBindingStart (
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
VIRTUAL_KEYBOARD_DEV *VirtualKeyboardPrivate;
|
||||
PLATFORM_VIRTUAL_KBD_PROTOCOL *PlatformVirtual;
|
||||
EFI_STATUS Status;
|
||||
VIRTUAL_KEYBOARD_DEV *VirtualKeyboardPrivate;
|
||||
PLATFORM_VIRTUAL_KBD_PROTOCOL *PlatformVirtual;
|
||||
|
||||
Status = gBS->OpenProtocol (
|
||||
Controller,
|
||||
&gPlatformVirtualKeyboardProtocolGuid,
|
||||
(VOID **) &PlatformVirtual,
|
||||
(VOID **)&PlatformVirtual,
|
||||
This->DriverBindingHandle,
|
||||
Controller,
|
||||
EFI_OPEN_PROTOCOL_BY_DRIVER
|
||||
@@ -107,7 +108,7 @@ VirtualKeyboardDriverBindingStart (
|
||||
//
|
||||
// Allocate the private device structure
|
||||
//
|
||||
VirtualKeyboardPrivate = (VIRTUAL_KEYBOARD_DEV *) AllocateZeroPool (sizeof (VIRTUAL_KEYBOARD_DEV));
|
||||
VirtualKeyboardPrivate = (VIRTUAL_KEYBOARD_DEV *)AllocateZeroPool (sizeof (VIRTUAL_KEYBOARD_DEV));
|
||||
if (VirtualKeyboardPrivate == NULL) {
|
||||
Status = EFI_OUT_OF_RESOURCES;
|
||||
goto Done;
|
||||
@@ -116,20 +117,20 @@ VirtualKeyboardDriverBindingStart (
|
||||
//
|
||||
// Initialize the private device structure
|
||||
//
|
||||
VirtualKeyboardPrivate->Signature = VIRTUAL_KEYBOARD_DEV_SIGNATURE;
|
||||
VirtualKeyboardPrivate->Handle = Controller;
|
||||
VirtualKeyboardPrivate->PlatformVirtual = PlatformVirtual;
|
||||
VirtualKeyboardPrivate->Queue.Front = 0;
|
||||
VirtualKeyboardPrivate->Queue.Rear = 0;
|
||||
VirtualKeyboardPrivate->QueueForNotify.Front = 0;
|
||||
VirtualKeyboardPrivate->QueueForNotify.Rear = 0;
|
||||
VirtualKeyboardPrivate->Signature = VIRTUAL_KEYBOARD_DEV_SIGNATURE;
|
||||
VirtualKeyboardPrivate->Handle = Controller;
|
||||
VirtualKeyboardPrivate->PlatformVirtual = PlatformVirtual;
|
||||
VirtualKeyboardPrivate->Queue.Front = 0;
|
||||
VirtualKeyboardPrivate->Queue.Rear = 0;
|
||||
VirtualKeyboardPrivate->QueueForNotify.Front = 0;
|
||||
VirtualKeyboardPrivate->QueueForNotify.Rear = 0;
|
||||
|
||||
VirtualKeyboardPrivate->SimpleTextIn.Reset = VirtualKeyboardReset;
|
||||
VirtualKeyboardPrivate->SimpleTextIn.ReadKeyStroke = VirtualKeyboardReadKeyStroke;
|
||||
|
||||
VirtualKeyboardPrivate->SimpleTextInputEx.Reset = VirtualKeyboardResetEx;
|
||||
VirtualKeyboardPrivate->SimpleTextInputEx.ReadKeyStrokeEx = VirtualKeyboardReadKeyStrokeEx;
|
||||
VirtualKeyboardPrivate->SimpleTextInputEx.SetState = VirtualKeyboardSetState;
|
||||
VirtualKeyboardPrivate->SimpleTextInputEx.Reset = VirtualKeyboardResetEx;
|
||||
VirtualKeyboardPrivate->SimpleTextInputEx.ReadKeyStrokeEx = VirtualKeyboardReadKeyStrokeEx;
|
||||
VirtualKeyboardPrivate->SimpleTextInputEx.SetState = VirtualKeyboardSetState;
|
||||
|
||||
VirtualKeyboardPrivate->SimpleTextInputEx.RegisterKeyNotify = VirtualKeyboardRegisterKeyNotify;
|
||||
VirtualKeyboardPrivate->SimpleTextInputEx.UnregisterKeyNotify = VirtualKeyboardUnregisterKeyNotify;
|
||||
@@ -162,6 +163,7 @@ VirtualKeyboardDriverBindingStart (
|
||||
(VirtualKeyboardPrivate->SimpleTextIn).WaitForKey = NULL;
|
||||
goto Done;
|
||||
}
|
||||
|
||||
Status = gBS->CreateEvent (
|
||||
EVT_NOTIFY_WAIT,
|
||||
TPL_NOTIFY,
|
||||
@@ -215,13 +217,14 @@ VirtualKeyboardDriverBindingStart (
|
||||
// Reset the keyboard device
|
||||
//
|
||||
Status = VirtualKeyboardPrivate->SimpleTextInputEx.Reset (
|
||||
&VirtualKeyboardPrivate->SimpleTextInputEx,
|
||||
FALSE
|
||||
);
|
||||
&VirtualKeyboardPrivate->SimpleTextInputEx,
|
||||
FALSE
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "[KBD]Reset Failed. Status - %r\n", Status));
|
||||
goto Done;
|
||||
}
|
||||
|
||||
//
|
||||
// Install protocol interfaces for the keyboard device.
|
||||
//
|
||||
@@ -256,6 +259,7 @@ Done:
|
||||
if (VirtualKeyboardPrivate->TimerEvent != NULL) {
|
||||
gBS->CloseEvent (VirtualKeyboardPrivate->TimerEvent);
|
||||
}
|
||||
|
||||
FreePool (VirtualKeyboardPrivate);
|
||||
}
|
||||
}
|
||||
@@ -297,7 +301,6 @@ VirtualKeyboardDriverBindingStop (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Enqueue the key.
|
||||
|
||||
@@ -310,8 +313,8 @@ VirtualKeyboardDriverBindingStop (
|
||||
**/
|
||||
EFI_STATUS
|
||||
Enqueue (
|
||||
IN SIMPLE_QUEUE *Queue,
|
||||
IN EFI_KEY_DATA *KeyData
|
||||
IN SIMPLE_QUEUE *Queue,
|
||||
IN EFI_KEY_DATA *KeyData
|
||||
)
|
||||
{
|
||||
if ((Queue->Rear + 1) % QUEUE_MAX_COUNT == Queue->Front) {
|
||||
@@ -336,8 +339,8 @@ Enqueue (
|
||||
**/
|
||||
EFI_STATUS
|
||||
Dequeue (
|
||||
IN SIMPLE_QUEUE *Queue,
|
||||
IN EFI_KEY_DATA *KeyData
|
||||
IN SIMPLE_QUEUE *Queue,
|
||||
IN EFI_KEY_DATA *KeyData
|
||||
)
|
||||
{
|
||||
if (Queue->Front == Queue->Rear) {
|
||||
@@ -345,7 +348,7 @@ Dequeue (
|
||||
}
|
||||
|
||||
CopyMem (KeyData, &Queue->Buffer[Queue->Front], sizeof (EFI_KEY_DATA));
|
||||
Queue->Front = (Queue->Front + 1) % QUEUE_MAX_COUNT;
|
||||
Queue->Front = (Queue->Front + 1) % QUEUE_MAX_COUNT;
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
@@ -361,7 +364,7 @@ Dequeue (
|
||||
**/
|
||||
EFI_STATUS
|
||||
CheckQueue (
|
||||
IN SIMPLE_QUEUE *Queue
|
||||
IN SIMPLE_QUEUE *Queue
|
||||
)
|
||||
{
|
||||
if (Queue->Front == Queue->Rear) {
|
||||
@@ -386,7 +389,7 @@ VirtualKeyboardCheckForKey (
|
||||
IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This
|
||||
)
|
||||
{
|
||||
VIRTUAL_KEYBOARD_DEV *VirtualKeyboardPrivate;
|
||||
VIRTUAL_KEYBOARD_DEV *VirtualKeyboardPrivate;
|
||||
|
||||
VirtualKeyboardPrivate = VIRTUAL_KEYBOARD_DEV_FROM_THIS (This);
|
||||
|
||||
@@ -404,14 +407,15 @@ VirtualKeyboardCheckForKey (
|
||||
**/
|
||||
EFI_STATUS
|
||||
VirtualKeyboardFreeNotifyList (
|
||||
IN OUT LIST_ENTRY *ListHead
|
||||
IN OUT LIST_ENTRY *ListHead
|
||||
)
|
||||
{
|
||||
VIRTUAL_KEYBOARD_CONSOLE_IN_EX_NOTIFY *NotifyNode;
|
||||
VIRTUAL_KEYBOARD_CONSOLE_IN_EX_NOTIFY *NotifyNode;
|
||||
|
||||
if (ListHead == NULL) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
while (!IsListEmpty (ListHead)) {
|
||||
NotifyNode = CR (
|
||||
ListHead->ForwardLink,
|
||||
@@ -450,7 +454,8 @@ IsKeyRegistered (
|
||||
ASSERT (RegsiteredData != NULL && InputData != NULL);
|
||||
|
||||
if ((RegsiteredData->Key.ScanCode != InputData->Key.ScanCode) ||
|
||||
(RegsiteredData->Key.UnicodeChar != InputData->Key.UnicodeChar)) {
|
||||
(RegsiteredData->Key.UnicodeChar != InputData->Key.UnicodeChar))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -459,16 +464,18 @@ IsKeyRegistered (
|
||||
// these state could be ignored.
|
||||
//
|
||||
if ((RegsiteredData->KeyState.KeyShiftState != 0) &&
|
||||
(RegsiteredData->KeyState.KeyShiftState != InputData->KeyState.KeyShiftState)) {
|
||||
(RegsiteredData->KeyState.KeyShiftState != InputData->KeyState.KeyShiftState))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if ((RegsiteredData->KeyState.KeyToggleState != 0) &&
|
||||
(RegsiteredData->KeyState.KeyToggleState != InputData->KeyState.KeyToggleState)) {
|
||||
(RegsiteredData->KeyState.KeyToggleState != InputData->KeyState.KeyToggleState))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -482,8 +489,8 @@ IsKeyRegistered (
|
||||
VOID
|
||||
EFIAPI
|
||||
VirtualKeyboardWaitForKey (
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
)
|
||||
{
|
||||
//
|
||||
@@ -519,21 +526,21 @@ VirtualKeyboardWaitForKey (
|
||||
VOID
|
||||
EFIAPI
|
||||
VirtualKeyboardWaitForKeyEx (
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
)
|
||||
|
||||
{
|
||||
VIRTUAL_KEYBOARD_DEV *VirtualKeyboardPrivate;
|
||||
VIRTUAL_KEYBOARD_DEV *VirtualKeyboardPrivate;
|
||||
|
||||
VirtualKeyboardPrivate = TEXT_INPUT_EX_VIRTUAL_KEYBOARD_DEV_FROM_THIS (Context);
|
||||
VirtualKeyboardWaitForKey (Event, &VirtualKeyboardPrivate->SimpleTextIn);
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
// EFI Simple Text In Protocol Functions
|
||||
//
|
||||
|
||||
/**
|
||||
Reset the Keyboard and do BAT test for it, if (ExtendedVerification == TRUE)
|
||||
then do some extra keyboard validations.
|
||||
@@ -553,9 +560,9 @@ VirtualKeyboardReset (
|
||||
IN BOOLEAN ExtendedVerification
|
||||
)
|
||||
{
|
||||
VIRTUAL_KEYBOARD_DEV *VirtualKeyboardPrivate;
|
||||
EFI_STATUS Status;
|
||||
EFI_TPL OldTpl;
|
||||
VIRTUAL_KEYBOARD_DEV *VirtualKeyboardPrivate;
|
||||
EFI_STATUS Status;
|
||||
EFI_TPL OldTpl;
|
||||
|
||||
VirtualKeyboardPrivate = VIRTUAL_KEYBOARD_DEV_FROM_THIS (This);
|
||||
|
||||
@@ -565,7 +572,8 @@ VirtualKeyboardReset (
|
||||
OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
|
||||
|
||||
if (VirtualKeyboardPrivate->PlatformVirtual &&
|
||||
VirtualKeyboardPrivate->PlatformVirtual->Reset) {
|
||||
VirtualKeyboardPrivate->PlatformVirtual->Reset)
|
||||
{
|
||||
Status = VirtualKeyboardPrivate->PlatformVirtual->Reset ();
|
||||
} else {
|
||||
Status = EFI_INVALID_PARAMETER;
|
||||
@@ -597,16 +605,16 @@ VirtualKeyboardResetEx (
|
||||
IN BOOLEAN ExtendedVerification
|
||||
)
|
||||
{
|
||||
VIRTUAL_KEYBOARD_DEV *VirtualKeyboardPrivate;
|
||||
EFI_STATUS Status;
|
||||
EFI_TPL OldTpl;
|
||||
VIRTUAL_KEYBOARD_DEV *VirtualKeyboardPrivate;
|
||||
EFI_STATUS Status;
|
||||
EFI_TPL OldTpl;
|
||||
|
||||
VirtualKeyboardPrivate = TEXT_INPUT_EX_VIRTUAL_KEYBOARD_DEV_FROM_THIS (This);
|
||||
|
||||
Status = VirtualKeyboardPrivate->SimpleTextIn.Reset (
|
||||
&VirtualKeyboardPrivate->SimpleTextIn,
|
||||
ExtendedVerification
|
||||
);
|
||||
&VirtualKeyboardPrivate->SimpleTextIn,
|
||||
ExtendedVerification
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
@@ -616,7 +624,6 @@ VirtualKeyboardResetEx (
|
||||
gBS->RestoreTPL (OldTpl);
|
||||
|
||||
return EFI_SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -638,11 +645,12 @@ VirtualKeyboardResetEx (
|
||||
EFI_STATUS
|
||||
KeyboardReadKeyStrokeWorker (
|
||||
IN VIRTUAL_KEYBOARD_DEV *VirtualKeyboardPrivate,
|
||||
OUT EFI_KEY_DATA *KeyData
|
||||
OUT EFI_KEY_DATA *KeyData
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_TPL OldTpl;
|
||||
EFI_STATUS Status;
|
||||
EFI_TPL OldTpl;
|
||||
|
||||
if (KeyData == NULL) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
@@ -700,9 +708,9 @@ VirtualKeyboardReadKeyStroke (
|
||||
OUT EFI_INPUT_KEY *Key
|
||||
)
|
||||
{
|
||||
VIRTUAL_KEYBOARD_DEV *VirtualKeyboardPrivate;
|
||||
EFI_STATUS Status;
|
||||
EFI_KEY_DATA KeyData;
|
||||
VIRTUAL_KEYBOARD_DEV *VirtualKeyboardPrivate;
|
||||
EFI_STATUS Status;
|
||||
EFI_KEY_DATA KeyData;
|
||||
|
||||
VirtualKeyboardPrivate = VIRTUAL_KEYBOARD_DEV_FROM_THIS (This);
|
||||
|
||||
@@ -715,12 +723,14 @@ VirtualKeyboardReadKeyStroke (
|
||||
// Convert the Ctrl+[a-z] to Ctrl+[1-26]
|
||||
//
|
||||
if ((KeyData.KeyState.KeyShiftState & (EFI_LEFT_CONTROL_PRESSED | EFI_RIGHT_CONTROL_PRESSED)) != 0) {
|
||||
if (KeyData.Key.UnicodeChar >= L'a' &&
|
||||
KeyData.Key.UnicodeChar <= L'z') {
|
||||
KeyData.Key.UnicodeChar = (CHAR16) (KeyData.Key.UnicodeChar - L'a' + 1);
|
||||
} else if (KeyData.Key.UnicodeChar >= L'A' &&
|
||||
KeyData.Key.UnicodeChar <= L'Z') {
|
||||
KeyData.Key.UnicodeChar = (CHAR16) (KeyData.Key.UnicodeChar - L'A' + 1);
|
||||
if ((KeyData.Key.UnicodeChar >= L'a') &&
|
||||
(KeyData.Key.UnicodeChar <= L'z'))
|
||||
{
|
||||
KeyData.Key.UnicodeChar = (CHAR16)(KeyData.Key.UnicodeChar - L'a' + 1);
|
||||
} else if ((KeyData.Key.UnicodeChar >= L'A') &&
|
||||
(KeyData.Key.UnicodeChar <= L'Z'))
|
||||
{
|
||||
KeyData.Key.UnicodeChar = (CHAR16)(KeyData.Key.UnicodeChar - L'A' + 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -747,11 +757,11 @@ VirtualKeyboardReadKeyStroke (
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
VirtualKeyboardReadKeyStrokeEx (
|
||||
IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
|
||||
OUT EFI_KEY_DATA *KeyData
|
||||
IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
|
||||
OUT EFI_KEY_DATA *KeyData
|
||||
)
|
||||
{
|
||||
VIRTUAL_KEYBOARD_DEV *VirtualKeyboardPrivate;
|
||||
VIRTUAL_KEYBOARD_DEV *VirtualKeyboardPrivate;
|
||||
|
||||
if (KeyData == NULL) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
@@ -760,7 +770,6 @@ VirtualKeyboardReadKeyStrokeEx (
|
||||
VirtualKeyboardPrivate = TEXT_INPUT_EX_VIRTUAL_KEYBOARD_DEV_FROM_THIS (This);
|
||||
|
||||
return KeyboardReadKeyStrokeWorker (VirtualKeyboardPrivate, KeyData);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -822,16 +831,17 @@ VirtualKeyboardRegisterKeyNotify (
|
||||
OUT VOID **NotifyHandle
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
VIRTUAL_KEYBOARD_DEV *VirtualKeyboardPrivate;
|
||||
EFI_TPL OldTpl;
|
||||
VIRTUAL_KEYBOARD_CONSOLE_IN_EX_NOTIFY *NewNotify;
|
||||
LIST_ENTRY *Link;
|
||||
VIRTUAL_KEYBOARD_CONSOLE_IN_EX_NOTIFY *CurrentNotify;
|
||||
EFI_STATUS Status;
|
||||
VIRTUAL_KEYBOARD_DEV *VirtualKeyboardPrivate;
|
||||
EFI_TPL OldTpl;
|
||||
VIRTUAL_KEYBOARD_CONSOLE_IN_EX_NOTIFY *NewNotify;
|
||||
LIST_ENTRY *Link;
|
||||
VIRTUAL_KEYBOARD_CONSOLE_IN_EX_NOTIFY *CurrentNotify;
|
||||
|
||||
if (KeyData == NULL ||
|
||||
NotifyHandle == NULL ||
|
||||
KeyNotificationFunction == NULL) {
|
||||
if ((KeyData == NULL) ||
|
||||
(NotifyHandle == NULL) ||
|
||||
(KeyNotificationFunction == NULL))
|
||||
{
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
@@ -848,7 +858,8 @@ VirtualKeyboardRegisterKeyNotify (
|
||||
//
|
||||
for (Link = VirtualKeyboardPrivate->NotifyList.ForwardLink;
|
||||
Link != &VirtualKeyboardPrivate->NotifyList;
|
||||
Link = Link->ForwardLink) {
|
||||
Link = Link->ForwardLink)
|
||||
{
|
||||
CurrentNotify = CR (
|
||||
Link,
|
||||
VIRTUAL_KEYBOARD_CONSOLE_IN_EX_NOTIFY,
|
||||
@@ -858,7 +869,7 @@ VirtualKeyboardRegisterKeyNotify (
|
||||
if (IsKeyRegistered (&CurrentNotify->KeyData, KeyData)) {
|
||||
if (CurrentNotify->KeyNotificationFn == KeyNotificationFunction) {
|
||||
*NotifyHandle = CurrentNotify;
|
||||
Status = EFI_SUCCESS;
|
||||
Status = EFI_SUCCESS;
|
||||
goto Exit;
|
||||
}
|
||||
}
|
||||
@@ -868,7 +879,7 @@ VirtualKeyboardRegisterKeyNotify (
|
||||
// Allocate resource to save the notification function
|
||||
//
|
||||
|
||||
NewNotify = (VIRTUAL_KEYBOARD_CONSOLE_IN_EX_NOTIFY *) AllocateZeroPool (sizeof (VIRTUAL_KEYBOARD_CONSOLE_IN_EX_NOTIFY));
|
||||
NewNotify = (VIRTUAL_KEYBOARD_CONSOLE_IN_EX_NOTIFY *)AllocateZeroPool (sizeof (VIRTUAL_KEYBOARD_CONSOLE_IN_EX_NOTIFY));
|
||||
if (NewNotify == NULL) {
|
||||
Status = EFI_OUT_OF_RESOURCES;
|
||||
goto Exit;
|
||||
@@ -879,8 +890,8 @@ VirtualKeyboardRegisterKeyNotify (
|
||||
CopyMem (&NewNotify->KeyData, KeyData, sizeof (EFI_KEY_DATA));
|
||||
InsertTailList (&VirtualKeyboardPrivate->NotifyList, &NewNotify->NotifyEntry);
|
||||
|
||||
*NotifyHandle = NewNotify;
|
||||
Status = EFI_SUCCESS;
|
||||
*NotifyHandle = NewNotify;
|
||||
Status = EFI_SUCCESS;
|
||||
|
||||
Exit:
|
||||
//
|
||||
@@ -888,7 +899,6 @@ Exit:
|
||||
//
|
||||
gBS->RestoreTPL (OldTpl);
|
||||
return Status;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -910,11 +920,11 @@ VirtualKeyboardUnregisterKeyNotify (
|
||||
IN VOID *NotificationHandle
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
VIRTUAL_KEYBOARD_DEV *VirtualKeyboardPrivate;
|
||||
EFI_TPL OldTpl;
|
||||
LIST_ENTRY *Link;
|
||||
VIRTUAL_KEYBOARD_CONSOLE_IN_EX_NOTIFY *CurrentNotify;
|
||||
EFI_STATUS Status;
|
||||
VIRTUAL_KEYBOARD_DEV *VirtualKeyboardPrivate;
|
||||
EFI_TPL OldTpl;
|
||||
LIST_ENTRY *Link;
|
||||
VIRTUAL_KEYBOARD_CONSOLE_IN_EX_NOTIFY *CurrentNotify;
|
||||
|
||||
//
|
||||
// Check incoming notification handle
|
||||
@@ -923,8 +933,9 @@ VirtualKeyboardUnregisterKeyNotify (
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (((VIRTUAL_KEYBOARD_CONSOLE_IN_EX_NOTIFY *) NotificationHandle)->Signature !=
|
||||
VIRTUAL_KEYBOARD_CONSOLE_IN_EX_NOTIFY_SIGNATURE) {
|
||||
if (((VIRTUAL_KEYBOARD_CONSOLE_IN_EX_NOTIFY *)NotificationHandle)->Signature !=
|
||||
VIRTUAL_KEYBOARD_CONSOLE_IN_EX_NOTIFY_SIGNATURE)
|
||||
{
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
@@ -937,7 +948,8 @@ VirtualKeyboardUnregisterKeyNotify (
|
||||
|
||||
for (Link = VirtualKeyboardPrivate->NotifyList.ForwardLink;
|
||||
Link != &VirtualKeyboardPrivate->NotifyList;
|
||||
Link = Link->ForwardLink) {
|
||||
Link = Link->ForwardLink)
|
||||
{
|
||||
CurrentNotify = CR (
|
||||
Link,
|
||||
VIRTUAL_KEYBOARD_CONSOLE_IN_EX_NOTIFY,
|
||||
@@ -982,8 +994,8 @@ Exit:
|
||||
VOID
|
||||
EFIAPI
|
||||
VirtualKeyboardTimerHandler (
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
)
|
||||
{
|
||||
EFI_TPL OldTpl;
|
||||
@@ -1001,14 +1013,17 @@ VirtualKeyboardTimerHandler (
|
||||
OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
|
||||
|
||||
if (VirtualKeyboardPrivate->PlatformVirtual &&
|
||||
VirtualKeyboardPrivate->PlatformVirtual->Query) {
|
||||
VirtualKeyboardPrivate->PlatformVirtual->Query)
|
||||
{
|
||||
if (VirtualKeyboardPrivate->PlatformVirtual->Query (&VirtualKey) ==
|
||||
FALSE) {
|
||||
FALSE)
|
||||
{
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
// Found key
|
||||
KeyData.Key.ScanCode = VirtualKey.Key.ScanCode;
|
||||
KeyData.Key.UnicodeChar = VirtualKey.Key.UnicodeChar;
|
||||
KeyData.Key.ScanCode = VirtualKey.Key.ScanCode;
|
||||
KeyData.Key.UnicodeChar = VirtualKey.Key.UnicodeChar;
|
||||
KeyData.KeyState.KeyShiftState = EFI_SHIFT_STATE_VALID;
|
||||
KeyData.KeyState.KeyToggleState = EFI_TOGGLE_STATE_VALID;
|
||||
if (VirtualKeyboardPrivate->PlatformVirtual->Clear) {
|
||||
@@ -1023,7 +1038,8 @@ VirtualKeyboardTimerHandler (
|
||||
//
|
||||
for (Link = VirtualKeyboardPrivate->NotifyList.ForwardLink;
|
||||
Link != &VirtualKeyboardPrivate->NotifyList;
|
||||
Link = Link->ForwardLink) {
|
||||
Link = Link->ForwardLink)
|
||||
{
|
||||
CurrentNotify = CR (
|
||||
Link,
|
||||
VIRTUAL_KEYBOARD_CONSOLE_IN_EX_NOTIFY,
|
||||
@@ -1060,19 +1076,19 @@ Exit:
|
||||
VOID
|
||||
EFIAPI
|
||||
KeyNotifyProcessHandler (
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
VIRTUAL_KEYBOARD_DEV *VirtualKeyboardPrivate;
|
||||
EFI_KEY_DATA KeyData;
|
||||
LIST_ENTRY *Link;
|
||||
LIST_ENTRY *NotifyList;
|
||||
VIRTUAL_KEYBOARD_CONSOLE_IN_EX_NOTIFY *CurrentNotify;
|
||||
EFI_TPL OldTpl;
|
||||
EFI_STATUS Status;
|
||||
VIRTUAL_KEYBOARD_DEV *VirtualKeyboardPrivate;
|
||||
EFI_KEY_DATA KeyData;
|
||||
LIST_ENTRY *Link;
|
||||
LIST_ENTRY *NotifyList;
|
||||
VIRTUAL_KEYBOARD_CONSOLE_IN_EX_NOTIFY *CurrentNotify;
|
||||
EFI_TPL OldTpl;
|
||||
|
||||
VirtualKeyboardPrivate = (VIRTUAL_KEYBOARD_DEV *) Context;
|
||||
VirtualKeyboardPrivate = (VIRTUAL_KEYBOARD_DEV *)Context;
|
||||
|
||||
//
|
||||
// Invoke notification functions.
|
||||
@@ -1091,10 +1107,13 @@ KeyNotifyProcessHandler (
|
||||
if (EFI_ERROR (Status)) {
|
||||
break;
|
||||
}
|
||||
|
||||
for (Link = GetFirstNode (NotifyList);
|
||||
!IsNull (NotifyList, Link);
|
||||
Link = GetNextNode (NotifyList, Link)) {
|
||||
CurrentNotify = CR (Link,
|
||||
Link = GetNextNode (NotifyList, Link))
|
||||
{
|
||||
CurrentNotify = CR (
|
||||
Link,
|
||||
VIRTUAL_KEYBOARD_CONSOLE_IN_EX_NOTIFY,
|
||||
NotifyEntry,
|
||||
VIRTUAL_KEYBOARD_CONSOLE_IN_EX_NOTIFY_SIGNATURE
|
||||
@@ -1119,12 +1138,12 @@ KeyNotifyProcessHandler (
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
InitializeVirtualKeyboard(
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
InitializeVirtualKeyboard (
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_STATUS Status;
|
||||
|
||||
//
|
||||
// Install driver model protocol(s).
|
||||
|
Reference in New Issue
Block a user