- \r
- Basic packet format is $packet-data#checksum. So every comand has 4 bytes of overhead: $, \r
- #, 0, 0. The 0 and 0 are the ascii characters for the checksum. \r
- \r
+\r
+ Basic packet format is $packet-data#checksum. So every comand has 4 bytes of overhead: $,\r
+ #, 0, 0. The 0 and 0 are the ascii characters for the checksum.\r
+\r
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
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
- Process a control-C break message. \r
- \r
- Currently a place holder, remove the ASSERT when it gets implemented. \r
+ Process a control-C break message.\r
+\r
+ Currently a place holder, remove the ASSERT when it gets implemented.\r
@param Packet Packet to parse like an F reply packet\r
@param ErrNo Buffer to hold Count bytes that were read\r
\r
@param Packet Packet to parse like an F reply packet\r
@param ErrNo Buffer to hold Count bytes that were read\r
\r
- @retval -1 Error, not a valid F reply packet \r
- @retval other Return the return code from the F reply packet \r
+ @retval -1 Error, not a valid F reply packet\r
+ @retval other Return the return code from the F reply packet\r
the end of a file. On error -1 is returned. If count is zero, GdbRead returns zero.\r
\r
@param FileDescriptor Device to talk to.\r
@param Buffer Buffer to hold Count bytes that were read\r
the end of a file. On error -1 is returned. If count is zero, GdbRead returns zero.\r
\r
@param FileDescriptor Device to talk to.\r
@param Buffer Buffer to hold Count bytes that were read\r
// Send:\r
// "Fread,XX,YYYYYYYY,XX\r
//\r
// XX - FileDescriptor in ASCII\r
// Send:\r
// "Fread,XX,YYYYYYYY,XX\r
//\r
// XX - FileDescriptor in ASCII\r
// XX - Count in ASCII\r
// SS - check sum\r
//\r
Size = AsciiSPrint (Packet, sizeof (Packet), "Fread,%x,%x,%x", FileDescriptor, Buffer, Count);\r
// Packet array is too small if you got this ASSERT\r
ASSERT (Size < sizeof (Packet));\r
// XX - Count in ASCII\r
// SS - check sum\r
//\r
Size = AsciiSPrint (Packet, sizeof (Packet), "Fread,%x,%x,%x", FileDescriptor, Buffer, Count);\r
// Packet array is too small if you got this ASSERT\r
ASSERT (Size < sizeof (Packet));\r
\r
RetCode = GdbParseFReplyPacket (Packet, &ErrNo);\r
Print ((CHAR16 *)L"RetCode: %x..ErrNo: %x..\n", RetCode, ErrNo);\r
\r
RetCode = GdbParseFReplyPacket (Packet, &ErrNo);\r
Print ((CHAR16 *)L"RetCode: %x..ErrNo: %x..\n", RetCode, ErrNo);\r
- Write data to a FileDescriptor. On success number of bytes written is returned. Zero indicates \r
- nothing was written. On error -1 is returned. \r
+ Write data to a FileDescriptor. On success number of bytes written is returned. Zero indicates\r
+ nothing was written. On error -1 is returned.\r
\r
@param FileDescriptor Device to talk to.\r
@param Buffer Buffer to hold Count bytes that are to be written\r
\r
@param FileDescriptor Device to talk to.\r
@param Buffer Buffer to hold Count bytes that are to be written\r
// #Fwrite,XX,YYYYYYYY,XX$SS\r
//\r
// XX - FileDescriptor in ASCII\r
// #Fwrite,XX,YYYYYYYY,XX$SS\r
//\r
// XX - FileDescriptor in ASCII\r
// XX - Count in ASCII\r
// SS - check sum\r
//\r
Size = AsciiSPrint (Packet, sizeof (Packet), "Fwrite,%x,%x,%x", FileDescriptor, Buffer, Count);\r
// Packet array is too small if you got this ASSERT\r
ASSERT (Size < sizeof (Packet));\r
// XX - Count in ASCII\r
// SS - check sum\r
//\r
Size = AsciiSPrint (Packet, sizeof (Packet), "Fwrite,%x,%x,%x", FileDescriptor, Buffer, Count);\r
// Packet array is too small if you got this ASSERT\r
ASSERT (Size < sizeof (Packet));\r
@retval EFI_SUCCESS The device was reset.\r
@retval EFI_DEVICE_ERROR The serial device could not be reset.\r
\r
@retval EFI_SUCCESS The device was reset.\r
@retval EFI_DEVICE_ERROR The serial device could not be reset.\r
\r
- Sets the baud rate, receive FIFO depth, transmit/receice time out, parity, \r
+ Sets the baud rate, receive FIFO depth, transmit/receice time out, parity,\r
data buts, and stop bits on a serial device.\r
\r
@param This Protocol instance pointer.\r
data buts, and stop bits on a serial device.\r
\r
@param This Protocol instance pointer.\r
\r
@param This Protocol instance pointer.\r
@param Control A pointer to return the current Control signals from the serial device.\r
\r
@param This Protocol instance pointer.\r
@param Control A pointer to return the current Control signals from the serial device.\r
@retval EFI_SUCCESS The control bits were read from the serial device.\r
@retval EFI_DEVICE_ERROR The serial device is not functioning correctly.\r
\r
@retval EFI_SUCCESS The control bits were read from the serial device.\r
@retval EFI_DEVICE_ERROR The serial device is not functioning correctly.\r
\r
Return = GdbWrite (SerialDev->OutFileDescriptor, Buffer, *BufferSize);\r
if (Return == (UINTN)-1) {\r
return EFI_DEVICE_ERROR;\r
}\r
Return = GdbWrite (SerialDev->OutFileDescriptor, Buffer, *BufferSize);\r
if (Return == (UINTN)-1) {\r
return EFI_DEVICE_ERROR;\r
}\r
Return = GdbRead (SerialDev->InFileDescriptor, Buffer, *BufferSize);\r
if (Return == (UINTN)-1) {\r
return EFI_DEVICE_ERROR;\r
}\r
Return = GdbRead (SerialDev->InFileDescriptor, Buffer, *BufferSize);\r
if (Return == (UINTN)-1) {\r
return EFI_DEVICE_ERROR;\r
}\r
// Template used to initailize the GDB Serial IO protocols\r
//\r
GDB_SERIAL_DEV gdbSerialDevTemplate = {\r
GDB_SERIAL_DEV_SIGNATURE,\r
NULL,\r
// Template used to initailize the GDB Serial IO protocols\r
//\r
GDB_SERIAL_DEV gdbSerialDevTemplate = {\r
GDB_SERIAL_DEV_SIGNATURE,\r
NULL,\r
// Use the template to make a copy of the Serial Console private data structure.\r
StdOutSerialDev = AllocateCopyPool (sizeof (GDB_SERIAL_DEV), &gdbSerialDevTemplate);\r
ASSERT (StdOutSerialDev != NULL);\r
// Use the template to make a copy of the Serial Console private data structure.\r
StdOutSerialDev = AllocateCopyPool (sizeof (GDB_SERIAL_DEV), &gdbSerialDevTemplate);\r
ASSERT (StdOutSerialDev != NULL);\r
StdErrSerialDev = AllocateCopyPool (sizeof (GDB_SERIAL_DEV), &gdbSerialDevTemplate);\r
ASSERT (StdErrSerialDev != NULL);\r
\r
// Fixup pointer and modify stuff that is different for StdError\r
StdErrSerialDev = AllocateCopyPool (sizeof (GDB_SERIAL_DEV), &gdbSerialDevTemplate);\r
ASSERT (StdErrSerialDev != NULL);\r
\r
// Fixup pointer and modify stuff that is different for StdError\r
// Make a new handle with Serial IO protocol and its device path on it.\r
Status = gBS->InstallMultipleProtocolInterfaces (\r
// Make a new handle with Serial IO protocol and its device path on it.\r
Status = gBS->InstallMultipleProtocolInterfaces (\r
&gEfiSerialIoProtocolGuid, &StdOutSerialDev->SerialIo,\r
&gEfiDevicePathProtocolGuid, &StdOutSerialDev->DevicePath,\r
NULL\r
&gEfiSerialIoProtocolGuid, &StdOutSerialDev->SerialIo,\r
&gEfiDevicePathProtocolGuid, &StdOutSerialDev->DevicePath,\r
NULL\r
\r
// Make a new handle with Serial IO protocol and its device path on it.\r
Status = gBS->InstallMultipleProtocolInterfaces (\r
\r
// Make a new handle with Serial IO protocol and its device path on it.\r
Status = gBS->InstallMultipleProtocolInterfaces (\r
&gEfiSerialIoProtocolGuid, &StdErrSerialDev->SerialIo,\r
&gEfiDevicePathProtocolGuid, &StdErrSerialDev->DevicePath,\r
NULL\r
&gEfiSerialIoProtocolGuid, &StdErrSerialDev->SerialIo,\r
&gEfiDevicePathProtocolGuid, &StdErrSerialDev->DevicePath,\r
NULL\r