From owner-p4-projects Sun Dec 15 12:35:51 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 13EB437B404; Sun, 15 Dec 2002 12:35:48 -0800 (PST) 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 8697C37B401 for ; Sun, 15 Dec 2002 12:35:47 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1BF9643EC2 for ; Sun, 15 Dec 2002 12:35:47 -0800 (PST) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id gBFKZkmV058657 for ; Sun, 15 Dec 2002 12:35:46 -0800 (PST) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id gBFKZkLt058654 for perforce@freebsd.org; Sun, 15 Dec 2002 12:35:46 -0800 (PST) Date: Sun, 15 Dec 2002 12:35:46 -0800 (PST) Message-Id: <200212152035.gBFKZkLt058654@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar Subject: PERFORCE change 22349 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://perforce.freebsd.org/chv.cgi?CH=22349 Change 22349 by marcel@marcel_nfs on 2002/12/15 12:34:58 Add a command to dump the HCDP table. Affected files ... .. //depot/projects/ia64/sys/boot/efi/loader/main.c#14 edit Differences ... ==== //depot/projects/ia64/sys/boot/efi/loader/main.c#14 (text+ko) ==== @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -495,3 +496,77 @@ return print_trs(1); } +COMMAND_SET(hcdp, "hcdp", "Dump HCDP info", command_hcdp); + +static char * +hcdp_string(char *s, u_int len) +{ + static char buffer[256]; + + memcpy(buffer, s, len); + buffer[len] = 0; + return (buffer); +} + +static int +command_hcdp(int argc, char *argv[]) +{ + struct dig64_hcdp_table *tbl; + struct dig64_hcdp_entry *ent; + struct dig64_gas *gas; + int i; + + tbl = efi_get_table(&hcdp); + if (tbl == NULL) { + printf("No HCDP table present\n"); + return (CMD_OK); + } + if (memcmp(tbl->signature, HCDP_SIGNATURE, sizeof(tbl->signature))) { + printf("HCDP table has invalid signature\n"); + return (CMD_OK); + } + if (tbl->length < sizeof(*tbl) - sizeof(*tbl->entry)) { + printf("HCDP table too short\n"); + return (CMD_OK); + } + printf("HCDP table at 0x%016lx\n", (u_long)tbl); + printf("Signature = %s\n", hcdp_string(tbl->signature, 4)); + printf("Length = %u\n", tbl->length); + printf("Revision = %u\n", tbl->revision); + printf("Checksum = %u\n", tbl->checksum); + printf("OEM Id = %s\n", hcdp_string(tbl->oem_id, 6)); + printf("Table Id = %s\n", hcdp_string(tbl->oem_tbl_id, 8)); + printf("OEM rev = %u\n", tbl->oem_rev); + printf("Creator Id = %s\n", hcdp_string(tbl->creator_id, 4)); + printf("Creator rev= %u\n", tbl->creator_rev); + printf("Entries = %u\n", tbl->entries); + for (i = 0; i < tbl->entries; i++) { + ent = tbl->entry + i; + printf("Entry #%d:\n", i + 1); + printf(" Type = %u\n", ent->type); + printf(" Databits = %u\n", ent->databits); + printf(" Parity = %u\n", ent->parity); + printf(" Stopbits = %u\n", ent->stopbits); + printf(" PCI seg = %u\n", ent->pci_segment); + printf(" PCI bus = %u\n", ent->pci_bus); + printf(" PCI dev = %u\n", ent->pci_device); + printf(" PCI func = %u\n", ent->pci_function); + printf(" Interrupt = %u\n", ent->interrupt); + printf(" PCI flag = %u\n", ent->pci_flag); + printf(" Baudrate = %lu\n", + ((u_long)ent->baud_high << 32) + (u_long)ent->baud_low); + gas = &ent->address; + printf(" Addr space= %u\n", gas->addr_space); + printf(" Bit width = %u\n", gas->bit_width); + printf(" Bit offset= %u\n", gas->bit_offset); + printf(" Address = 0x%016lx\n", + ((u_long)gas->addr_high << 32) + (u_long)gas->addr_low); + printf(" PCI type = %u\n", ent->pci_devid); + printf(" PCI vndr = %u\n", ent->pci_vendor); + printf(" IRQ = %u\n", ent->irq); + printf(" PClock = %u\n", ent->pclock); + printf(" PCI iface = %u\n", ent->pci_interface); + } + printf("\n"); + return (CMD_OK); +} To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message