Date: Wed, 4 Dec 2002 00:01:58 -0800 (PST) From: Marcel Moolenaar <marcel@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 21899 for review Message-ID: <200212040801.gB481wWa018458@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=21899 Change 21899 by marcel@marcel_nfs on 2002/12/04 00:01:04 Step 2 of getting acpidump to work on the HP box. The FACP follows ACPI 2.0 as well. this means some previously unused fields now have meaning and fields that previously had meaning don't. Most importantly, the address of the DSDT is to be found in x_dsdt (ie the 64-bit variant). Et viola; a world of ACPI gibberish reveals itself :-) Note that we still need to explicitly tell acpidump where it can find the RSDT. The logic to scan the first 1MB of memory is fatal on the box. It looks to me that we really should be using sysctl to expose the address to userland... An option is probably in order to allow the old behaviour, so that you don't need ACPI support in the kernel in order to dump it. Affected files ... .. //depot/projects/ia64/usr.sbin/acpi/acpidump/acpi.c#4 edit .. //depot/projects/ia64/usr.sbin/acpi/acpidump/acpidump.h#6 edit Differences ... ==== //depot/projects/ia64/usr.sbin/acpi/acpidump/acpi.c#4 (text+ko) ==== @@ -110,12 +110,15 @@ } static void -acpi_handle_facp(struct FACPbody *facp) +acpi_handle_facp(struct FACPbody *facp, int v2) { struct ACPIsdt *dsdp; - acpi_print_facp(facp); - dsdp = (struct ACPIsdt *) acpi_map_sdt(facp->dsdt_ptr); + acpi_print_facp(facp, v2); + if (v2) + dsdp = acpi_map_sdt(facp->x_dsdt); + else + dsdp = acpi_map_sdt(facp->dsdt_ptr); if (acpi_checksum(dsdp, dsdp->len)) errx(1, "DSDT is corrupt\n"); acpi_handle_dsdt(dsdp); @@ -169,6 +172,7 @@ printf("\n}\n"); assert(dp == end); } + void acpi_print_sdt(struct ACPIsdt *sdp) { @@ -192,18 +196,25 @@ } void -acpi_print_facp(struct FACPbody *facp) +acpi_print_facp(struct FACPbody *facp, int v2) { char sep; printf(BEGIN_COMMENT); - printf("\tDSDT=0x%x\n", facp->dsdt_ptr); - printf("\tINT_MODEL=%s\n", facp->int_model ? "APIC" : "PIC"); + if (v2) { + printf("\tDSDT=0x%x\n", facp->x_dsdt); + printf("\tPM_Profile=%d\n", facp->pm_profile); + } else { + printf("\tDSDT=0x%x\n", facp->dsdt_ptr); + printf("\tINT_MODEL=%s\n", facp->int_model ? "APIC" : "PIC"); + } printf("\tSCI_INT=%d\n", facp->sci_int); printf("\tSMI_CMD=0x%x, ", facp->smi_cmd); printf("ACPI_ENABLE=0x%x, ", facp->acpi_enable); printf("ACPI_DISABLE=0x%x, ", facp->acpi_disable); printf("S4BIOS_REQ=0x%x\n", facp->s4biosreq); + if (v2) + printf("\tpstate_cnt=%d\n", facp->pstate_cnt); if (facp->pm1a_evt_blk) printf("\tPM1a_EVT_BLK=0x%x-0x%x\n", facp->pm1a_evt_blk, @@ -237,6 +248,8 @@ facp->gpe1_blk, facp->gpe1_blk + facp->gpe1_len - 1, facp->gpe1_base); + if (v2) + printf("\tCST_CNT=%d\n", facp->cst_cnt); printf("\tP_LVL2_LAT=%dms, P_LVL3_LAT=%dms\n", facp->p_lvl2_lat, facp->p_lvl3_lat); printf("\tFLUSH_SIZE=%d, FLUSH_STRIDE=%d\n", @@ -352,10 +365,8 @@ if (acpi_checksum(sdp_child, sdp_child->len)) errx(1, "SDT at %p is corrupt\n", sdp_child); if (!memcmp(sdp_child->signature, "FACP", 4)) { - printf("FACP!!!\n"); -#if 0 - acpi_handle_facp((struct FACPbody *)sdp_child->body); -#endif + acpi_handle_facp((struct FACPbody *)sdp_child->body, + (sdp->signature[0] == 'X') ? 1 : 0); } else acpi_print_sdt(sdp_child); } ==== //depot/projects/ia64/usr.sbin/acpi/acpidump/acpidump.h#6 (text+ko) ==== @@ -81,13 +81,13 @@ u_int8_t int_model; #define ACPI_FACP_INTMODEL_PIC 0 /* Standard PC-AT PIC */ #define ACPI_FACP_INTMODEL_APIC 1 /* Multiple APIC */ - u_char reserved1; + u_char pm_profile; u_int16_t sci_int; u_int32_t smi_cmd; u_int8_t acpi_enable; u_int8_t acpi_disable; u_int8_t s4biosreq; - u_int8_t reserved2; + u_int8_t pstate_cnt; u_int32_t pm1a_evt_blk; u_int32_t pm1b_evt_blk; u_int32_t pm1a_cnt_blk; @@ -103,7 +103,7 @@ u_int8_t gpe0_len; u_int8_t gpe1_len; u_int8_t gpe1_base; - u_int8_t reserved3; + u_int8_t cst_cnt; u_int16_t p_lvl2_lat; u_int16_t p_lvl3_lat; u_int16_t flush_size; @@ -167,7 +167,7 @@ void acpi_print_rsd_ptr(struct ACPIrsdp *); void acpi_print_sdt(struct ACPIsdt *); void acpi_print_rsdt(struct ACPIsdt *); -void acpi_print_facp(struct FACPbody *); +void acpi_print_facp(struct FACPbody *, int v2); void acpi_print_dsdt(struct ACPIsdt *); void asl_dump_termobj(u_int8_t **, int); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200212040801.gB481wWa018458>