/*++\r
\r
-Copyright (c) 2006, Intel Corporation \r
-All rights reserved. This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+Copyright (c) 2006, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
Module Name:\r
\r
Terminal.c\r
- \r
-Abstract: \r
+\r
+Abstract:\r
\r
Revision History:\r
\r
\r
#include "Terminal.h"\r
\r
-//\r
-// Function Prototypes\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-TerminalDriverBindingSupported (\r
- IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
- IN EFI_HANDLE Controller,\r
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-TerminalDriverBindingStart (\r
- IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
- IN EFI_HANDLE Controller,\r
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-TerminalDriverBindingStop (\r
- IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
- IN EFI_HANDLE Controller,\r
- IN UINTN NumberOfChildren,\r
- IN EFI_HANDLE *ChildHandleBuffer\r
- );\r
-\r
//\r
// Globals\r
//\r
}\r
}\r
\r
- gBS->FreePool (OpenInfoBuffer);\r
+ FreePool (OpenInfoBuffer);\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
Status = EFI_OUT_OF_RESOURCES;\r
goto Error;\r
}\r
- \r
+\r
CopyMem (&DefaultNode->Guid, &gEfiPcAnsiGuid, sizeof (EFI_GUID));\r
RemainingDevicePath = (EFI_DEVICE_PATH_PROTOCOL*) DefaultNode;\r
- } \r
+ }\r
//\r
// Use the RemainingDevicePath to determine the terminal type\r
//\r
TerminalDevice->SimpleInput.ReadKeyStroke = TerminalConInReadKeyStroke;\r
\r
Status = gBS->CreateEvent (\r
- EFI_EVENT_NOTIFY_WAIT,\r
- EFI_TPL_NOTIFY,\r
+ EVT_NOTIFY_WAIT,\r
+ TPL_NOTIFY,\r
TerminalConInWaitForKey,\r
&TerminalDevice->SimpleInput,\r
&TerminalDevice->SimpleInput.WaitForKey\r
Mode->BaudRate,\r
Mode->ReceiveFifoDepth,\r
(UINT32) SerialInTimeOut,\r
- Mode->Parity,\r
+ (EFI_PARITY_TYPE) (Mode->Parity),\r
(UINT8) Mode->DataBits,\r
- Mode->StopBits\r
+ (EFI_STOP_BITS_TYPE) (Mode->StopBits)\r
);\r
if (EFI_ERROR (Status)) {\r
//\r
TerminalDevice->ResetState = RESET_STATE_DEFAULT;\r
\r
Status = gBS->CreateEvent (\r
- EFI_EVENT_TIMER,\r
- EFI_TPL_CALLBACK,\r
+ EVT_TIMER,\r
+ TPL_CALLBACK,\r
NULL,\r
NULL,\r
&TerminalDevice->TwoSecondTimeOut\r
}\r
\r
if (DefaultNode != NULL) {\r
- gBS->FreePool (DefaultNode);\r
+ FreePool (DefaultNode);\r
}\r
- \r
+\r
return EFI_SUCCESS;\r
\r
ReportError:\r
}\r
\r
if (TerminalDevice->DevicePath != NULL) {\r
- gBS->FreePool (TerminalDevice->DevicePath);\r
+ FreePool (TerminalDevice->DevicePath);\r
}\r
\r
- gBS->FreePool (TerminalDevice);\r
+ FreePool (TerminalDevice);\r
}\r
}\r
\r
if (DefaultNode != NULL) {\r
- gBS->FreePool (DefaultNode);\r
+ FreePool (DefaultNode);\r
}\r
- \r
+\r
This->Stop (This, Controller, 0, NULL);\r
\r
return Status;\r
// Free the ParentDevicePath that was duplicated in Start()\r
//\r
if (!EFI_ERROR (Status)) {\r
- gBS->FreePool (ParentDevicePath);\r
+ FreePool (ParentDevicePath);\r
}\r
}\r
\r
\r
gBS->CloseEvent (TerminalDevice->TwoSecondTimeOut);\r
gBS->CloseEvent (TerminalDevice->SimpleInput.WaitForKey);\r
- gBS->FreePool (TerminalDevice->DevicePath);\r
- gBS->FreePool (TerminalDevice);\r
+ FreePool (TerminalDevice->DevicePath);\r
+ FreePool (TerminalDevice);\r
}\r
}\r
\r
SetTerminalDevicePath (TerminalType, ParentDevicePath, &TempDevicePath);\r
NewVariable = AppendDevicePathInstance (Variable, TempDevicePath);\r
if (Variable != NULL) {\r
- gBS->FreePool (Variable);\r
+ FreePool (Variable);\r
}\r
\r
if (TempDevicePath != NULL) {\r
- gBS->FreePool (TempDevicePath);\r
+ FreePool (TempDevicePath);\r
}\r
\r
Variable = NewVariable;\r
VariableSize,\r
Variable\r
);\r
- gBS->FreePool (Variable);\r
+ ASSERT_EFI_ERROR (Status);\r
+ FreePool (Variable);\r
\r
return ;\r
}\r
/*++\r
\r
Routine Description:\r
- \r
+\r
Remove console device variable.\r
- \r
+\r
Arguments:\r
\r
VariableName - A pointer to the variable name.\r
//\r
Instance = GetNextDevicePathInstance (&Variable, &InstanceSize);\r
if (Instance == NULL) {\r
- gBS->FreePool (OriginalVariable);\r
+ FreePool (OriginalVariable);\r
return ;\r
}\r
//\r
FoundOne = TRUE;\r
}\r
\r
- gBS->FreePool (TempDevicePath);\r
+ FreePool (TempDevicePath);\r
}\r
}\r
//\r
SavedNewVariable = NewVariable;\r
NewVariable = AppendDevicePathInstance (NewVariable, Instance);\r
if (SavedNewVariable != NULL) {\r
- gBS->FreePool (SavedNewVariable);\r
+ FreePool (SavedNewVariable);\r
}\r
}\r
//\r
// Get next device path instance from Variable\r
//\r
- gBS->FreePool (Instance);\r
+ FreePool (Instance);\r
Instance = GetNextDevicePathInstance (&Variable, &InstanceSize);\r
} while (Instance != NULL);\r
\r
- gBS->FreePool (OriginalVariable);\r
+ FreePool (OriginalVariable);\r
\r
if (FoundOne) {\r
VariableSize = GetDevicePathSize (NewVariable);\r
VariableSize,\r
NewVariable\r
);\r
+ ASSERT_EFI_ERROR (Status);\r
}\r
\r
if (NewVariable != NULL) {\r
- gBS->FreePool (NewVariable);\r
+ FreePool (NewVariable);\r
}\r
\r
return ;\r
Caller is repsoncible freeing the buffer.\r
\r
NULL - Variable was not read\r
- \r
+\r
--*/\r
{\r
EFI_STATUS Status;\r
//\r
// Allocate the buffer to return\r
//\r
- gBS->FreePool (Buffer);\r
+ FreePool (Buffer);\r
Buffer = AllocatePool (BufferSize);\r
if (Buffer == NULL) {\r
*VariableSize = 0;\r
Status = gRT->GetVariable (Name, VendorGuid, NULL, &BufferSize, Buffer);\r
if (EFI_ERROR (Status)) {\r
BufferSize = 0;\r
- gBS->FreePool (Buffer);\r
+ FreePool (Buffer);\r
Buffer = NULL;\r
}\r
} else {\r
// Variable not found or other errors met.\r
//\r
BufferSize = 0;\r
- gBS->FreePool (Buffer);\r
+ FreePool (Buffer);\r
Buffer = NULL;\r
}\r
\r