Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Dec 2002 12:35:46 -0800 (PST)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 22349 for review
Message-ID:  <200212152035.gBFKZkLt058654@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <machine/sal.h>
 #include <machine/pal.h>
 #include <machine/pte.h>
+#include <machine/dig64.h>
 
 #include <efi.h>
 #include <efilib.h>
@@ -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("<EOT>\n");
+	return (CMD_OK);
+}

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?200212152035.gBFKZkLt058654>