ReactOS  0.4.14-dev-1314-gacf135d
tbprint.c File Reference
#include "acpi.h"
#include "accommon.h"
#include "actables.h"
Include dependency graph for tbprint.c:

Go to the source code of this file.

Macros

#define _COMPONENT   ACPI_TABLES
 

Functions

static void AcpiTbFixString (char *String, ACPI_SIZE Length)
 
static void AcpiTbCleanupTableHeader (ACPI_TABLE_HEADER *OutHeader, ACPI_TABLE_HEADER *Header)
 
void AcpiTbPrintTableHeader (ACPI_PHYSICAL_ADDRESS Address, ACPI_TABLE_HEADER *Header)
 
ACPI_STATUS AcpiTbVerifyChecksum (ACPI_TABLE_HEADER *Table, UINT32 Length)
 
UINT8 AcpiTbChecksum (UINT8 *Buffer, UINT32 Length)
 

Macro Definition Documentation

◆ _COMPONENT

#define _COMPONENT   ACPI_TABLES

Definition at line 48 of file tbprint.c.

Function Documentation

◆ AcpiTbChecksum()

UINT8 AcpiTbChecksum ( UINT8 Buffer,
UINT32  Length 
)

Definition at line 258 of file tbprint.c.

261 {
262  UINT8 Sum = 0;
263  UINT8 *End = Buffer + Length;
264 
265 
266  while (Buffer < End)
267  {
268  Sum = (UINT8) (Sum + *(Buffer++));
269  }
270 
271  return (Sum);
272 }
Definition: bufpool.h:45
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
unsigned char UINT8

Referenced by AcpiTbValidateRsdp(), and AcpiTbVerifyChecksum().

◆ AcpiTbCleanupTableHeader()

static void AcpiTbCleanupTableHeader ( ACPI_TABLE_HEADER OutHeader,
ACPI_TABLE_HEADER Header 
)
static

Definition at line 113 of file tbprint.c.

116 {
117 
118  memcpy (OutHeader, Header, sizeof (ACPI_TABLE_HEADER));
119 
121  AcpiTbFixString (OutHeader->OemId, ACPI_OEM_ID_SIZE);
124 }
char Signature[ACPI_NAMESEG_SIZE]
Definition: actbl.h:108
static void AcpiTbFixString(char *String, ACPI_SIZE Length)
Definition: tbprint.c:80
char AslCompilerId[ACPI_NAMESEG_SIZE]
Definition: actbl.h:115
#define ACPI_OEM_TABLE_ID_SIZE
Definition: actypes.h:422
Definition: Header.h:8
#define ACPI_OEM_ID_SIZE
Definition: actypes.h:421
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
char OemTableId[ACPI_OEM_TABLE_ID_SIZE]
Definition: actbl.h:113
char OemId[ACPI_OEM_ID_SIZE]
Definition: actbl.h:112
#define ACPI_NAMESEG_SIZE
Definition: actypes.h:415

Referenced by AcpiTbPrintTableHeader().

◆ AcpiTbFixString()

static void AcpiTbFixString ( char String,
ACPI_SIZE  Length 
)
static

Definition at line 80 of file tbprint.c.

83 {
84 
85  while (Length && *String)
86  {
87  if (!isprint ((int) *String))
88  {
89  *String = '?';
90  }
91 
92  String++;
93  Length--;
94  }
95 }
static WCHAR String[]
Definition: stringtable.c:55
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
#define isprint(c)
Definition: acclib.h:73

Referenced by AcpiTbCleanupTableHeader(), and AcpiTbPrintTableHeader().

◆ AcpiTbPrintTableHeader()

void AcpiTbPrintTableHeader ( ACPI_PHYSICAL_ADDRESS  Address,
ACPI_TABLE_HEADER Header 
)

Definition at line 141 of file tbprint.c.

144 {
145  ACPI_TABLE_HEADER LocalHeader;
146 
147 
148  if (ACPI_COMPARE_NAMESEG (Header->Signature, ACPI_SIG_FACS))
149  {
150  /* FACS only has signature and length fields */
151 
152  ACPI_INFO (("%-4.4s 0x%8.8X%8.8X %06X",
153  Header->Signature, ACPI_FORMAT_UINT64 (Address),
154  Header->Length));
155  }
156  else if (ACPI_VALIDATE_RSDP_SIG (Header->Signature))
157  {
158  /* RSDP has no common fields */
159 
160  memcpy (LocalHeader.OemId, ACPI_CAST_PTR (ACPI_TABLE_RSDP,
161  Header)->OemId, ACPI_OEM_ID_SIZE);
162  AcpiTbFixString (LocalHeader.OemId, ACPI_OEM_ID_SIZE);
163 
164  ACPI_INFO (("RSDP 0x%8.8X%8.8X %06X (v%.2d %-6.6s)",
169  LocalHeader.OemId));
170  }
171  else
172  {
173  /* Standard ACPI table with full common header */
174 
175  AcpiTbCleanupTableHeader (&LocalHeader, Header);
176 
177  ACPI_INFO ((
178  "%-4.4s 0x%8.8X%8.8X"
179  " %06X (v%.2d %-6.6s %-8.8s %08X %-4.4s %08X)",
180  LocalHeader.Signature, ACPI_FORMAT_UINT64 (Address),
181  LocalHeader.Length, LocalHeader.Revision, LocalHeader.OemId,
182  LocalHeader.OemTableId, LocalHeader.OemRevision,
183  LocalHeader.AslCompilerId, LocalHeader.AslCompilerRevision));
184  }
185 }
UINT32 OemRevision
Definition: actbl.h:114
UINT32 Length
Definition: actbl.h:109
UINT8 Revision
Definition: actbl.h:110
char Signature[ACPI_NAMESEG_SIZE]
Definition: actbl.h:108
_In_ ULONG Revision
Definition: rtlfuncs.h:1104
static void AcpiTbFixString(char *String, ACPI_SIZE Length)
Definition: tbprint.c:80
char AslCompilerId[ACPI_NAMESEG_SIZE]
Definition: actbl.h:115
Definition: Header.h:8
#define ACPI_SIG_FACS
Definition: actbl.h:69
static WCHAR Address[46]
Definition: ping.c:68
static void AcpiTbCleanupTableHeader(ACPI_TABLE_HEADER *OutHeader, ACPI_TABLE_HEADER *Header)
Definition: tbprint.c:113
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
#define ACPI_COMPARE_NAMESEG(a, b)
Definition: actypes.h:561
#define ACPI_OEM_ID_SIZE
Definition: actypes.h:421
UINT32 AslCompilerRevision
Definition: actbl.h:116
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
char OemTableId[ACPI_OEM_TABLE_ID_SIZE]
Definition: actbl.h:113
#define ACPI_INFO(plist)
Definition: acoutput.h:237
#define ACPI_FORMAT_UINT64(i)
Definition: acmacros.h:71
char OemId[ACPI_OEM_ID_SIZE]
Definition: actbl.h:112
#define ACPI_VALIDATE_RSDP_SIG(a)
Definition: actypes.h:570
#define ACPI_CAST_PTR(t, p)
Definition: actypes.h:544

Referenced by AcpiTbCheckDsdtHeader(), AcpiTbInstallTableWithOverride(), and AcpiTbParseRootTable().

◆ AcpiTbVerifyChecksum()

ACPI_STATUS AcpiTbVerifyChecksum ( ACPI_TABLE_HEADER Table,
UINT32  Length 
)

Definition at line 203 of file tbprint.c.

206 {
207  UINT8 Checksum;
208 
209 
210  /*
211  * FACS/S3PT:
212  * They are the odd tables, have no standard ACPI header and no checksum
213  */
214 
215  if (ACPI_COMPARE_NAMESEG (Table->Signature, ACPI_SIG_S3PT) ||
217  {
218  return (AE_OK);
219  }
220 
221  /* Compute the checksum on the table */
222 
223  Checksum = AcpiTbChecksum (ACPI_CAST_PTR (UINT8, Table), Length);
224 
225  /* Checksum ok? (should be zero) */
226 
227  if (Checksum)
228  {
230  "Incorrect checksum in table [%4.4s] - 0x%2.2X, "
231  "should be 0x%2.2X",
232  Table->Signature, Table->Checksum,
233  (UINT8) (Table->Checksum - Checksum)));
234 
235 #if (ACPI_CHECKSUM_ABORT)
236  return (AE_BAD_CHECKSUM);
237 #endif
238  }
239 
240  return (AE_OK);
241 }
ASMGENDATA Table[]
Definition: genincdata.c:61
#define AE_BAD_CHECKSUM
Definition: acexcep.h:169
#define ACPI_SIG_FACS
Definition: actbl.h:69
#define AE_INFO
Definition: acoutput.h:230
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
#define ACPI_COMPARE_NAMESEG(a, b)
Definition: actypes.h:561
#define ACPI_SIG_S3PT
Definition: actbl1.h:83
UINT8 AcpiTbChecksum(UINT8 *Buffer, UINT32 Length)
Definition: tbprint.c:258
#define ACPI_CAST_PTR(t, p)
Definition: actypes.h:544
unsigned char UINT8
#define AE_OK
Definition: acexcep.h:97
#define ACPI_BIOS_WARNING(plist)
Definition: acoutput.h:241

Referenced by AcpiTbParseFadt(), AcpiTbParseRootTable(), and AcpiTbVerifyTempTable().