Lines Matching +full:wait +full:- +full:pin +full:- +full:polarity

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
38 #include <sys/wait.h>
96 /* Size of an address. 32-bit for ACPI 1.0, 64-bit for ACPI 2.0 and up. */
108 "S-CRTM Contents",
109 "S-CRTM Version",
116 "Non-Host Code",
117 "Non-Host Config",
118 "Non-Host Info"
133 "S-CRTM Version String",
134 "S-CRTM Contents",
170 len = hbit - lbit + 1;
171 mask = ((1 << (len + 1)) - 1) << lbit;
182 while (length > 0 && (s[length - 1] == ' ' || s[length - 1] == '\0'))
183 length--;
185 while (length--) {
194 switch(gas->SpaceId) {
196 printf("0x%016jx:%u[%u] (Memory)", (uintmax_t)gas->Address,
197 gas->BitOffset, gas->BitWidth);
200 printf("0x%02jx:%u[%u] (IO)", (uintmax_t)gas->Address,
201 gas->BitOffset, gas->BitWidth);
204 printf("%x:%x+0x%x:%u[%u] (PCI)", (uint16_t)(gas->Address >> 32),
205 (uint16_t)((gas->Address >> 16) & 0xffff),
206 (uint16_t)gas->Address, gas->BitOffset, gas->BitWidth);
210 printf("0x%x:%u[%u] (EC)", (uint16_t)gas->Address,
211 gas->BitOffset, gas->BitWidth);
214 printf("0x%x:%u[%u] (SMBus)", (uint16_t)gas->Address,
215 gas->BitOffset, gas->BitWidth);
222 printf("0x%016jx (?)", (uintmax_t)gas->Address);
241 * revision 2 and the 32 bit address is non-zero but the
246 * implementations on 32-bit x86. Because of this limit the
249 if (fadt->Facs != 0 &&
250 (fadt->XFacs & 0xffffffff) != fadt->Facs)
272 addr = fadt->Facs;
274 addr = fadt->XFacs;
278 if (memcmp(facs->Signature, ACPI_SIG_FACS, ACPI_NAMESEG_SIZE) != 0 ||
279 facs->Length < 64)
285 dsdp = (ACPI_TABLE_HEADER *)acpi_map_sdt(fadt->Dsdt);
287 dsdp = (ACPI_TABLE_HEADER *)acpi_map_sdt(fadt->XDsdt);
288 if (acpi_checksum(dsdp, dsdp->Length))
301 end = (char *)table + table->Length;
304 if (subtable->Length < sizeof(ACPI_SUBTABLE_HEADER)) {
305 warnx("invalid subtable length %u", subtable->Length);
310 subtable->Length);
322 end = (char *)table + table->Length;
325 if (subtable->Length < sizeof(ACPI_NFIT_HEADER)) {
326 warnx("invalid subtable length %u", subtable->Length);
331 subtable->Length);
382 printf("\tFlags={Polarity=");
388 printf("active-hi");
391 printf("active-lo");
443 printf("\tLINT Pin=%d\n", lint);
488 if (mp->Type < nitems(apic_types))
489 printf("\tType=%s\n", apic_types[mp->Type]);
491 printf("\tType=%d (unknown)\n", mp->Type);
492 switch (mp->Type) {
495 acpi_print_cpu(lapic->ProcessorId);
496 acpi_print_local_apic(lapic->Id, lapic->LapicFlags);
500 acpi_print_io_apic(ioapic->Id, ioapic->GlobalIrqBase,
501 ioapic->Address);
505 printf("\tBUS=%d\n", (u_int)over->Bus);
506 printf("\tIRQ=%d\n", (u_int)over->SourceIrq);
507 acpi_print_intr(over->GlobalIrq, over->IntiFlags);
511 acpi_print_intr(nmi->GlobalIrq, nmi->IntiFlags);
515 acpi_print_cpu(lapic_nmi->ProcessorId);
516 acpi_print_local_nmi(lapic_nmi->Lint, lapic_nmi->IntiFlags);
521 (uintmax_t)lapic_over->Address);
525 acpi_print_io_apic(iosapic->Id, iosapic->GlobalIrqBase,
526 iosapic->Address);
530 acpi_print_cpu(lsapic->ProcessorId);
531 acpi_print_local_apic(lsapic->Id, lsapic->LapicFlags);
532 printf("\tAPIC EID=%d\n", (u_int)lsapic->Eid);
533 if (mp->Length > __offsetof(ACPI_MADT_LOCAL_SAPIC, Uid))
534 acpi_print_cpu_uid(lsapic->Uid, lsapic->UidString);
538 if (isrc->Type < nitems(platform_int_types))
539 printf("\tType=%s\n", platform_int_types[isrc->Type]);
541 printf("\tType=%d (unknown)\n", isrc->Type);
542 printf("\tAPIC ID=%d\n", (u_int)isrc->Id);
543 printf("\tAPIC EID=%d\n", (u_int)isrc->Eid);
544 printf("\tSAPIC Vector=%d\n", (u_int)isrc->IoSapicVector);
545 acpi_print_intr(isrc->GlobalIrq, isrc->IntiFlags);
549 acpi_print_cpu_uid(x2apic->Uid, NULL);
550 acpi_print_local_apic(x2apic->LocalApicId, x2apic->LapicFlags);
554 acpi_print_cpu_uid(x2apic_nmi->Uid, NULL);
555 acpi_print_local_nmi(x2apic_nmi->Lint, x2apic_nmi->IntiFlags);
559 acpi_print_cpu_uid(gicc->Uid, NULL);
560 printf("\tCPU INTERFACE=%x\n", gicc->CpuInterfaceNumber);
561 acpi_print_gicc_flags(gicc->Flags);
562 printf("\tParking Protocol Version=%x\n", gicc->ParkingVersion);
563 printf("\tPERF INTR=%d\n", gicc->PerformanceInterrupt);
565 (uintmax_t)gicc->ParkedAddress);
566 printf("\tBase ADDR=%016jx\n", (uintmax_t)gicc->BaseAddress);
567 printf("\tGICV=%016jx\n", (uintmax_t)gicc->GicvBaseAddress);
568 printf("\tGICH=%016jx\n", (uintmax_t)gicc->GichBaseAddress);
569 printf("\tVGIC INTR=%d\n", gicc->VgicInterrupt);
571 (uintmax_t)gicc->GicrBaseAddress);
572 printf("\tMPIDR=%jx\n", (uintmax_t)gicc->ArmMpidr);
573 printf("\tEfficiency Class=%d\n", (u_int)gicc->EfficiencyClass);
574 printf("\tSPE INTR=%d\n", gicc->SpeInterrupt);
578 printf("\tGIC ID=%d\n", (u_int)gicd->GicId);
579 printf("\tBase ADDR=%016jx\n", (uintmax_t)gicd->BaseAddress);
580 printf("\tVector Base=%d\n", gicd->GlobalIrqBase);
581 printf("\tGIC VERSION=%d\n", (u_int)gicd->Version);
585 printf("\tBase ADDR=%016jx\n", (uintmax_t)gicr->BaseAddress);
586 printf("\tLength=%08x\n", gicr->Length);
590 printf("\tGIC ITS ID=%d\n", gict->TranslationId);
591 printf("\tBase ADDR=%016jx\n", (uintmax_t)gict->BaseAddress);
604 printf("\tLocal APIC ADDR=0x%08x\n", madt->Address);
606 if (madt->Flags & ACPI_MADT_PCAT_COMPAT)
607 printf("PC-AT");
621 printf("\tRegionLength=%d\n", bert->RegionLength);
622 printf("\tAddress=0x%016jx\n", bert->Address);
630 printf("\n\tAction=%d\n", w->Action);
631 printf("\tInstruction=%d\n", w->Instruction);
632 printf("\tFlags=%02x\n", w->Flags);
634 acpi_print_gas(&w->RegisterRegion);
635 printf("\n\tValue=0x%016jx\n", w->Value);
636 printf("\tMask=0x%016jx\n", w->Mask);
649 printf("\tHeaderLength=%d\n", einj->HeaderLength);
650 printf("\tFlags=0x%02x\n", einj->Flags);
651 printf("\tEntries=%d\n", einj->Entries);
653 for (i = 0; i < MIN(einj->Entries, (sdp->Length -
669 printf("\tHeaderLength=%d\n", erst->HeaderLength);
670 printf("\tEntries=%d\n", erst->Entries);
672 for (i = 0; i < MIN(erst->Entries, (sdp->Length -
683 printf("\t\tBankNumber=%d\n", b->BankNumber);
684 printf("\t\tClearStatusOnInit=%d\n", b->ClearStatusOnInit);
685 printf("\t\tStatusFormat=%d\n", b->StatusFormat);
686 printf("\t\tControlRegister=%x\n", b->ControlRegister);
687 printf("\t\tControlData=%jx\n", b->ControlData);
688 printf("\t\tStatusRegister=%x\n", b->StatusRegister);
689 printf("\t\tAddressRegister=%x\n", b->AddressRegister);
690 printf("\t\tMiscRegister=%x\n", b->MiscRegister);
697 printf("\t\tType=%d\n", n->Type);
698 printf("\t\tLength=%d\n", n->Length);
699 printf("\t\tConfigWriteEnable=%04x\n", n->ConfigWriteEnable);
700 printf("\t\tPollInterval=%d\n", n->PollInterval);
701 printf("\t\tVector=%d\n", n->Vector);
702 printf("\t\tPollingThresholdValue=%d\n", n->PollingThresholdValue);
703 printf("\t\tPollingThresholdWindow=%d\n", n->PollingThresholdWindow);
704 printf("\t\tErrorThresholdValue=%d\n", n->ErrorThresholdValue);
705 printf("\t\tErrorThresholdWindow=%d\n", n->ErrorThresholdWindow);
712 printf("\tFlags=%02x\n", a->Flags);
713 printf("\tEnabled=%d\n", a->Enabled);
714 printf("\tRecordsToPreallocate=%d\n", a->RecordsToPreallocate);
715 printf("\tMaxSectionsPerRecord=%d\n", a->MaxSectionsPerRecord);
716 printf("\tBus=%d\n", a->Bus);
717 printf("\tDevice=%d\n", a->Device);
718 printf("\tFunction=%d\n", a->Function);
719 printf("\tDeviceControl=%d\n", a->DeviceControl);
720 printf("\tUncorrectableMask=%d\n", a->UncorrectableMask);
721 printf("\tUncorrectableSeverity=%d\n", a->UncorrectableSeverity);
722 printf("\tCorrectableMask=%d\n", a->CorrectableMask);
723 printf("\tAdvancedCapabilities=%d\n", a->AdvancedCapabilities);
733 return (-1);
735 printf("\n\tType=%d\n", hdr->Type);
736 printf("\tSourceId=%d\n", hdr->SourceId);
737 switch (hdr->Type) {
740 printf("\tFlags=%02x\n", s->Flags);
741 printf("\tEnabled=%d\n", s->Enabled);
742 printf("\tRecordsToPreallocate=%d\n", s->RecordsToPreallocate);
743 printf("\tMaxSectionsPerRecord=%d\n", s->MaxSectionsPerRecord);
744 printf("\tGlobalCapabilityData=%jd\n", s->GlobalCapabilityData);
745 printf("\tGlobalControlData=%jd\n", s->GlobalControlData);
746 printf("\tNumHardwareBanks=%d\n", s->NumHardwareBanks);
747 for (i = 0; i < s->NumHardwareBanks; i++) {
751 return (sizeof(*s) + s->NumHardwareBanks *
756 printf("\tFlags=%02x\n", s->Flags);
757 printf("\tEnabled=%d\n", s->Enabled);
758 printf("\tRecordsToPreallocate=%d\n", s->RecordsToPreallocate);
759 printf("\tMaxSectionsPerRecord=%d\n", s->MaxSectionsPerRecord);
761 acpi_print_hest_notify(&s->Notify);
762 printf("\tNumHardwareBanks=%d\n", s->NumHardwareBanks);
763 for (i = 0; i < s->NumHardwareBanks; i++) {
767 return (sizeof(*s) + s->NumHardwareBanks *
772 printf("\tRecordsToPreallocate=%d\n", s->RecordsToPreallocate);
773 printf("\tMaxSectionsPerRecord=%d\n", s->MaxSectionsPerRecord);
774 printf("\tMaxRawDataLength=%d\n", s->MaxRawDataLength);
779 acpi_print_hest_aer(&s->Aer);
780 printf("\tRootErrorCommand=%d\n", s->RootErrorCommand);
785 acpi_print_hest_aer(&s->Aer);
790 acpi_print_hest_aer(&s->Aer);
791 printf("\tUncorrectableMask2=%d\n", s->UncorrectableMask2);
792 printf("\tUncorrectableSeverity2=%d\n", s->UncorrectableSeverity2);
793 printf("\tAdvancedCapabilities2=%d\n", s->AdvancedCapabilities2);
798 printf("\tRelatedSourceId=%d\n", s->RelatedSourceId);
799 printf("\tEnabled=%d\n", s->Enabled);
800 printf("\tRecordsToPreallocate=%d\n", s->RecordsToPreallocate);
801 printf("\tMaxSectionsPerRecord=%d\n", s->MaxSectionsPerRecord);
802 printf("\tMaxRawDataLength=%d\n", s->MaxRawDataLength);
804 acpi_print_gas(&s->ErrorStatusAddress);
807 acpi_print_hest_notify(&s->Notify);
808 printf("\tErrorBlockLength=%d\n", s->ErrorBlockLength);
813 printf("\tRelatedSourceId=%d\n", s->RelatedSourceId);
814 printf("\tEnabled=%d\n", s->Enabled);
815 printf("\tRecordsToPreallocate=%d\n", s->RecordsToPreallocate);
816 printf("\tMaxSectionsPerRecord=%d\n", s->MaxSectionsPerRecord);
817 printf("\tMaxRawDataLength=%d\n", s->MaxRawDataLength);
819 acpi_print_gas(&s->ErrorStatusAddress);
822 acpi_print_hest_notify(&s->Notify);
823 printf("\tErrorBlockLength=%d\n", s->ErrorBlockLength);
825 acpi_print_gas(&s->ReadAckRegister);
827 printf("\tReadAckPreserve=%jd\n", s->ReadAckPreserve);
828 printf("\tReadAckWrite=%jd\n", s->ReadAckWrite);
833 printf("\tFlags=%02x\n", s->Flags);
834 printf("\tEnabled=%d\n", s->Enabled);
835 printf("\tRecordsToPreallocate=%d\n", s->RecordsToPreallocate);
836 printf("\tMaxSectionsPerRecord=%d\n", s->MaxSectionsPerRecord);
838 acpi_print_hest_notify(&s->Notify);
839 printf("\tNumHardwareBanks=%d\n", s->NumHardwareBanks);
840 for (i = 0; i < s->NumHardwareBanks; i++) {
844 return (sizeof(*s) + s->NumHardwareBanks *
848 return (-1);
862 printf("\tErrorSourceCount=%d\n", hest->ErrorSourceCount);
864 remaining = sdp->Length - sizeof(ACPI_TABLE_HEST);
866 cp = (char *)sdp + sdp->Length - remaining;
871 remaining -= consumed;
884 printf("\tHPET Number=%d\n", hpet->Sequence);
886 acpi_print_gas(&hpet->Address);
887 printf("\n\tHW Rev=0x%x\n", hpet->Id & ACPI_HPET_ID_HARDWARE_REV_ID);
888 printf("\tComparators=%d\n", (hpet->Id & ACPI_HPET_ID_COMPARATORS) >>
890 printf("\tCounter Size=%d\n", hpet->Id & ACPI_HPET_ID_COUNT_SIZE_CAP ?
893 if (hpet->Id & ACPI_HPET_ID_LEGACY_CAPABLE)
897 printf("\tPCI Vendor ID=0x%04x\n", hpet->Id >> 16);
898 printf("\tMinimal Tick=%d\n", hpet->MinimumTick);
899 printf("\tFlags=0x%02x\n", hpet->Flags);
912 acpi_print_gas(&ecdt->Control);
914 acpi_print_gas(&ecdt->Data);
915 printf("\n\tUID=%#x, ", ecdt->Uid);
916 printf("GPE_BIT=%#x\n", ecdt->Gpe);
917 printf("\tEC_ID=%s\n", ecdt->Id);
931 entries = (sdp->Length - sizeof(ACPI_TABLE_MCFG)) /
936 printf("\tBase Address=0x%016jx\n", (uintmax_t)alloc->Address);
937 printf("\tSegment Group=0x%04x\n", alloc->PciSegment);
938 printf("\tStart Bus=%d\n", alloc->StartBusNumber);
939 printf("\tEnd Bus=%d\n", alloc->EndBusNumber);
953 printf("\tLocality Count=%ju\n", (uintmax_t)slit->LocalityCount);
955 for (i = 0; i < slit->LocalityCount; i++)
958 for (i = 0; i < slit->LocalityCount; i++)
959 printf("----");
961 for (i = 0; i < slit->LocalityCount; i++) {
963 for (j = 0; j < slit->LocalityCount; j++)
965 slit->Entry[i * slit->LocalityCount + j]);
980 wddt->SpecVersion, wddt->TableVersion);
981 printf("\tPciVendorId=0x%04x, Address=", wddt->PciVendorId);
982 acpi_print_gas(&wddt->Address);
984 wddt->MaxCount, wddt->MinCount, wddt->Period);
988 PRINTFLAG(wddt->Status, AVAILABLE);
989 PRINTFLAG(wddt->Status, ACTIVE);
990 PRINTFLAG(wddt->Status, TCO_OS_OWNED);
991 PRINTFLAG(wddt->Status, USER_RESET);
992 PRINTFLAG(wddt->Status, WDT_RESET);
993 PRINTFLAG(wddt->Status, POWER_FAIL);
994 PRINTFLAG(wddt->Status, UNKNOWN_RESET);
997 PRINTFLAG(wddt->Capability, AUTO_RESET);
998 PRINTFLAG(wddt->Capability, ALERT_SUPPORT);
1009 acpi_print_gas(&nl->EntryTrigger);
1010 printf("\n\tResidency=%u\n", nl->Residency);
1011 printf("\tLatency=%u\n", nl->Latency);
1012 if (nl->Header.Flags & ACPI_LPIT_NO_COUNTER)
1016 acpi_print_gas(&nl->ResidencyCounter);
1019 if (nl->CounterFrequency)
1020 printf("\tCounterFrequency=%ju\n", nl->CounterFrequency);
1028 if (lpit->Type == ACPI_LPIT_TYPE_NATIVE_CSTATE)
1031 warnx("unknown LPIT type %u", lpit->Type);
1033 printf("\tLength=%u\n", lpit->Length);
1034 printf("\tUniqueId=0x%04x\n", lpit->UniqueId);
1037 PRINTFLAG(lpit->Flags, STATE_DISABLED);
1041 if (lpit->Type == ACPI_LPIT_TYPE_NATIVE_CSTATE)
1053 end = (char *)table + table->Length;
1056 if (subtable->Length < sizeof(ACPI_LPIT_HEADER)) {
1057 warnx("invalid subtable length %u", subtable->Length);
1062 subtable->Length);
1102 switch(event->event_type) {
1120 tcpa_event_type_strings[event->event_type]);
1124 eventname = calloc(event->event_size + 1, sizeof(char));
1125 memcpy(eventname, pc_event, event->event_size);
1129 switch (pc_event->event_id) {
1143 TCPA_pcclient_strings[pc_event->event_id]);
1148 pc_event->event_id);
1154 asprintf(&eventname, "<unknown 0x%02x>", event->event_type);
1169 printf("\t%d", event->pcr_index);
1172 printf("%02x", event->pcr_value[i]);
1191 switch (tcpa->platform_class) {
1193 len = tcpa->client.log_max_len;
1194 paddr = tcpa->client.log_start_addr;
1198 len = tcpa->server.log_max_len;
1199 paddr = tcpa->server.log_start_addr;
1208 tcpa->platform_class, paddr, len);
1215 if(sdp->Revision == 1){
1229 if (vaddr + event->event_size >= vend)
1231 if (vaddr + event->event_size < vaddr)
1233 if (event->event_type == 0 && event->event_size == 0)
1239 printf("\n\tsize %d\n\t\t%p ", event->event_size, vaddr);
1241 sizeof(struct TCPAevent) + event->event_size; i++) {
1255 vaddr += sizeof(struct TCPAevent) + event->event_size;
1268 printf ("\t\tControlArea=%jx\n", tpm2->ControlAddress);
1269 printf ("\t\tStartMethod=%x\n", tpm2->StartMethod);
1275 static int rates[] = { 9600, 19200, -1, 57600, 115200 };
1276 _Static_assert(nitems(rates) == 7 - 3 + 1, "rates array size incorrect");
1282 return (-1);
1284 return (rates[r - 3]);
1290 [0x00] = "Fully 16550-compatible",
1303 [0x0d] = "(deprecated) Arm SBSA (2.x only) Generic UART supporting only 32-bit accesses",
1308 [0x12] = "16550-compatible with parameters defined in Generic Address Structure",
1311 [0x15] = "RISC-V SBI console (any supported SBI mechanism)",
1335 APPEND(0x10, "RISC-V PLIC/APLIC");
1347 [2] = "VT-UTF8",
1365 printf ("\tInterfaceType=%d (%s)\n", spcr->InterfaceType,
1366 spcr_interface_type(spcr->InterfaceType));
1368 acpi_print_gas(&spcr->SerialPort);
1369 printf ("\n\tInterruptType=%#x (%s)\n", spcr->InterruptType,
1370 spcr_interrupt_type(spcr->InterruptType));
1371 printf ("\tPcInterrupt=%d (%s)\n", spcr->PcInterrupt,
1372 (spcr->InterruptType & 0x1) ? "Valid" : "Invalid");
1373 printf ("\tInterrupt=%d\n", spcr->Interrupt);
1374 printf ("\tBaudRate=%d (%d)\n", spcr_xlate_baud(spcr->BaudRate), spcr->BaudRate);
1375 printf ("\tParity=%d\n", spcr->Parity);
1376 printf ("\tStopBits=%d\n", spcr->StopBits);
1377 printf ("\tFlowControl=%d\n", spcr->FlowControl);
1378 printf ("\tTerminalType=%d (%s)\n", spcr->TerminalType,
1379 spcr_terminal_type(spcr->TerminalType));
1380 printf ("\tPciDeviceId=%#04x\n", spcr->PciDeviceId);
1381 printf ("\tPciVendorId=%#04x\n", spcr->PciVendorId);
1382 printf ("\tPciBus=%d\n", spcr->PciBus);
1383 printf ("\tPciDevice=%d\n", spcr->PciDevice);
1384 printf ("\tPciFunction=%d\n", spcr->PciFunction);
1385 printf ("\tPciFlags=%d\n", spcr->PciFlags);
1386 printf ("\tPciSegment=%d\n", spcr->PciSegment);
1389 if (sdp->Revision >= 3) {
1390 printf("\tLanguage=%d\n", spcr->Language);
1392 (uintmax_t)spcr->UartClkFreq);
1396 if (sdp->Revision >= 4) {
1398 (uintmax_t)spcr->PreciseBaudrate);
1399 if (spcr->NameSpaceStringLength > 0 &&
1400 spcr->NameSpaceStringOffset >= sizeof(*spcr) &&
1401 sdp->Length >= spcr->NameSpaceStringOffset +
1402 spcr->NameSpaceStringLength) {
1404 (char *)sdp + spcr->NameSpaceStringOffset);
1420 return ("PCI Sub-Hierarchy");
1442 return (-1);
1444 if (remaining < devscope->Length)
1445 return (-1);
1448 printf("\t\tType=%s\n", devscope_type2str(devscope->EntryType));
1449 printf("\t\tLength=%d\n", devscope->Length);
1450 printf("\t\tEnumerationId=%d\n", devscope->EnumerationId);
1451 printf("\t\tStartBusNumber=%d\n", devscope->Bus);
1454 pathlen = devscope->Length - sizeof(ACPI_DMAR_DEVICE_SCOPE);
1460 printf("%c%d:%d", sep, path->Device, path->Function);
1467 return (devscope->Length);
1478 printf("\tLength=%d\n", drhd->Header.Length);
1483 PRINTFLAG(drhd->Flags, INCLUDE_ALL);
1488 printf("\tSegment=%d\n", drhd->Segment);
1489 printf("\tAddress=0x%016jx\n", (uintmax_t)drhd->Address);
1491 remaining = drhd->Header.Length - sizeof(ACPI_DMAR_HARDWARE_UNIT);
1495 cp = (char *)drhd + drhd->Header.Length - remaining;
1500 remaining -= consumed;
1512 printf("\tLength=%d\n", rmrr->Header.Length);
1513 printf("\tSegment=%d\n", rmrr->Segment);
1514 printf("\tBaseAddress=0x%016jx\n", (uintmax_t)rmrr->BaseAddress);
1515 printf("\tLimitAddress=0x%016jx\n", (uintmax_t)rmrr->EndAddress);
1517 remaining = rmrr->Header.Length - sizeof(ACPI_DMAR_RESERVED_MEMORY);
1521 cp = (char *)rmrr + rmrr->Header.Length - remaining;
1526 remaining -= consumed;
1538 printf("\tLength=%d\n", atsr->Header.Length);
1543 PRINTFLAG(atsr->Flags, ALL_PORTS);
1548 printf("\tSegment=%d\n", atsr->Segment);
1550 remaining = atsr->Header.Length - sizeof(ACPI_DMAR_ATSR);
1554 cp = (char *)atsr + atsr->Header.Length - remaining;
1559 remaining -= consumed;
1569 printf("\tLength=%d\n", rhsa->Header.Length);
1570 printf("\tBaseAddress=0x%016jx\n", (uintmax_t)rhsa->BaseAddress);
1571 printf("\tProximityDomain=0x%08x\n", rhsa->ProximityDomain);
1580 return (-1);
1582 if (remaining < hdr->Length)
1583 return (-1);
1585 switch (hdr->Type) {
1600 printf("\tType=%d\n", hdr->Type);
1601 printf("\tLength=%d\n", hdr->Length);
1604 return (hdr->Length);
1621 printf("\tHost Address Width=%d\n", dmar->Width + 1);
1626 PRINTFLAG(dmar->Flags, INTR_REMAP);
1627 PRINTFLAG(dmar->Flags, X2APIC_OPT_OUT);
1632 remaining = sdp->Length - sizeof(ACPI_TABLE_DMAR);
1634 cp = (char *)sdp + sdp->Length - remaining;
1639 remaining -= consumed;
1649 addr->Type, addr->DeviceId);
1650 #define PRINTFLAG(flag, name) printflag(addr->Flags, flag, #name)
1721 if (d->Type == ACPI_IVRS_TYPE_PAD4) {
1723 } else if (d->Type == ACPI_IVRS_TYPE_ALL) {
1726 printf("\t\tDev Type=%#x Id=ALL", d4->Header.Type);
1727 acpi_handle_ivrs_ivhd_dte(d4->Header.DataSetting);
1728 } else if (d->Type == ACPI_IVRS_TYPE_SELECT) {
1731 printf("\t\tDev Type=%#x Id=%#06x", d4->Header.Type,
1732 d4->Header.Id);
1733 acpi_handle_ivrs_ivhd_dte(d4->Header.DataSetting);
1734 } else if (d->Type == ACPI_IVRS_TYPE_START) {
1737 printf("\t\tDev Type=%#x Id=%#06x-%#06x",
1738 d4->Header.Type,
1739 d4->Header.Id, (d4 + 1)->Header.Id);
1740 acpi_handle_ivrs_ivhd_dte(d4->Header.DataSetting);
1741 } else if (d->Type == ACPI_IVRS_TYPE_END) {
1745 d4->Header.Type, d4->Header.Id);
1746 } else if (d->Type == ACPI_IVRS_TYPE_PAD8) {
1748 } else if (d->Type == ACPI_IVRS_TYPE_ALIAS_SELECT) {
1752 d8a->Header.Type, d8a->Header.Id, d8a->UsedId);
1753 acpi_handle_ivrs_ivhd_dte(d8a->Header.DataSetting);
1754 } else if (d->Type == ACPI_IVRS_TYPE_ALIAS_START) {
1758 printf("\t\tDev Type=%#x Id=%#06x-%#06x AliasId=%#06x",
1759 d8a->Header.Type, d8a->Header.Id, d4->Header.Id,
1760 d8a->UsedId);
1761 acpi_handle_ivrs_ivhd_dte(d8a->Header.DataSetting);
1762 } else if (d->Type == ACPI_IVRS_TYPE_EXT_SELECT) {
1766 d8a->Header.Type, d8a->Header.Id);
1767 acpi_handle_ivrs_ivhd_dte(d8b->Header.DataSetting);
1769 acpi_handle_ivrs_ivhd_edte(d8b->ExtendedData);
1770 } else if (d->Type == ACPI_IVRS_TYPE_EXT_START) {
1775 printf("\t\tDev Type=%#x Id=%#06x-%#06x",
1776 d8a->Header.Type, d8a->Header.Id, d4->Header.Id);
1777 acpi_handle_ivrs_ivhd_dte(d8b->Header.DataSetting);
1778 acpi_handle_ivrs_ivhd_edte(d8b->ExtendedData);
1779 } else if (d->Type == ACPI_IVRS_TYPE_SPECIAL) {
1784 d8c->Header.Type, d8c->UsedId, d8c->Handle,
1785 d8c->Variety,
1786 acpi_handle_ivrs_ivhd_variety(d8c->Variety));
1787 acpi_handle_ivrs_ivhd_dte(d8c->Header.DataSetting);
1788 } else if (d->Type == ACPI_IVRS_TYPE_HID) {
1790 len = sizeof(*dh) + dh->UidLength;
1792 dh->Header.Type, dh->Header.Id);
1793 acpi_print_string((char *)&dh->AcpiHid,
1794 sizeof(dh->AcpiHid));
1796 acpi_print_string((char *)&dh->AcpiCid,
1797 sizeof(dh->AcpiCid));
1799 switch (dh->UidType) {
1810 dh->UidLength);
1813 acpi_handle_ivrs_ivhd_dte(dh->Header.DataSetting);
1815 printf("\t\tDev Type=%#x Unknown\n", d->Type);
1816 if (d->Type <= 63)
1818 else if (d->Type <= 127)
1831 acpi_handle_ivrs_ivhd_header(&addr->Header);
1833 addr->CapabilityOffset, (uintmax_t)addr->BaseAddress,
1834 addr->PciSegmentGroup, (addr->Info & ACPI_IVHD_UNIT_ID_MASK) >> 8,
1835 addr->Info & ACPI_IVHD_MSI_NUMBER_MASK);
1837 #define PRINTFLAG(flag, name) printflag(addr->FeatureReporting, flag, #name)
1839 printfield(addr->FeatureReporting, lbit, hbit, #name)
1857 (char *)addr + addr->Header.Length);
1863 acpi_handle_ivrs_ivhd_header(&addr->Header);
1865 addr->CapabilityOffset, (uintmax_t)addr->BaseAddress,
1866 addr->PciSegmentGroup, (addr->Info >> 8) & 0x1f,
1867 addr->Info & 0x5);
1870 printfield(addr->Attributes, lbit, hbit, #name)
1882 printf("\tEFRreg=%#018jx\n", (uintmax_t)addr->EfrRegisterImage);
1884 (char *)addr + addr->Header.Length);
1892 (uintmax_t)addr->EfrRegisterImage, (uintmax_t)addr->Reserved);
1894 (char *)addr + addr->Header.Length);
1900 switch (addr->Header.Type) {
1916 addr->Header.Type, acpi_handle_ivrs_ivmd_type(addr));
1917 switch (addr->Header.Type) {
1919 printf("Id=%#06x PCISeg=%#x ", addr->Header.DeviceId,
1920 *(UINT16 *)&addr->Reserved);
1923 printf("Id=%#06x-%#06x PCISeg=%#x", addr->Header.DeviceId,
1924 addr->AuxData, *(UINT16 *)&addr->Reserved);
1928 (uintmax_t)addr->StartAddress, (uintmax_t)addr->MemoryLength);
1929 #define PRINTFLAG(flag, name) printflag(addr->Header.Flags, flag, #name)
1944 return (-1);
1946 if (remaining < hdr->Length)
1947 return (-1);
1949 switch (hdr->Type) {
1970 printf("\tType=%d\n", hdr->Type);
1971 printf("\tLength=%d\n", hdr->Length);
1974 return (hdr->Length);
1992 efrsup = (ivrs->Info & ACPI_IVRS_EFRSUP) != 0;
1994 (ivrs->Info & ACPI_IVRS_VIRTUAL_SIZE) >> 15,
1995 (ivrs->Info & ACPI_IVRS_PHYSICAL_SIZE) >> 8,
1996 (ivrs->Info & ACPI_IVRS_GVA_SIZE) >> 5);
1998 (ivrs->Info & ACPI_IVRS_ATS_RESERVED) != 0,
1999 (ivrs->Info & ACPI_IVRS_DMAREMAP) != 0, efrsup);
2001 remaining = sdp->Length - sizeof(ACPI_TABLE_IVRS);
2003 cp = (char *)sdp + sdp->Length - remaining;
2008 remaining -= consumed;
2019 if (mp->Flags & ACPI_SRAT_MEM_ENABLED)
2023 if (mp->Flags & ACPI_SRAT_MEM_HOT_PLUGGABLE)
2025 if (mp->Flags & ACPI_SRAT_MEM_NON_VOLATILE)
2028 printf("\tBase Address=0x%016jx\n", (uintmax_t)mp->BaseAddress);
2029 printf("\tLength=0x%016jx\n", (uintmax_t)mp->Length);
2030 printf("\tProximity Domain=%d\n", mp->ProximityDomain);
2048 if (srat->Type < nitems(srat_types))
2049 printf("\tType=%s\n", srat_types[srat->Type]);
2051 printf("\tType=%d (unknown)\n", srat->Type);
2052 switch (srat->Type) {
2055 acpi_print_srat_cpu(cpu->ApicId,
2056 cpu->ProximityDomainHi[2] << 24 |
2057 cpu->ProximityDomainHi[1] << 16 |
2058 cpu->ProximityDomainHi[0] << 0 |
2059 cpu->ProximityDomainLo, cpu->Flags);
2066 acpi_print_srat_cpu(x2apic->ApicId, x2apic->ProximityDomain,
2067 x2apic->Flags);
2071 acpi_print_srat_cpu(gic->AcpiProcessorUid, gic->ProximityDomain,
2072 gic->Flags);
2085 printf("\tTable Revision=%d\n", srat->TableRevision);
2116 if (nfit->Type < nitems(nfit_types))
2117 printf("\tType=%s\n", nfit_types[nfit->Type]);
2119 printf("\tType=%u (unknown)\n", nfit->Type);
2120 switch (nfit->Type) {
2123 printf("\tRangeIndex=%u\n", (u_int)sysaddr->RangeIndex);
2125 (u_int)sysaddr->ProximityDomain);
2126 uuid_to_string((uuid_t *)(uintptr_t)(sysaddr->RangeGuid),
2132 printf("\tAddress=0x%016jx\n", (uintmax_t)sysaddr->Address);
2133 printf("\tLength=0x%016jx\n", (uintmax_t)sysaddr->Length);
2135 (uintmax_t)sysaddr->MemoryMapping);
2140 PRINTFLAG(sysaddr->Flags, ADD_ONLINE_ONLY);
2141 PRINTFLAG(sysaddr->Flags, PROXIMITY_VALID);
2149 printf("\tDeviceHandle=0x%x\n", (u_int)mmap->DeviceHandle);
2150 printf("\tPhysicalId=0x%04x\n", (u_int)mmap->PhysicalId);
2151 printf("\tRegionId=%u\n", (u_int)mmap->RegionId);
2152 printf("\tRangeIndex=%u\n", (u_int)mmap->RangeIndex);
2153 printf("\tRegionIndex=%u\n", (u_int)mmap->RegionIndex);
2154 printf("\tRegionSize=0x%016jx\n", (uintmax_t)mmap->RegionSize);
2156 (uintmax_t)mmap->RegionOffset);
2157 printf("\tAddress=0x%016jx\n", (uintmax_t)mmap->Address);
2158 printf("\tInterleaveIndex=%u\n", (u_int)mmap->InterleaveIndex);
2159 printf("\tInterleaveWays=%u\n", (u_int)mmap->InterleaveWays);
2164 PRINTFLAG(mmap->Flags, SAVE_FAILED);
2165 PRINTFLAG(mmap->Flags, RESTORE_FAILED);
2166 PRINTFLAG(mmap->Flags, FLUSH_FAILED);
2167 PRINTFLAG(mmap->Flags, NOT_ARMED);
2168 PRINTFLAG(mmap->Flags, HEALTH_OBSERVED);
2169 PRINTFLAG(mmap->Flags, HEALTH_ENABLED);
2170 PRINTFLAG(mmap->Flags, MAP_FAILED);
2179 (u_int)ileave->InterleaveIndex);
2180 printf("\tLineCount=%u\n", (u_int)ileave->LineCount);
2181 printf("\tLineSize=%u\n", (u_int)ileave->LineSize);
2182 for (m = 0; m < ileave->LineCount; m++) {
2184 (u_int)ileave->LineOffset[m]);
2188 /* XXX smbios->Data[x] output is not supported */
2192 printf("\tRegionIndex=%u\n", (u_int)ctlreg->RegionIndex);
2193 printf("\tVendorId=0x%04x\n", (u_int)ctlreg->VendorId);
2194 printf("\tDeviceId=0x%04x\n", (u_int)ctlreg->DeviceId);
2195 printf("\tRevisionId=0x%02x\n", (u_int)ctlreg->RevisionId);
2197 (u_int)ctlreg->SubsystemVendorId);
2199 (u_int)ctlreg->SubsystemDeviceId);
2201 (u_int)ctlreg->SubsystemRevisionId);
2202 printf("\tValidFields=0x%02x\n", (u_int)ctlreg->ValidFields);
2204 (u_int)ctlreg->ManufacturingLocation);
2206 (u_int)be16toh(ctlreg->ManufacturingDate));
2208 (u_int)be32toh(ctlreg->SerialNumber));
2209 printf("\tCode=0x%04x\n", (u_int)ctlreg->Code);
2210 printf("\tWindows=%u\n", (u_int)ctlreg->Windows);
2212 (uintmax_t)ctlreg->WindowSize);
2214 (uintmax_t)ctlreg->CommandOffset);
2216 (uintmax_t)ctlreg->CommandSize);
2218 (uintmax_t)ctlreg->StatusOffset);
2220 (uintmax_t)ctlreg->StatusSize);
2225 PRINTFLAG(ctlreg->Flags, CONTROL_BUFFERED);
2233 printf("\tRegionIndex=%u\n", (u_int)datareg->RegionIndex);
2234 printf("\tWindows=%u\n", (u_int)datareg->Windows);
2235 printf("\tOffset=0x%016jx\n", (uintmax_t)datareg->Offset);
2236 printf("\tSize=0x%016jx\n", (uintmax_t)datareg->Size);
2237 printf("\tCapacity=0x%016jx\n", (uintmax_t)datareg->Capacity);
2239 (uintmax_t)datareg->StartAddress);
2243 printf("\tDeviceHandle=%u\n", (u_int)fladdr->DeviceHandle);
2244 printf("\tHintCount=%u\n", (u_int)fladdr->HintCount);
2245 for (m = 0; m < fladdr->HintCount; m++) {
2247 (uintmax_t)fladdr->HintAddress[m]);
2252 printf("\tHighestCapability=%u\n", (u_int)caps->HighestCapability);
2257 PRINTFLAG(caps->Capabilities, CACHE_FLUSH);
2258 PRINTFLAG(caps->Capabilities, MEM_FLUSH);
2259 PRINTFLAG(caps->Capabilities, MEM_MIRRORING);
2283 acpi_print_string(sdp->Signature, ACPI_NAMESEG_SIZE);
2285 sdp->Length, sdp->Revision, sdp->Checksum);
2287 acpi_print_string(sdp->OemId, ACPI_OEM_ID_SIZE);
2289 acpi_print_string(sdp->OemTableId, ACPI_OEM_TABLE_ID_SIZE);
2290 printf(", OEM Revision=0x%x,\n", sdp->OemRevision);
2292 acpi_print_string(sdp->AslCompilerId, ACPI_NAMESEG_SIZE);
2293 printf(", Creator Revision=0x%x\n", sdp->AslCompilerRevision);
2307 entries = (rsdp->Length - sizeof(ACPI_TABLE_HEADER)) / addr_size;
2313 printf("0x%08x", le32toh(rsdt->TableOffsetEntry[i]));
2316 (uintmax_t)le64toh(xsdt->TableOffsetEntry[i]));
2336 printf(" \tFACS=0x%x, DSDT=0x%x\n", fadt->Facs,
2337 fadt->Dsdt);
2338 printf("\tINT_MODEL=%s\n", fadt->Model ? "APIC" : "PIC");
2339 if (fadt->PreferredProfile >= sizeof(acpi_pm_profiles) / sizeof(char *))
2342 pm = acpi_pm_profiles[fadt->PreferredProfile];
2343 printf("\tPreferred_PM_Profile=%s (%d)\n", pm, fadt->PreferredProfile);
2344 printf("\tSCI_INT=%d\n", fadt->SciInterrupt);
2345 printf("\tSMI_CMD=0x%x, ", fadt->SmiCommand);
2346 printf("ACPI_ENABLE=0x%x, ", fadt->AcpiEnable);
2347 printf("ACPI_DISABLE=0x%x, ", fadt->AcpiDisable);
2348 printf("S4BIOS_REQ=0x%x\n", fadt->S4BiosRequest);
2349 printf("\tPSTATE_CNT=0x%x\n", fadt->PstateControl);
2350 printf("\tPM1a_EVT_BLK=0x%x-0x%x\n",
2351 fadt->Pm1aEventBlock,
2352 fadt->Pm1aEventBlock + fadt->Pm1EventLength - 1);
2353 if (fadt->Pm1bEventBlock != 0)
2354 printf("\tPM1b_EVT_BLK=0x%x-0x%x\n",
2355 fadt->Pm1bEventBlock,
2356 fadt->Pm1bEventBlock + fadt->Pm1EventLength - 1);
2357 printf("\tPM1a_CNT_BLK=0x%x-0x%x\n",
2358 fadt->Pm1aControlBlock,
2359 fadt->Pm1aControlBlock + fadt->Pm1ControlLength - 1);
2360 if (fadt->Pm1bControlBlock != 0)
2361 printf("\tPM1b_CNT_BLK=0x%x-0x%x\n",
2362 fadt->Pm1bControlBlock,
2363 fadt->Pm1bControlBlock + fadt->Pm1ControlLength - 1);
2364 if (fadt->Pm2ControlBlock != 0)
2365 printf("\tPM2_CNT_BLK=0x%x-0x%x\n",
2366 fadt->Pm2ControlBlock,
2367 fadt->Pm2ControlBlock + fadt->Pm2ControlLength - 1);
2368 printf("\tPM_TMR_BLK=0x%x-0x%x\n",
2369 fadt->PmTimerBlock,
2370 fadt->PmTimerBlock + fadt->PmTimerLength - 1);
2371 if (fadt->Gpe0Block != 0)
2372 printf("\tGPE0_BLK=0x%x-0x%x\n",
2373 fadt->Gpe0Block,
2374 fadt->Gpe0Block + fadt->Gpe0BlockLength - 1);
2375 if (fadt->Gpe1Block != 0)
2376 printf("\tGPE1_BLK=0x%x-0x%x, GPE1_BASE=%d\n",
2377 fadt->Gpe1Block,
2378 fadt->Gpe1Block + fadt->Gpe1BlockLength - 1,
2379 fadt->Gpe1Base);
2380 if (fadt->CstControl != 0)
2381 printf("\tCST_CNT=0x%x\n", fadt->CstControl);
2383 fadt->C2Latency, fadt->C3Latency);
2385 fadt->FlushSize, fadt->FlushStride);
2387 fadt->DutyOffset, fadt->DutyWidth);
2389 fadt->DayAlarm, fadt->MonthAlarm, fadt->Century);
2394 PRINTFLAG(fadt->BootFlags, LEGACY_DEVICES);
2395 PRINTFLAG(fadt->BootFlags, 8042);
2396 PRINTFLAG(fadt->BootFlags, NO_VGA);
2397 PRINTFLAG(fadt->BootFlags, NO_MSI);
2398 PRINTFLAG(fadt->BootFlags, NO_ASPM);
2399 PRINTFLAG(fadt->BootFlags, NO_CMOS_RTC);
2403 PRINTFLAG(fadt->Flags, WBINVD);
2404 PRINTFLAG(fadt->Flags, WBINVD_FLUSH);
2405 PRINTFLAG(fadt->Flags, C1_SUPPORTED);
2406 PRINTFLAG(fadt->Flags, C2_MP_SUPPORTED);
2407 PRINTFLAG(fadt->Flags, POWER_BUTTON);
2408 PRINTFLAG(fadt->Flags, SLEEP_BUTTON);
2409 PRINTFLAG(fadt->Flags, FIXED_RTC);
2410 PRINTFLAG(fadt->Flags, S4_RTC_WAKE);
2411 PRINTFLAG(fadt->Flags, 32BIT_TIMER);
2412 PRINTFLAG(fadt->Flags, DOCKING_SUPPORTED);
2413 PRINTFLAG(fadt->Flags, RESET_REGISTER);
2414 PRINTFLAG(fadt->Flags, SEALED_CASE);
2415 PRINTFLAG(fadt->Flags, HEADLESS);
2416 PRINTFLAG(fadt->Flags, SLEEP_TYPE);
2417 PRINTFLAG(fadt->Flags, PCI_EXPRESS_WAKE);
2418 PRINTFLAG(fadt->Flags, PLATFORM_CLOCK);
2419 PRINTFLAG(fadt->Flags, S4_RTC_VALID);
2420 PRINTFLAG(fadt->Flags, REMOTE_POWER_ON);
2421 PRINTFLAG(fadt->Flags, APIC_CLUSTER);
2422 PRINTFLAG(fadt->Flags, APIC_PHYSICAL);
2423 PRINTFLAG(fadt->Flags, HW_REDUCED);
2424 PRINTFLAG(fadt->Flags, LOW_POWER_S0);
2429 if (fadt->Flags & ACPI_FADT_RESET_REGISTER) {
2431 acpi_print_gas(&fadt->ResetRegister);
2432 printf(", RESET_VALUE=%#x\n", fadt->ResetValue);
2435 printf("\tX_FACS=0x%016jx, ", (uintmax_t)fadt->XFacs);
2436 printf("X_DSDT=0x%016jx\n", (uintmax_t)fadt->XDsdt);
2438 acpi_print_gas(&fadt->XPm1aEventBlock);
2439 if (fadt->XPm1bEventBlock.Address != 0) {
2441 acpi_print_gas(&fadt->XPm1bEventBlock);
2444 acpi_print_gas(&fadt->XPm1aControlBlock);
2445 if (fadt->XPm1bControlBlock.Address != 0) {
2447 acpi_print_gas(&fadt->XPm1bControlBlock);
2449 if (fadt->XPm2ControlBlock.Address != 0) {
2451 acpi_print_gas(&fadt->XPm2ControlBlock);
2454 acpi_print_gas(&fadt->XPmTimerBlock);
2455 if (fadt->XGpe0Block.Address != 0) {
2457 acpi_print_gas(&fadt->XGpe0Block);
2459 if (fadt->XGpe1Block.Address != 0) {
2461 acpi_print_gas(&fadt->XGpe1Block);
2473 printf(" FACS:\tLength=%u, ", facs->Length);
2474 printf("HwSig=0x%08x, ", facs->HardwareSignature);
2475 printf("Firm_Wake_Vec=0x%08x\n", facs->FirmwareWakingVector);
2478 if (facs->GlobalLock != 0) {
2479 if (facs->GlobalLock & ACPI_GLOCK_PENDING)
2481 if (facs->GlobalLock & ACPI_GLOCK_OWNED)
2487 if (facs->Flags & ACPI_FACS_S4_BIOS_PRESENT)
2491 if (facs->XFirmwareWakingVector != 0)
2493 (uintmax_t)facs->XFirmwareWakingVector);
2494 printf("\tVersion=%u\n", facs->Version);
2515 while (length--)
2527 sp = acpi_map_physical(pa, sp->Length);
2536 acpi_print_string(rp->OemId, ACPI_OEM_ID_SIZE);
2537 printf(", ACPI_Rev=%s (%d)\n", rp->Revision < 2 ? "1.0x" : "2.0x",
2538 rp->Revision);
2539 if (rp->Revision < 2) {
2540 printf("\tRSDT=0x%08x, cksum=%u\n", rp->RsdtPhysicalAddress,
2541 rp->Checksum);
2544 (uintmax_t)rp->XsdtPhysicalAddress, rp->Length,
2545 rp->ExtendedChecksum);
2579 if (memcmp(sdp->Signature, known[i].sig, ACPI_NAMESEG_SIZE)
2606 if (memcmp(tbl, rsdp->Signature, ACPI_NAMESEG_SIZE) == 0) {
2613 entries = (rsdp->Length - sizeof(ACPI_TABLE_HEADER)) / addr_size;
2616 addr = le32toh(rsdt->TableOffsetEntry[i]);
2618 addr = le64toh(xsdt->TableOffsetEntry[i]);
2622 if (acpi_checksum(sdp, sdp->Length)) {
2624 sdp->Signature);
2627 if (tbl != NULL && memcmp(sdp->Signature, tbl, ACPI_NAMESEG_SIZE) != 0)
2645 if (rp->Revision < 2) {
2646 rsdp = (ACPI_TABLE_HEADER *)acpi_map_sdt(rp->RsdtPhysicalAddress);
2647 if (memcmp(rsdp->Signature, "RSDT", ACPI_NAMESEG_SIZE) != 0 ||
2648 acpi_checksum(rsdp, rsdp->Length) != 0)
2652 rsdp = (ACPI_TABLE_HEADER *)acpi_map_sdt(rp->XsdtPhysicalAddress);
2653 if (memcmp(rsdp->Signature, "XSDT", ACPI_NAMESEG_SIZE) != 0 ||
2654 acpi_checksum(rsdp, rsdp->Length) != 0)
2673 sum = acpi_checksum(dsdt + 1, dsdt->Length -
2677 sdt.Length += ssdt->Length - sizeof(ACPI_TABLE_HEADER);
2679 ssdt->Length - sizeof(ACPI_TABLE_HEADER));
2683 sdt.Checksum -= sum;
2688 write(fd, dsdt + 1, dsdt->Length - sizeof(ACPI_TABLE_HEADER));
2694 write(fd, ssdt + 1, ssdt->Length -
2711 if (fd == -1) {
2738 len = sizeof(wrkdir) - strlen(iname);
2739 if ((size_t)snprintf(wrkdir, len, "%s/acpidump.XXXXXX", buf) > len-1 ) {
2748 assert(len <= sizeof(tmpstr) - 1);
2757 /* Run iasl -d on the temp file */
2762 execl("/usr/sbin/iasl", "iasl", "-d", tmpstr, NULL);
2766 wait(&status);
2781 assert(len <= sizeof(tmpstr) - 1);
2834 entries = (rsdp->Length - sizeof(ACPI_TABLE_HEADER)) / addr_size;
2837 addr = le32toh(rsdt->TableOffsetEntry[i]);
2839 addr = le64toh(xsdt->TableOffsetEntry[i]);
2848 if (memcmp(sdt->Signature, sig, strlen(sig)))
2850 if (acpi_checksum(sdt, sdt->Length))
2865 sdt = (ACPI_TABLE_HEADER *)acpi_map_sdt(fadt->Dsdt);
2867 sdt = (ACPI_TABLE_HEADER *)acpi_map_sdt(fadt->XDsdt);
2868 if (acpi_checksum(sdt, sdt->Length))