-/*++\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
-\r
-Module Name:\r
+/** @file\r
+ Top level C file for debugport driver. Contains initialization function.\r
+ This driver layers on top of SerialIo.\r
+ ALL CODE IN THE SERIALIO STACK MUST BE RE-ENTRANT AND CALLABLE FROM\r
+ INTERRUPT CONTEXT\r
\r
- DebugPort.c\r
+Copyright (c) 2006 - 2008, Intel Corporation. <BR>\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
-Abstract:\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
- Top level C file for debugport driver. Contains initialization function.\r
- This driver layers on top of SerialIo.\r
- \r
- ALL CODE IN THE SERIALIO STACK MUST BE RE-ENTRANT AND CALLABLE FROM\r
- INTERRUPT CONTEXT.\r
-\r
-Revision History\r
-\r
---*/\r
+**/\r
\r
\r
#include "DebugPort.h"\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
+\r
Arguments:\r
DEBUGPORT_DEVICE *DebugPortDevice,\r
\r
Routine Description:\r
Driver entry point. Reads DebugPort variable to determine what device and settings\r
to use as the debug port. Binds exclusively to SerialIo. Reverts to defaults \\r
- if no variable is found. \r
- \r
+ if no variable is found.\r
+\r
Creates debugport and devicepath protocols on new handle.\r
\r
Arguments:\r
Routine Description:\r
Checks to see that there's not already a DebugPort interface somewhere. If so,\r
fail.\r
- \r
+\r
If there's a DEBUGPORT variable, the device path must match exactly. If there's\r
no DEBUGPORT variable, then device path is not checked and does not matter.\r
- \r
+\r
Checks to see that there's a serial io interface on the controller handle\r
that can be bound BY_DRIVER | EXCLUSIVE.\r
- \r
+\r
If all these tests succeed, then we return EFI_SUCCESS, else, EFI_UNSUPPORTED\r
or other error returned by OpenProtocol.\r
\r
This\r
ControllerHandle\r
RemainingDevicePath\r
- \r
+\r
Returns:\r
EFI_UNSUPPORTED\r
EFI_OUT_OF_RESOURCES\r
EFI_SUCCESS\r
- \r
+\r
--*/\r
{\r
EFI_STATUS Status;\r
This\r
ControllerHandle\r
RemainingDevicePath\r
- \r
+\r
Returns:\r
EFI_OUT_OF_RESOURCES\r
EFI_SUCCESS\r
EFI_UNSUPPORTED\r
\r
Arguments:\r
- Per EFI 1.10 driver model\r
- \r
+ Per UEFI 2.0 driver model\r
+\r
Returns:\r
EFI_UNSUPPORTED\r
EFI_SUCCESS\r
- \r
+\r
--*/\r
{\r
EFI_STATUS Status;\r
We cannot call SerialIo:SetAttributes because it uses pool services, which use\r
locks, which affect TPL, so it's not interrupt context safe or re-entrant.\r
SerialIo:Reset() calls SetAttributes, so it can't be used either.\r
- \r
- The port itself should be fine since it was set up during initialization. \r
- \r
+\r
+ The port itself should be fine since it was set up during initialization.\r
+\r
Arguments:\r
This\r
\r
Routine Description:\r
DebugPort protocol member function. Calls SerialIo:Read() after setting\r
if it's different than the last SerialIo access.\r
- \r
+\r
Arguments:\r
IN EFI_DEBUGPORT_PROTOCOL *This\r
IN UINT32 Timeout,\r
DebugPort protocol member function. Calls SerialIo:Write() Writes 8 bytes at\r
a time and does a GetControl between 8 byte writes to help insure reads are\r
interspersed This is poor-man's flow control..\r
- \r
+\r
Arguments:\r
This - Pointer to DebugPort protocol\r
Timeout - Timeout value\r
- BufferSize - On input, the size of Buffer. \r
+ BufferSize - On input, the size of Buffer.\r
On output, the amount of data actually written.\r
Buffer - Pointer to buffer to write\r
\r
Routine Description:\r
DebugPort protocol member function. Calls SerialIo:Write() after setting\r
if it's different than the last SerialIo access.\r
- \r
+\r
Arguments:\r
IN EFI_DEBUGPORT_PROTOCOL *This\r
\r
Unload function that is registered in the LoadImage protocol. It un-installs\r
protocols produced and deallocates pool used by the driver. Called by the core\r
when unloading the driver.\r
- \r
+\r
Arguments:\r
EFI_HANDLE ImageHandle\r
\r