]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EmbeddedPkg/GdbStub/GdbStubInternal.h
ARM Packages: Replace tabs by spaces for indentation
[mirror_edk2.git] / EmbeddedPkg / GdbStub / GdbStubInternal.h
index e84ca3a0abf46f14084dc7285677ee45f54c6b11..521c3442e0e21e56cca0214200fd74457e9b3651 100644 (file)
@@ -37,7 +37,7 @@
 extern CONST CHAR8 mHexToStr[];\r
 \r
 // maximum size of input and output buffers\r
-// This value came from the show remote command of the gdb we tested against \r
+// This value came from the show remote command of the gdb we tested against\r
 #define MAX_BUF_SIZE 2000\r
 \r
 // maximum size of address buffer\r
@@ -59,7 +59,7 @@ extern CONST CHAR8 mHexToStr[];
 //\r
 // GDB Signal definitions - generic names for interrupts\r
 //\r
-#define GDB_SIGILL      4  // Illegal instruction       \r
+#define GDB_SIGILL      4  // Illegal instruction\r
 #define GDB_SIGTRAP     5  // Trace Trap (Breakpoint and SingleStep)\r
 #define GDB_SIGEMT      7  // Emulator Trap\r
 #define GDB_SIGFPE      8  // Floating point exception\r
@@ -71,9 +71,9 @@ extern CONST CHAR8 mHexToStr[];
 // Includes all general GDB Unix like error values\r
 //\r
 #define GDB_EBADMEMADDRBUFSIZE   11  // the buffer that stores memory Address to be read from/written to is not the right size\r
-#define GDB_EBADMEMLENGBUFSIZE   12  // the buffer that stores Length is not the right size \r
+#define GDB_EBADMEMLENGBUFSIZE   12  // the buffer that stores Length is not the right size\r
 #define GDB_EBADMEMLENGTH        13  // Length, the given number of bytes to read or write, is not the right size\r
-#define GDB_EBADMEMDATA          14  // one of the bytes or nibbles of the memory is leess than 0 \r
+#define GDB_EBADMEMDATA          14  // one of the bytes or nibbles of the memory is leess than 0\r
 #define GDB_EBADMEMDATASIZE      15  // the memory data, 'XX..', is too short or too long\r
 #define GDB_EBADBUFSIZE          21  // the buffer created is not the correct size\r
 #define GDB_EINVALIDARG          31  // argument is invalid\r
@@ -93,7 +93,7 @@ extern CONST CHAR8 mHexToStr[];
 //\r
 //Define Register size for different architectures\r
 //\r
-#if defined (MDE_CPU_IA32) \r
+#if defined (MDE_CPU_IA32)\r
 #define REG_SIZE  32\r
 #elif defined (MDE_CPU_X64)\r
 #define REG_SIZE  64\r
@@ -151,7 +151,7 @@ typedef union {
     UINT32  B1:1;           // Breakpoint condition detected\r
     UINT32  B2:1;           // Breakpoint condition detected\r
     UINT32  B3:1;           // Breakpoint condition detected\r
-    UINT32  Reserved_1:9;   // Reserved \r
+    UINT32  Reserved_1:9;   // Reserved\r
     UINT32  BD:1;           // Debug register access detected\r
     UINT32  BS:1;           // Single step\r
     UINT32  BT:1;           // Task switch\r
@@ -210,7 +210,7 @@ extern EFI_EXCEPTION_TYPE_ENTRY gExceptionType[];
 \r
 //\r
 // Set TRUE if F Reply package signals a ctrl-c. We can not process the Ctrl-c\r
-// here we need to wait for the periodic callback to do this. \r
+// here we need to wait for the periodic callback to do this.\r
 //\r
 extern BOOLEAN gCtrlCBreakFlag;\r
 \r
@@ -229,8 +229,8 @@ extern UINTN    gRegisterOffsets[];
 \r
 /**\r
  Return the number of entries in the gExceptionType[]\r
\r
- @retval    UINTN, the number of entries in the gExceptionType[] array.    \r
+\r
+ @retval    UINTN, the number of entries in the gExceptionType[] array.\r
  **/\r
 UINTN\r
 MaxEfiException (\r
@@ -240,8 +240,8 @@ MaxEfiException (
 \r
 /**\r
  Return the number of entries in the gRegisters[]\r
\r
- @retval    UINTN, the number of entries (registers) in the gRegisters[] array.    \r
+\r
+ @retval    UINTN, the number of entries (registers) in the gRegisters[] array.\r
  **/\r
 UINTN\r
 MaxRegisterCount (\r
@@ -250,9 +250,9 @@ MaxRegisterCount (
 \r
 \r
 /**\r
- Check to see if the ISA is supported. \r
+ Check to see if the ISA is supported.\r
  ISA = Instruction Set Architecture\r
\r
+\r
  @retval    TRUE if Isa is supported,\r
  FALSE otherwise.\r
  **/\r
@@ -264,7 +264,7 @@ CheckIsa (
 \r
 /**\r
  Send the T signal with the given exception type (in gdb order) and possibly with n:r pairs related to the watchpoints\r
\r
+\r
  @param  SystemContext        Register content at time of the exception\r
  @param  GdbExceptionType     GDB exception type\r
  **/\r
@@ -272,35 +272,35 @@ CheckIsa (
 VOID\r
 GdbSendTSignal (\r
   IN  EFI_SYSTEM_CONTEXT  SystemContext,\r
-  IN  UINT8                  GdbExceptionType\r
+  IN  UINT8               GdbExceptionType\r
   );\r
 \r
 \r
 /**\r
  Translates the EFI mapping to GDB mapping\r
\r
+\r
  @param     EFIExceptionType        EFI Exception that is being processed\r
  @retval    UINTN that corresponds to EFIExceptionType's GDB exception type number\r
  **/\r
 UINT8\r
-ConvertEFItoGDBtype ( \r
+ConvertEFItoGDBtype (\r
   IN  EFI_EXCEPTION_TYPE EFIExceptionType\r
   );\r
 \r
 \r
 /**\r
- Empties the given buffer \r
+ Empties the given buffer\r
  @param *Buf pointer to the first element in buffer to be emptied\r
  **/\r
 VOID\r
-EmptyBuffer ( \r
+EmptyBuffer (\r
   IN CHAR8  *Buf\r
   );\r
 \r
 \r
 /**\r
  Converts an 8-bit Hex Char into a INTN.\r
\r
+\r
  @param     Char  - the hex character to be converted into UINTN\r
  @retval    a INTN, from 0 to 15, that corressponds to Char\r
  -1 if Char is not a hex character\r
@@ -315,7 +315,7 @@ HexCharToInt (
  Send an error with the given error number after converting to hex.\r
  The error number is put into the buffer in hex. '255' is the biggest errno we can send.\r
  ex: 162 will be sent as A2.\r
\r
+\r
  @param   errno    the error number that will be sent\r
  **/\r
 VOID\r
@@ -342,8 +342,8 @@ SendNotSupported (
   VOID\r
   );\r
 \r
-/** ‘p n’ \r
- Reads the n-th register's value into an output buffer and sends it as a packet \r
+/** ‘p n’\r
+ Reads the n-th register's value into an output buffer and sends it as a packet\r
  @param     SystemContext       Register content at time of the exception\r
  @param     InBuffer            This is the input buffer received from gdb server\r
  **/\r
@@ -354,12 +354,12 @@ ReadNthRegister (
   );\r
 \r
 \r
-/** ‘g’ \r
- Reads the general registers into an output buffer  and sends it as a packet \r
+/** ‘g’\r
+ Reads the general registers into an output buffer  and sends it as a packet\r
  @param     SystemContext           Register content at time of the exception\r
  **/\r
 VOID\r
-ReadGeneralRegisters (  \r
+ReadGeneralRegisters (\r
   IN    EFI_SYSTEM_CONTEXT  SystemContext\r
   );\r
 \r
@@ -390,10 +390,10 @@ WriteGeneralRegisters (
 \r
 \r
 /** ‘m addr,length ’\r
- Find the Length of the area to read and the start addres. Finally, pass them to \r
- another function, TransferFromMemToOutBufAndSend, that will read from that memory space and \r
+ Find the Length of the area to read and the start addres. Finally, pass them to\r
+ another function, TransferFromMemToOutBufAndSend, that will read from that memory space and\r
  send it as a packet.\r
\r
+\r
  @param  *PacketData  Pointer to Payload data for the packet\r
  **/\r
 VOID\r
@@ -403,10 +403,10 @@ ReadFromMemory (
 \r
 \r
 /** ‘M addr,length :XX...’\r
- Find the Length of the area in bytes to write and the start addres. Finally, pass them to \r
+ Find the Length of the area in bytes to write and the start addres. Finally, pass them to\r
  another function, TransferFromInBufToMem, that will write to that memory space the info in\r
  the input buffer.\r
\r
+\r
  @param   PacketData     Pointer to Payload data for the packet\r
  **/\r
 VOID\r
@@ -415,11 +415,11 @@ WriteToMemory (
   );\r
 \r
 \r
-/** ‘c [addr ]’ \r
- Continue. addr is Address to resume. If addr is omitted, resume at current \r
+/** ‘c [addr ]’\r
+ Continue. addr is Address to resume. If addr is omitted, resume at current\r
  Address.\r
\r
- @param SystemContext Register content at time of the exception  \r
+\r
+ @param SystemContext Register content at time of the exception\r
  @param *PacketData   Pointer to PacketData\r
  **/\r
 \r
@@ -431,9 +431,9 @@ ContinueAtAddress (
 \r
 \r
 /** ‘s [addr ]’\r
- Single step. addr is the Address at which to resume. If addr is omitted, resume \r
+ Single step. addr is the Address at which to resume. If addr is omitted, resume\r
  at same Address.\r
\r
+\r
  @param SystemContext   Register content at time of the exception\r
  @param PacketData      Pointer to Payload data for the packet\r
  **/\r
@@ -443,27 +443,27 @@ SingleStep (
   IN  CHAR8               *PacketData\r
   );\r
 \r
-/** \r
+/**\r
  Insert Single Step in the SystemContext\r
\r
+\r
  @param SystemContext   Register content at time of the exception\r
  **/\r
 VOID\r
 AddSingleStep (\r
   IN  EFI_SYSTEM_CONTEXT  SystemContext\r
   );\r
-  \r
-/** \r
+\r
+/**\r
  Remove Single Step in the SystemContext\r
\r
+\r
  @param SystemContext   Register content at time of the exception\r
  **/\r
 VOID\r
 RemoveSingleStep (\r
   IN  EFI_SYSTEM_CONTEXT  SystemContext\r
   );\r
-  \r
-  \r
+\r
+\r
 /**\r
   ‘Z1, [addr], [length]’\r
   ‘Z2, [addr], [length]’\r
@@ -507,36 +507,36 @@ RemoveBreakPoint(
 /**\r
  Exception Hanldler for GDB. It will be called for all exceptions\r
  registered via the gExceptionType[] array.\r
\r
+\r
  @param ExceptionType   Exception that is being processed\r
- @param SystemContext   Register content at time of the exception  \r
\r
+ @param SystemContext   Register content at time of the exception\r
+\r
  **/\r
 VOID\r
 EFIAPI\r
-GdbExceptionHandler ( \r
-  IN     EFI_EXCEPTION_TYPE  ExceptionType, \r
-  IN OUT EFI_SYSTEM_CONTEXT  SystemContext \r
+GdbExceptionHandler (\r
+  IN     EFI_EXCEPTION_TYPE  ExceptionType,\r
+  IN OUT EFI_SYSTEM_CONTEXT  SystemContext\r
   );\r
 \r
 \r
 /**\r
- Periodic callback for GDB. This function is used to catch a ctrl-c or other \r
+ Periodic callback for GDB. This function is used to catch a ctrl-c or other\r
  break in type command from GDB.\r
\r
+\r
  @param SystemContext           Register content at time of the call\r
\r
+\r
  **/\r
 VOID\r
 EFIAPI\r
-GdbPeriodicCallBack ( \r
-  IN OUT EFI_SYSTEM_CONTEXT  SystemContext \r
+GdbPeriodicCallBack (\r
+  IN OUT EFI_SYSTEM_CONTEXT  SystemContext\r
   );\r
 \r
 \r
 /**\r
   Make two serail consoles: 1) StdIn and StdOut via GDB. 2) StdErr via GDB.\r
-  \r
+\r
   These console show up on the remote system running GDB\r
 \r
 **/\r
@@ -549,15 +549,15 @@ GdbInitializeSerialConsole (
 \r
 /**\r
   Send a GDB Remote Serial Protocol Packet\r
-  \r
-  $PacketData#checksum PacketData is passed in and this function adds the packet prefix '$', \r
+\r
+  $PacketData#checksum PacketData is passed in and this function adds the packet prefix '$',\r
   the packet teminating character '#' and the two digit checksum.\r
-  \r
-  If an ack '+' is not sent resend the packet, but timeout eventually so we don't end up \r
+\r
+  If an ack '+' is not sent resend the packet, but timeout eventually so we don't end up\r
   in an infinit loop. This is so if you unplug the debugger code just keeps running\r
 \r
-  @param PacketData   Payload data for the packet  \r
-  \r
+  @param PacketData   Payload data for the packet\r
+\r
   @retval             Number of bytes of packet data sent.\r
 \r
 **/\r
@@ -565,21 +565,21 @@ UINTN
 SendPacket (\r
   IN  CHAR8 *PacketData\r
   );\r
-  \r
+\r
 \r
 /**\r
  Receive a GDB Remote Serial Protocol Packet\r
\r
- $PacketData#checksum PacketData is passed in and this function adds the packet prefix '$', \r
+\r
+ $PacketData#checksum PacketData is passed in and this function adds the packet prefix '$',\r
  the packet teminating character '#' and the two digit checksum.\r
\r
+\r
  If host re-starts sending a packet without ending the previous packet, only the last valid packet is proccessed.\r
  (In other words, if received packet is '$12345$12345$123456#checksum', only '$123456#checksum' will be processed.)\r
\r
+\r
  If an ack '+' is not sent resend the packet\r
\r
- @param PacketData   Payload data for the packet  \r
\r
+\r
+ @param PacketData   Payload data for the packet\r
+\r
  @retval             Number of bytes of packet data received.\r
 \r
  **/\r
@@ -588,15 +588,15 @@ ReceivePacket (
  OUT  CHAR8 *PacketData,\r
  IN   UINTN PacketDataSize\r
  );\r
-  \r
+\r
 \r
 /**\r
-  Read data from a FileDescriptor. On success number of bytes read is returned. Zero indicates \r
+  Read data from a FileDescriptor. On success number of bytes read is returned. Zero indicates\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
-  @param  Count            Number of bytes to transfer. \r
+  @param  Count            Number of bytes to transfer.\r
 \r
   @retval -1               Error\r
   @retval {other}          Number of bytes read.\r
@@ -608,15 +608,15 @@ GdbRead (
   OUT VOID    *Buffer,\r
   IN  UINTN   Count\r
   );\r
-  \r
+\r
 \r
 /**\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
-  @param  Count            Number of bytes to transfer. \r
+  @param  Count            Number of bytes to transfer.\r
 \r
   @retval -1               Error\r
   @retval {other}          Number of bytes written.\r
@@ -629,13 +629,13 @@ GdbWrite (
   IN  UINTN         Count\r
   );\r
 \r
-UINTN *  \r
+UINTN *\r
 FindPointerToRegister (\r
   IN  EFI_SYSTEM_CONTEXT    SystemContext,\r
-  IN  UINTN                 RegNumber  \r
+  IN  UINTN                 RegNumber\r
   );\r
 \r
-CHAR8 * \r
+CHAR8 *\r
 BasicReadRegister (\r
   IN  EFI_SYSTEM_CONTEXT      SystemContext,\r
   IN  UINTN                   RegNumber,\r
@@ -662,7 +662,7 @@ BasicWriteRegister (
   IN  CHAR8                 *InBufPtr\r
   );\r
 \r
-VOID  \r
+VOID\r
 PrintReg (\r
   EFI_SYSTEM_CONTEXT SystemContext\r
   );\r
@@ -678,7 +678,7 @@ ParseBreakpointPacket (
 UINTN\r
 GetBreakpointDataAddress (\r
   IN  EFI_SYSTEM_CONTEXT  SystemContext,\r
-  IN  UINTN               BreakpointNumber \r
+  IN  UINTN               BreakpointNumber\r
   );\r
 \r
 UINTN\r
@@ -689,7 +689,7 @@ GetBreakpointDetected (
 BREAK_TYPE\r
 GetBreakpointType (\r
   IN  EFI_SYSTEM_CONTEXT  SystemContext,\r
-  IN  UINTN               BreakpointNumber  \r
+  IN  UINTN               BreakpointNumber\r
   );\r
 \r
 UINTN\r
@@ -739,8 +739,8 @@ ValidateAddress (
 \r
 BOOLEAN\r
 ValidateException (\r
-  IN  EFI_EXCEPTION_TYPE    ExceptionType, \r
-  IN OUT EFI_SYSTEM_CONTEXT SystemContext \r
+  IN  EFI_EXCEPTION_TYPE    ExceptionType,\r
+  IN OUT EFI_SYSTEM_CONTEXT SystemContext\r
   );\r
 \r
 #endif\r