#include "DebugPort.h"\r
\r
//\r
-// Misc. functions local to this module\r
+// Misc. functions local to this module..\r
//\r
STATIC\r
VOID\r
GetDebugPortVariable (\r
- DEBUGPORT_DEVICE *DebugPortDevice\r
- );\r
+ DEBUGPORT_DEVICE *DebugPortDevice\r
+ )\r
+/*++\r
\r
-EFI_STATUS\r
-EFIAPI\r
-ImageUnloadHandler (\r
- EFI_HANDLE ImageHandle\r
- );\r
+Routine Description:\r
+ Local worker function to obtain device path information from DebugPort variable.\r
+ Records requested settings in DebugPort device structure.\r
+ \r
+Arguments:\r
+ DEBUGPORT_DEVICE *DebugPortDevice,\r
+\r
+Returns:\r
+\r
+ Nothing\r
+\r
+--*/\r
+{\r
+ UINTN DataSize;\r
+ EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
+ EFI_STATUS Status;\r
+\r
+ DataSize = 0;\r
+\r
+ Status = gRT->GetVariable (\r
+ (CHAR16 *) EFI_DEBUGPORT_VARIABLE_NAME,\r
+ &gEfiDebugPortVariableGuid,\r
+ NULL,\r
+ &DataSize,\r
+ DebugPortDevice->DebugPortVariable\r
+ );\r
+\r
+ if (Status == EFI_BUFFER_TOO_SMALL) {\r
+ if (gDebugPortDevice->DebugPortVariable != NULL) {\r
+ gBS->FreePool (gDebugPortDevice->DebugPortVariable);\r
+ }\r
+\r
+ DebugPortDevice->DebugPortVariable = AllocatePool (DataSize);\r
+ if (DebugPortDevice->DebugPortVariable != NULL) {\r
+ gRT->GetVariable (\r
+ (CHAR16 *) EFI_DEBUGPORT_VARIABLE_NAME,\r
+ &gEfiDebugPortVariableGuid,\r
+ NULL,\r
+ &DataSize,\r
+ DebugPortDevice->DebugPortVariable\r
+ );\r
+ DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) DebugPortDevice->DebugPortVariable;\r
+ while (!EfiIsDevicePathEnd (DevicePath) && !EfiIsUartDevicePath (DevicePath)) {\r
+ DevicePath = EfiNextDevicePathNode (DevicePath);\r
+ }\r
+\r
+ if (EfiIsDevicePathEnd (DevicePath)) {\r
+ gBS->FreePool (gDebugPortDevice->DebugPortVariable);\r
+ DebugPortDevice->DebugPortVariable = NULL;\r
+ } else {\r
+ gBS->CopyMem (\r
+ &DebugPortDevice->BaudRate,\r
+ &((UART_DEVICE_PATH *) DevicePath)->BaudRate,\r
+ sizeof (((UART_DEVICE_PATH *) DevicePath)->BaudRate)\r
+ );\r
+ DebugPortDevice->ReceiveFifoDepth = DEBUGPORT_UART_DEFAULT_FIFO_DEPTH;\r
+ DebugPortDevice->Timeout = DEBUGPORT_UART_DEFAULT_TIMEOUT;\r
+ gBS->CopyMem (\r
+ &DebugPortDevice->Parity,\r
+ &((UART_DEVICE_PATH *) DevicePath)->Parity,\r
+ sizeof (((UART_DEVICE_PATH *) DevicePath)->Parity)\r
+ );\r
+ gBS->CopyMem (\r
+ &DebugPortDevice->DataBits,\r
+ &((UART_DEVICE_PATH *) DevicePath)->DataBits,\r
+ sizeof (((UART_DEVICE_PATH *) DevicePath)->DataBits)\r
+ );\r
+ gBS->CopyMem (\r
+ &DebugPortDevice->StopBits,\r
+ &((UART_DEVICE_PATH *) DevicePath)->StopBits,\r
+ sizeof (((UART_DEVICE_PATH *) DevicePath)->StopBits)\r
+ );\r
+ }\r
+ }\r
+ }\r
+}\r
\r
//\r
// Globals\r
};\r
\r
DEBUGPORT_DEVICE *gDebugPortDevice;\r
-static UINT32 mHid16550;\r
-static UINT32 mHidStdPcComPort;\r
\r
//\r
// implementation code\r
\r
--*/\r
{\r
- mHid16550 = EFI_ACPI_16550UART_HID;\r
- mHidStdPcComPort = EFI_ACPI_PC_COMPORT_HID;\r
-\r
//\r
// Allocate and Initialize dev structure\r
//\r
gDebugPortDevice->BaudRate = DEBUGPORT_UART_DEFAULT_BAUDRATE;\r
gDebugPortDevice->ReceiveFifoDepth = DEBUGPORT_UART_DEFAULT_FIFO_DEPTH;\r
gDebugPortDevice->Timeout = DEBUGPORT_UART_DEFAULT_TIMEOUT;\r
- gDebugPortDevice->Parity = DEBUGPORT_UART_DEFAULT_PARITY;\r
+ gDebugPortDevice->Parity = (EFI_PARITY_TYPE) DEBUGPORT_UART_DEFAULT_PARITY;\r
gDebugPortDevice->DataBits = DEBUGPORT_UART_DEFAULT_DATA_BITS;\r
- gDebugPortDevice->StopBits = DEBUGPORT_UART_DEFAULT_STOP_BITS;\r
+ gDebugPortDevice->StopBits = (EFI_STOP_BITS_TYPE) DEBUGPORT_UART_DEFAULT_STOP_BITS;\r
\r
return EFI_SUCCESS;\r
}\r
\r
--*/\r
{\r
- DEBUGPORT_DEVICE *DebugPortDevice;\r
UINTN BufferSize;\r
UINTN BitBucket;\r
\r
- DebugPortDevice = DEBUGPORT_DEVICE_FROM_THIS (This);\r
while (This->Poll (This) == EFI_SUCCESS) {\r
BufferSize = 1;\r
This->Read (This, 0, &BufferSize, &BitBucket);\r
\r
return Status;\r
}\r
-//\r
-// Misc. functions local to this module..\r
-//\r
-STATIC\r
-VOID\r
-GetDebugPortVariable (\r
- DEBUGPORT_DEVICE *DebugPortDevice\r
- )\r
-/*++\r
-\r
-Routine Description:\r
- Local worker function to obtain device path information from DebugPort variable.\r
- Records requested settings in DebugPort device structure.\r
- \r
-Arguments:\r
- DEBUGPORT_DEVICE *DebugPortDevice,\r
-\r
-Returns:\r
-\r
- Nothing\r
-\r
---*/\r
-{\r
- UINTN DataSize;\r
- EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
- EFI_STATUS Status;\r
-\r
- DataSize = 0;\r
-\r
- Status = gRT->GetVariable (\r
- (CHAR16 *) EFI_DEBUGPORT_VARIABLE_NAME,\r
- &gEfiDebugPortVariableGuid,\r
- NULL,\r
- &DataSize,\r
- DebugPortDevice->DebugPortVariable\r
- );\r
-\r
- if (Status == EFI_BUFFER_TOO_SMALL) {\r
- if (gDebugPortDevice->DebugPortVariable != NULL) {\r
- gBS->FreePool (gDebugPortDevice->DebugPortVariable);\r
- }\r
-\r
- DebugPortDevice->DebugPortVariable = AllocatePool (DataSize);\r
- if (DebugPortDevice->DebugPortVariable != NULL) {\r
- gRT->GetVariable (\r
- (CHAR16 *) EFI_DEBUGPORT_VARIABLE_NAME,\r
- &gEfiDebugPortVariableGuid,\r
- NULL,\r
- &DataSize,\r
- DebugPortDevice->DebugPortVariable\r
- );\r
- DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) DebugPortDevice->DebugPortVariable;\r
- while (!EfiIsDevicePathEnd (DevicePath) && !EfiIsUartDevicePath (DevicePath)) {\r
- DevicePath = EfiNextDevicePathNode (DevicePath);\r
- }\r
-\r
- if (EfiIsDevicePathEnd (DevicePath)) {\r
- gBS->FreePool (gDebugPortDevice->DebugPortVariable);\r
- DebugPortDevice->DebugPortVariable = NULL;\r
- } else {\r
- gBS->CopyMem (\r
- &DebugPortDevice->BaudRate,\r
- &((UART_DEVICE_PATH *) DevicePath)->BaudRate,\r
- sizeof (((UART_DEVICE_PATH *) DevicePath)->BaudRate)\r
- );\r
- DebugPortDevice->ReceiveFifoDepth = DEBUGPORT_UART_DEFAULT_FIFO_DEPTH;\r
- DebugPortDevice->Timeout = DEBUGPORT_UART_DEFAULT_TIMEOUT;\r
- gBS->CopyMem (\r
- &DebugPortDevice->Parity,\r
- &((UART_DEVICE_PATH *) DevicePath)->Parity,\r
- sizeof (((UART_DEVICE_PATH *) DevicePath)->Parity)\r
- );\r
- gBS->CopyMem (\r
- &DebugPortDevice->DataBits,\r
- &((UART_DEVICE_PATH *) DevicePath)->DataBits,\r
- sizeof (((UART_DEVICE_PATH *) DevicePath)->DataBits)\r
- );\r
- gBS->CopyMem (\r
- &DebugPortDevice->StopBits,\r
- &((UART_DEVICE_PATH *) DevicePath)->StopBits,\r
- sizeof (((UART_DEVICE_PATH *) DevicePath)->StopBits)\r
- );\r
- }\r
- }\r
- }\r
-}\r
\r
EFI_STATUS\r
EFIAPI\r