ReactOS 0.4.16-dev-92-g0c2cdca
rsdump.c File Reference
#include "acpi.h"
#include "accommon.h"
#include "acresrc.h"
Include dependency graph for rsdump.c:

Go to the source code of this file.

Macros

#define _COMPONENT   ACPI_RESOURCES
 

Functions

static void AcpiRsOutString (const char *Title, const char *Value)
 
static void AcpiRsOutInteger8 (const char *Title, UINT8 Value)
 
static void AcpiRsOutInteger16 (const char *Title, UINT16 Value)
 
static void AcpiRsOutInteger32 (const char *Title, UINT32 Value)
 
static void AcpiRsOutInteger64 (const char *Title, UINT64 Value)
 
static void AcpiRsOutTitle (const char *Title)
 
static void AcpiRsDumpByteList (UINT16 Length, UINT8 *Data)
 
static void AcpiRsDumpWordList (UINT16 Length, UINT16 *Data)
 
static void AcpiRsDumpDwordList (UINT8 Length, UINT32 *Data)
 
static void AcpiRsDumpShortByteList (UINT8 Length, UINT8 *Data)
 
static void AcpiRsDumpResourceSource (ACPI_RESOURCE_SOURCE *ResourceSource)
 
static void AcpiRsDumpResourceLabel (char *Title, ACPI_RESOURCE_LABEL *ResourceLabel)
 
static void AcpiRsDumpAddressCommon (ACPI_RESOURCE_DATA *Resource)
 
static void AcpiRsDumpDescriptor (void *Resource, ACPI_RSDUMP_INFO *Table)
 
void AcpiRsDumpResourceList (ACPI_RESOURCE *ResourceList)
 
void AcpiRsDumpIrqList (UINT8 *RouteTable)
 

Macro Definition Documentation

◆ _COMPONENT

#define _COMPONENT   ACPI_RESOURCES

Definition at line 48 of file rsdump.c.

Function Documentation

◆ AcpiRsDumpAddressCommon()

static void AcpiRsDumpAddressCommon ( ACPI_RESOURCE_DATA Resource)
static

Definition at line 544 of file rsdump.c.

546{
548
549
550 /* Decode the type-specific flags */
551
552 switch (Resource->Address.ResourceType)
553 {
555
556 AcpiRsDumpDescriptor (Resource, AcpiRsDumpMemoryFlags);
557 break;
558
559 case ACPI_IO_RANGE:
560
561 AcpiRsDumpDescriptor (Resource, AcpiRsDumpIoFlags);
562 break;
563
565
566 AcpiRsOutString ("Resource Type", "Bus Number Range");
567 break;
568
569 default:
570
571 AcpiRsOutInteger8 ("Resource Type",
572 (UINT8) Resource->Address.ResourceType);
573 break;
574 }
575
576 /* Decode the general flags */
577
578 AcpiRsDumpDescriptor (Resource, AcpiRsDumpGeneralFlags);
579}
unsigned char UINT8
#define ACPI_FUNCTION_ENTRY()
Definition: acoutput.h:484
#define ACPI_BUS_NUMBER_RANGE
Definition: acrestyp.h:139
#define ACPI_IO_RANGE
Definition: acrestyp.h:138
#define ACPI_MEMORY_RANGE
Definition: acrestyp.h:137
_Acquires_exclusive_lock_ Resource _Acquires_shared_lock_ Resource _Inout_ PERESOURCE Resource
Definition: cdprocs.h:843
static void AcpiRsDumpDescriptor(void *Resource, ACPI_RSDUMP_INFO *Table)
Definition: rsdump.c:270
static void AcpiRsOutInteger8(const char *Title, UINT8 Value)
Definition: rsdump.c:611
static void AcpiRsOutString(const char *Title, const char *Value)
Definition: rsdump.c:597

Referenced by AcpiRsDumpDescriptor().

◆ AcpiRsDumpByteList()

static void AcpiRsDumpByteList ( UINT16  Length,
UINT8 Data 
)
static

Definition at line 669 of file rsdump.c.

672{
673 UINT16 i;
674
675
676 for (i = 0; i < Length; i++)
677 {
678 AcpiOsPrintf ("%25s%2.2X : %2.2X\n", "Byte", i, Data[i]);
679 }
680}
unsigned short UINT16
void ACPI_INTERNAL_VAR_XFACE AcpiOsPrintf(const char *Format,...)
Definition: osl.c:851
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
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102

Referenced by AcpiRsDumpDescriptor().

◆ AcpiRsDumpDescriptor()

static void AcpiRsDumpDescriptor ( void Resource,
ACPI_RSDUMP_INFO Table 
)
static

Definition at line 270 of file rsdump.c.

273{
274 UINT8 *Target = NULL;
275 UINT8 *PreviousTarget;
276 const char *Name;
277 UINT8 Count;
278
279
280 /* First table entry must contain the table length (# of table entries) */
281
282 Count = Table->Offset;
283
284 while (Count)
285 {
286 PreviousTarget = Target;
287 Target = ACPI_ADD_PTR (UINT8, Resource, Table->Offset);
288 Name = Table->Name;
289
290 switch (Table->Opcode)
291 {
292 case ACPI_RSD_TITLE:
293 /*
294 * Optional resource title
295 */
296 if (Table->Name)
297 {
298 AcpiOsPrintf ("%s Resource\n", Name);
299 }
300 break;
301
302 /* Strings */
303
304 case ACPI_RSD_LITERAL:
305
306 AcpiRsOutString (Name, ACPI_CAST_PTR (char, Table->Pointer));
307 break;
308
309 case ACPI_RSD_STRING:
310
312 break;
313
314 /* Data items, 8/16/32/64 bit */
315
316 case ACPI_RSD_UINT8:
317
318 if (Table->Pointer)
319 {
320 AcpiRsOutString (Name, Table->Pointer [*Target]);
321 }
322 else
323 {
325 }
326 break;
327
328 case ACPI_RSD_UINT16:
329
331 break;
332
333 case ACPI_RSD_UINT32:
334
336 break;
337
338 case ACPI_RSD_UINT64:
339
341 break;
342
343 /* Flags: 1-bit and 2-bit flags supported */
344
346
347 AcpiRsOutString (Name, Table->Pointer [*Target & 0x01]);
348 break;
349
351
352 AcpiRsOutString (Name, Table->Pointer [*Target & 0x03]);
353 break;
354
356
357 AcpiRsOutString (Name, Table->Pointer [*Target & 0x07]);
358 break;
359
361
363 break;
364
366 /*
367 * Short byte list (single line output) for DMA and IRQ resources
368 * Note: The list length is obtained from the previous table entry
369 */
370 if (PreviousTarget)
371 {
373 AcpiRsDumpShortByteList (*PreviousTarget, Target);
374 }
375 break;
376
378 /*
379 * Short byte list (single line output) for GPIO vendor data
380 * Note: The list length is obtained from the previous table entry
381 */
382 if (PreviousTarget)
383 {
385 AcpiRsDumpShortByteList (*PreviousTarget,
387 }
388 break;
389
391 /*
392 * Long byte list for Vendor resource data
393 * Note: The list length is obtained from the previous table entry
394 */
395 if (PreviousTarget)
396 {
397 AcpiRsDumpByteList (ACPI_GET16 (PreviousTarget), Target);
398 }
399 break;
400
402 /*
403 * Dword list for Extended Interrupt resources
404 * Note: The list length is obtained from the previous table entry
405 */
406 if (PreviousTarget)
407 {
408 AcpiRsDumpDwordList (*PreviousTarget,
410 }
411 break;
412
414 /*
415 * Word list for GPIO Pin Table
416 * Note: The list length is obtained from the previous table entry
417 */
418 if (PreviousTarget)
419 {
420 AcpiRsDumpWordList (*PreviousTarget,
422 }
423 break;
424
425 case ACPI_RSD_ADDRESS:
426 /*
427 * Common flags for all Address resources
428 */
431 break;
432
433 case ACPI_RSD_SOURCE:
434 /*
435 * Optional ResourceSource for Address resources
436 */
439 break;
440
441 case ACPI_RSD_LABEL:
442 /*
443 * ResourceLabel
444 */
445 AcpiRsDumpResourceLabel ("Resource Label", ACPI_CAST_PTR (
447 break;
448
450 /*
451 * ResourceSourceLabel
452 */
453 AcpiRsDumpResourceLabel ("Resource Source Label", ACPI_CAST_PTR (
455 break;
456
457 default:
458
459 AcpiOsPrintf ("**** Invalid table opcode [%X] ****\n",
460 Table->Opcode);
461 return;
462 }
463
464 Table++;
465 Count--;
466 }
467}
unsigned int UINT32
#define ACPI_GET16(ptr)
Definition: acmacros.h:58
#define ACPI_GET32(ptr)
Definition: acmacros.h:59
#define ACPI_GET8(ptr)
Definition: acmacros.h:57
#define ACPI_GET64(ptr)
Definition: acmacros.h:60
@ ACPI_RSD_SOURCE
Definition: acresrc.h:154
@ ACPI_RSD_LITERAL
Definition: acresrc.h:150
@ ACPI_RSD_ADDRESS
Definition: acresrc.h:148
@ ACPI_RSD_6BITFLAG
Definition: acresrc.h:147
@ ACPI_RSD_SHORTLIST
Definition: acresrc.h:152
@ ACPI_RSD_LABEL
Definition: acresrc.h:161
@ ACPI_RSD_LONGLIST
Definition: acresrc.h:151
@ ACPI_RSD_SHORTLISTX
Definition: acresrc.h:153
@ ACPI_RSD_1BITFLAG
Definition: acresrc.h:144
@ ACPI_RSD_UINT16
Definition: acresrc.h:157
@ ACPI_RSD_UINT8
Definition: acresrc.h:156
@ ACPI_RSD_3BITFLAG
Definition: acresrc.h:146
@ ACPI_RSD_UINT32
Definition: acresrc.h:158
@ ACPI_RSD_WORDLIST
Definition: acresrc.h:160
@ ACPI_RSD_DWORDLIST
Definition: acresrc.h:149
@ ACPI_RSD_UINT64
Definition: acresrc.h:159
@ ACPI_RSD_2BITFLAG
Definition: acresrc.h:145
@ ACPI_RSD_TITLE
Definition: acresrc.h:143
@ ACPI_RSD_STRING
Definition: acresrc.h:155
@ ACPI_RSD_SOURCE_LABEL
Definition: acresrc.h:162
#define ACPI_CAST_INDIRECT_PTR(t, p)
Definition: actypes.h:545
#define ACPI_ADD_PTR(t, a, b)
Definition: actypes.h:546
#define ACPI_CAST_PTR(t, p)
Definition: actypes.h:544
struct NameRec_ * Name
Definition: cdprocs.h:460
#define NULL
Definition: types.h:112
ASMGENDATA Table[]
Definition: genincdata.c:61
int Count
Definition: noreturn.cpp:7
static void AcpiRsDumpResourceLabel(char *Title, ACPI_RESOURCE_LABEL *ResourceLabel)
Definition: rsdump.c:518
static void AcpiRsOutInteger16(const char *Title, UINT16 Value)
Definition: rsdump.c:619
static void AcpiRsDumpDwordList(UINT8 Length, UINT32 *Data)
Definition: rsdump.c:699
static void AcpiRsDumpWordList(UINT16 Length, UINT16 *Data)
Definition: rsdump.c:713
static void AcpiRsOutTitle(const char *Title)
Definition: rsdump.c:647
static void AcpiRsDumpResourceSource(ACPI_RESOURCE_SOURCE *ResourceSource)
Definition: rsdump.c:484
static void AcpiRsOutInteger64(const char *Title, UINT64 Value)
Definition: rsdump.c:637
static void AcpiRsOutInteger32(const char *Title, UINT32 Value)
Definition: rsdump.c:628
static void AcpiRsDumpByteList(UINT16 Length, UINT8 *Data)
Definition: rsdump.c:669
static void AcpiRsDumpShortByteList(UINT8 Length, UINT8 *Data)
Definition: rsdump.c:683
static void AcpiRsDumpAddressCommon(ACPI_RESOURCE_DATA *Resource)
Definition: rsdump.c:544
char Name[55]
Definition: genincdata.c:33
_In_ WDFIOTARGET Target
Definition: wdfrequest.h:306

Referenced by AcpiRsDumpAddressCommon(), AcpiRsDumpIrqList(), and AcpiRsDumpResourceList().

◆ AcpiRsDumpDwordList()

static void AcpiRsDumpDwordList ( UINT8  Length,
UINT32 Data 
)
static

Definition at line 699 of file rsdump.c.

702{
703 UINT8 i;
704
705
706 for (i = 0; i < Length; i++)
707 {
708 AcpiOsPrintf ("%25s%2.2X : %8.8X\n", "Dword", i, Data[i]);
709 }
710}

Referenced by AcpiRsDumpDescriptor().

◆ AcpiRsDumpIrqList()

void AcpiRsDumpIrqList ( UINT8 RouteTable)

Definition at line 224 of file rsdump.c.

226{
227 ACPI_PCI_ROUTING_TABLE *PrtElement;
228 UINT8 Count;
229
230
232
233
234 /* Check if debug output enabled */
235
237 {
238 return;
239 }
240
242
243 /* Dump all table elements, Exit on zero length element */
244
245 for (Count = 0; PrtElement->Length; Count++)
246 {
247 AcpiOsPrintf ("\n[%02X] PCI IRQ Routing Table Package\n", Count);
248 AcpiRsDumpDescriptor (PrtElement, AcpiRsDumpPrt);
249
251 PrtElement, PrtElement->Length);
252 }
253}
#define ACPI_IS_DEBUG_ENABLED(Level, Component)
Definition: acoutput.h:490
#define ACPI_LV_RESOURCES
Definition: acoutput.h:108
#define _COMPONENT
Definition: rsdump.c:48

◆ AcpiRsDumpResourceLabel()

static void AcpiRsDumpResourceLabel ( char Title,
ACPI_RESOURCE_LABEL ResourceLabel 
)
static

Definition at line 518 of file rsdump.c.

521{
523
525 ResourceLabel->StringPtr ?
526 ResourceLabel->StringPtr : "[Not Specified]");
527}
static const WCHAR Title[]
Definition: oid.c:1259

Referenced by AcpiRsDumpDescriptor().

◆ AcpiRsDumpResourceList()

void AcpiRsDumpResourceList ( ACPI_RESOURCE ResourceList)

Definition at line 138 of file rsdump.c.

140{
141 UINT32 Count = 0;
142 UINT32 Type;
143
144
146
147
148 /* Check if debug output enabled */
149
151 {
152 return;
153 }
154
155 /* Walk list and dump all resource descriptors (END_TAG terminates) */
156
157 do
158 {
159 AcpiOsPrintf ("\n[%02X] ", Count);
160 Count++;
161
162 /* Validate Type before dispatch */
163
164 Type = ResourceList->Type;
166 {
168 "Invalid descriptor type (%X) in resource list\n",
169 ResourceList->Type);
170 return;
171 }
172 else if (!ResourceList->Type)
173 {
174 ACPI_ERROR ((AE_INFO, "Invalid Zero Resource Type"));
175 return;
176 }
177
178 /* Sanity check the length. It must not be zero, or we loop forever */
179
180 if (!ResourceList->Length)
181 {
183 "Invalid zero length descriptor in resource list\n");
184 return;
185 }
186
187 /* Dump the resource descriptor */
188
190 {
192 AcpiGbl_DumpSerialBusDispatch[
193 ResourceList->Data.CommonSerialBus.Type]);
194 }
195 else
196 {
198 AcpiGbl_DumpResourceDispatch[Type]);
199 }
200
201 /* Point to the next resource structure */
202
204
205 /* Exit when END_TAG descriptor is reached */
206
207 } while (Type != ACPI_RESOURCE_TYPE_END_TAG);
208}
Type
Definition: Type.h:7
#define ACPI_ERROR(plist)
Definition: acoutput.h:240
#define AE_INFO
Definition: acoutput.h:230
#define ACPI_RESOURCE_TYPE_SERIAL_BUS
Definition: acrestyp.h:742
#define ACPI_NEXT_RESOURCE(Res)
Definition: acrestyp.h:812
#define ACPI_RESOURCE_TYPE_END_TAG
Definition: acrestyp.h:730
#define ACPI_RESOURCE_TYPE_MAX
Definition: acrestyp.h:748
_Must_inspect_result_ _In_ WDFIORESREQLIST _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIORESLIST * ResourceList
Definition: wdfresource.h:309

◆ AcpiRsDumpResourceSource()

static void AcpiRsDumpResourceSource ( ACPI_RESOURCE_SOURCE ResourceSource)
static

Definition at line 484 of file rsdump.c.

486{
488
489
490 if (ResourceSource->Index == 0xFF)
491 {
492 return;
493 }
494
495 AcpiRsOutInteger8 ("Resource Source Index",
496 ResourceSource->Index);
497
498 AcpiRsOutString ("Resource Source",
499 ResourceSource->StringPtr ?
500 ResourceSource->StringPtr : "[Not Specified]");
501}

Referenced by AcpiRsDumpDescriptor().

◆ AcpiRsDumpShortByteList()

static void AcpiRsDumpShortByteList ( UINT8  Length,
UINT8 Data 
)
static

Definition at line 683 of file rsdump.c.

686{
687 UINT8 i;
688
689
690 for (i = 0; i < Length; i++)
691 {
692 AcpiOsPrintf ("%X ", Data[i]);
693 }
694
695 AcpiOsPrintf ("\n");
696}

Referenced by AcpiRsDumpDescriptor().

◆ AcpiRsDumpWordList()

static void AcpiRsDumpWordList ( UINT16  Length,
UINT16 Data 
)
static

Definition at line 713 of file rsdump.c.

716{
717 UINT16 i;
718
719
720 for (i = 0; i < Length; i++)
721 {
722 AcpiOsPrintf ("%25s%2.2X : %4.4X\n", "Word", i, Data[i]);
723 }
724}

Referenced by AcpiRsDumpDescriptor().

◆ AcpiRsOutInteger16()

static void AcpiRsOutInteger16 ( const char Title,
UINT16  Value 
)
static

Definition at line 619 of file rsdump.c.

622{
623
624 AcpiOsPrintf ("%27s : %4.4X\n", Title, Value);
625}
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413

Referenced by AcpiRsDumpDescriptor().

◆ AcpiRsOutInteger32()

static void AcpiRsOutInteger32 ( const char Title,
UINT32  Value 
)
static

Definition at line 628 of file rsdump.c.

631{
632
633 AcpiOsPrintf ("%27s : %8.8X\n", Title, Value);
634}

Referenced by AcpiRsDumpDescriptor().

◆ AcpiRsOutInteger64()

static void AcpiRsOutInteger64 ( const char Title,
UINT64  Value 
)
static

Definition at line 637 of file rsdump.c.

640{
641
642 AcpiOsPrintf ("%27s : %8.8X%8.8X\n", Title,
644}
#define ACPI_FORMAT_UINT64(i)
Definition: acmacros.h:71

Referenced by AcpiRsDumpDescriptor().

◆ AcpiRsOutInteger8()

static void AcpiRsOutInteger8 ( const char Title,
UINT8  Value 
)
static

Definition at line 611 of file rsdump.c.

614{
615 AcpiOsPrintf ("%27s : %2.2X\n", Title, Value);
616}

Referenced by AcpiRsDumpAddressCommon(), AcpiRsDumpDescriptor(), and AcpiRsDumpResourceSource().

◆ AcpiRsOutString()

static void AcpiRsOutString ( const char Title,
const char Value 
)
static

Definition at line 597 of file rsdump.c.

600{
601
602 AcpiOsPrintf ("%27s : %s", Title, Value);
603 if (!*Value)
604 {
605 AcpiOsPrintf ("[NULL NAMESTRING]");
606 }
607 AcpiOsPrintf ("\n");
608}

Referenced by AcpiRsDumpAddressCommon(), AcpiRsDumpDescriptor(), AcpiRsDumpResourceLabel(), and AcpiRsDumpResourceSource().

◆ AcpiRsOutTitle()

static void AcpiRsOutTitle ( const char Title)
static

Definition at line 647 of file rsdump.c.

649{
650
651 AcpiOsPrintf ("%27s : ", Title);
652}

Referenced by AcpiRsDumpDescriptor().