ReactOS  0.4.14-dev-1007-g90d795b
utbuffer.c File Reference
#include "acpi.h"
#include "accommon.h"
Include dependency graph for utbuffer.c:

Go to the source code of this file.

Macros

#define _COMPONENT   ACPI_UTILITIES
 

Functions

void AcpiUtDumpBuffer (UINT8 *Buffer, UINT32 Count, UINT32 Display, UINT32 BaseOffset)
 
void AcpiUtDebugDumpBuffer (UINT8 *Buffer, UINT32 Count, UINT32 Display, UINT32 ComponentId)
 

Macro Definition Documentation

◆ _COMPONENT

#define _COMPONENT   ACPI_UTILITIES

Definition at line 47 of file utbuffer.c.

Function Documentation

◆ AcpiUtDebugDumpBuffer()

void AcpiUtDebugDumpBuffer ( UINT8 Buffer,
UINT32  Count,
UINT32  Display,
UINT32  ComponentId 
)

Definition at line 219 of file utbuffer.c.

224 {
225 
226  /* Only dump the buffer if tracing is enabled */
227 
228  if (!((ACPI_LV_TABLES & AcpiDbgLevel) &&
229  (ComponentId & AcpiDbgLayer)))
230  {
231  return;
232  }
233 
235 }
#define ACPI_LV_TABLES
Definition: acoutput.h:105
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
void AcpiUtDumpBuffer(UINT8 *Buffer, UINT32 Count, UINT32 Display, UINT32 BaseOffset)
Definition: utbuffer.c:71
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 ACPI_STATUS const char UINT32 const char const char UINT32 ComponentId
Definition: acpixf.h:1274
Definition: bufpool.h:45
int Display
Definition: x11stubs.h:25

◆ AcpiUtDumpBuffer()

void AcpiUtDumpBuffer ( UINT8 Buffer,
UINT32  Count,
UINT32  Display,
UINT32  BaseOffset 
)

Definition at line 71 of file utbuffer.c.

76 {
77  UINT32 i = 0;
78  UINT32 j;
79  UINT32 Temp32;
80  UINT8 BufChar;
81  UINT32 DisplayDataOnly = Display & DB_DISPLAY_DATA_ONLY;
82 
83 
85  if (!Buffer)
86  {
87  AcpiOsPrintf ("Null Buffer Pointer in DumpBuffer!\n");
88  return;
89  }
90 
91  if ((Count < 4) || (Count & 0x01))
92  {
94  }
95 
96  /* Nasty little dump buffer routine! */
97 
98  while (i < Count)
99  {
100  /* Print current offset */
101 
102  if (!DisplayDataOnly)
103  {
104  AcpiOsPrintf ("%8.4X: ", (BaseOffset + i));
105  }
106 
107  /* Print 16 hex chars */
108 
109  for (j = 0; j < 16;)
110  {
111  if (i + j >= Count)
112  {
113  /* Dump fill spaces */
114 
115  AcpiOsPrintf ("%*s", ((Display * 2) + 1), " ");
116  j += Display;
117  continue;
118  }
119 
120  switch (Display)
121  {
122  case DB_BYTE_DISPLAY:
123  default: /* Default is BYTE display */
124 
125  AcpiOsPrintf ("%02X ", Buffer[(ACPI_SIZE) i + j]);
126  break;
127 
128  case DB_WORD_DISPLAY:
129 
130  ACPI_MOVE_16_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]);
131  AcpiOsPrintf ("%04X ", Temp32);
132  break;
133 
134  case DB_DWORD_DISPLAY:
135 
136  ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]);
137  AcpiOsPrintf ("%08X ", Temp32);
138  break;
139 
140  case DB_QWORD_DISPLAY:
141 
142  ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]);
143  AcpiOsPrintf ("%08X", Temp32);
144 
145  ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j + 4]);
146  AcpiOsPrintf ("%08X ", Temp32);
147  break;
148  }
149 
150  j += Display;
151  }
152 
153  /*
154  * Print the ASCII equivalent characters but watch out for the bad
155  * unprintable ones (printable chars are 0x20 through 0x7E)
156  */
157  if (!DisplayDataOnly)
158  {
159  AcpiOsPrintf (" ");
160  for (j = 0; j < 16; j++)
161  {
162  if (i + j >= Count)
163  {
164  AcpiOsPrintf ("\n");
165  return;
166  }
167 
168  /*
169  * Add comment characters so rest of line is ignored when
170  * compiled
171  */
172  if (j == 0)
173  {
174  AcpiOsPrintf ("// ");
175  }
176 
177  BufChar = Buffer[(ACPI_SIZE) i + j];
178  if (isprint (BufChar))
179  {
180  AcpiOsPrintf ("%c", BufChar);
181  }
182  else
183  {
184  AcpiOsPrintf (".");
185  }
186  }
187 
188  /* Done with that line. */
189 
190  AcpiOsPrintf ("\n");
191  }
192  i += 16;
193  }
194 
195  return;
196 }
#define DB_QWORD_DISPLAY
Definition: acutils.h:188
#define DB_WORD_DISPLAY
Definition: acutils.h:186
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
#define DB_DWORD_DISPLAY
Definition: acutils.h:187
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define DB_BYTE_DISPLAY
Definition: acutils.h:185
unsigned int UINT32
Definition: bufpool.h:45
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
void ACPI_INTERNAL_VAR_XFACE AcpiOsPrintf(const char *Format,...)
Definition: osl.c:851
#define ACPI_MOVE_32_TO_32(d, s)
Definition: acmacros.h:148
#define DB_DISPLAY_DATA_ONLY
Definition: acutils.h:189
#define isprint(c)
Definition: acclib.h:73
int Display
Definition: x11stubs.h:25
unsigned char UINT8
#define ACPI_MOVE_16_TO_32(d, s)
Definition: acmacros.h:142

Referenced by AcpiExDoDebugObject(), AcpiPsGetAmlOpcode(), and AcpiUtDebugDumpBuffer().