From owner-p4-projects Sat Jul 20 20:24:39 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 524D137B401; Sat, 20 Jul 2002 20:24:29 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0B88837B400 for ; Sat, 20 Jul 2002 20:24:29 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id A39E743E3B for ; Sat, 20 Jul 2002 20:24:28 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from freefall.freebsd.org (perforce@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.4/8.12.4) with ESMTP id g6L3OSJU068372 for ; Sat, 20 Jul 2002 20:24:28 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g6L3OSMW068369 for perforce@freebsd.org; Sat, 20 Jul 2002 20:24:28 -0700 (PDT) Date: Sat, 20 Jul 2002 20:24:28 -0700 (PDT) Message-Id: <200207210324.g6L3OSMW068369@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm Subject: PERFORCE change 14568 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://people.freebsd.org/~peter/p4db/chv.cgi?CH=14568 Change 14568 by peter@peter_ia64 on 2002/07/20 20:24:16 drop in a hack that I was using to give an explicit address to the dump routines. The itanium2 system does not provide the usual pointers in a place where this can find. Affected files ... .. //depot/projects/ia64/usr.sbin/acpi/acpidump/acpi_user.c#2 edit .. //depot/projects/ia64/usr.sbin/acpi/acpidump/acpidump.c#3 edit Differences ... ==== //depot/projects/ia64/usr.sbin/acpi/acpidump/acpi_user.c#2 (text+ko) ==== @@ -52,8 +52,8 @@ LIST_HEAD(acpi_user_mapping_list, acpi_user_mapping) maplist; -static void -acpi_user_init() +void +acpi_user_init(void) { if (acpi_mem_fd == -1) { ==== //depot/projects/ia64/usr.sbin/acpi/acpidump/acpidump.c#3 (text+ko) ==== @@ -36,6 +36,8 @@ #include "acpidump.h" +u_int64_t xaddr; + static void asl_dump_from_file(char *file) { @@ -47,21 +49,62 @@ acpi_dump_dsdt(dp, end); } +void +hd(void *buf, int len) +{ + unsigned char *p; + int n, i; + + p = buf; + for (n = 0; n < len; n += 16) { + for (i = n; i < n + 16; i++) { + if ((i % 16) == 0) { /* beginning of line */ + printf("0x%04x ", i); + } + if ((i % 2) == 0) { + printf(" "); + } + if (i < len) + printf("%02x", p[i]); + else + printf(" "); + } + printf(" "); /* Why does \t come out as '?' ? */ + for (i = n; i < n + 16; i++) { + if (i >= len) + break; + if (p[i] >= ' ' && p[i] <= '~') + printf("%c", p[i]); + else + printf("."); + } + printf("\n"); + } +} + static void asl_dump_from_devmem() { struct ACPIrsdp *rp; struct ACPIsdt *rsdp; +if (xaddr == 0) { rp = acpi_find_rsd_ptr(); if (!rp) errx(1, "Can't find ACPI information\n"); acpi_print_rsd_ptr(rp); rsdp = (struct ACPIsdt *) acpi_map_sdt(rp->addr); - if (memcmp(rsdp->signature, "RSDT", 4) || - acpi_checksum(rsdp, rsdp->len)) - errx(1, "RSDT is corrupted\n"); +} else { + acpi_user_init(); + rsdp = (struct ACPIsdt *) acpi_map_sdt(xaddr); +} + if (memcmp(rsdp->signature, "RSDT", 4)) { +hd(rsdp, 256); + errx(1, "RSDT is not a RSDT\n"); + } + if (acpi_checksum(rsdp, rsdp->len)) + errx(1, "RSDT checksum corrupted\n"); acpi_handle_rsdt(rsdp); } @@ -82,7 +125,7 @@ char c, *progname; progname = argv[0]; - while ((c = getopt(argc, argv, "f:o:hr")) != -1) { + while ((c = getopt(argc, argv, "f:o:hrx:")) != -1) { switch (c) { case 'f': asl_dump_from_file(optarg); @@ -96,6 +139,10 @@ case 'r': rflag++; break; + case 'x': + xaddr = strtol(optarg, 0, 0); + printf("xaddr = %p\n", xaddr); + break; default: argc -= optind; argv += optind; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message