GdbSerialLib.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /** @file
  2. Basic serial IO abstaction for GDB
  3. Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #ifndef __GDB_SERIAL_LIB_H__
  7. #define __GDB_SERIAL_LIB_H__
  8. /**
  9. Sets the baud rate, receive FIFO depth, transmit/receice time out, parity,
  10. data buts, and stop bits on a serial device. This call is optional as the serial
  11. port will be set up with defaults base on PCD values.
  12. @param BaudRate The requested baud rate. A BaudRate value of 0 will use the the
  13. device's default interface speed.
  14. @param Parity The type of parity to use on this serial device. A Parity value of
  15. DefaultParity will use the device's default parity value.
  16. @param DataBits The number of data bits to use on the serial device. A DataBits
  17. vaule of 0 will use the device's default data bit setting.
  18. @param StopBits The number of stop bits to use on this serial device. A StopBits
  19. value of DefaultStopBits will use the device's default number of
  20. stop bits.
  21. @retval EFI_SUCCESS The device was configured.
  22. @retval EFI_DEVICE_ERROR The serial device could not be coonfigured.
  23. **/
  24. RETURN_STATUS
  25. EFIAPI
  26. GdbSerialInit (
  27. IN UINT64 BaudRate,
  28. IN UINT8 Parity,
  29. IN UINT8 DataBits,
  30. IN UINT8 StopBits
  31. );
  32. /**
  33. Check to see if a character is available from GDB. Do not read the character as that is
  34. done via GdbGetChar().
  35. @return TRUE - Character available
  36. @return FALSE - Character not available
  37. **/
  38. BOOLEAN
  39. EFIAPI
  40. GdbIsCharAvailable (
  41. VOID
  42. );
  43. /**
  44. Get a character from GDB. This function must be able to run in interrupt context.
  45. @return A character from GDB
  46. **/
  47. CHAR8
  48. EFIAPI
  49. GdbGetChar (
  50. VOID
  51. );
  52. /**
  53. Send a character to GDB. This function must be able to run in interrupt context.
  54. @param Char Send a character to GDB
  55. **/
  56. VOID
  57. EFIAPI
  58. GdbPutChar (
  59. IN CHAR8 Char
  60. );
  61. /**
  62. Send an ASCII string to GDB. This function must be able to run in interrupt context.
  63. @param String Send a string to GDB
  64. **/
  65. VOID
  66. GdbPutString (
  67. IN CHAR8 *String
  68. );
  69. #endif