Lines Matching +full:tsc +full:- +full:irq

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