From owner-p4-projects Tue May 21 19:22:59 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8BD0137B406; Tue, 21 May 2002 19:22:27 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id A19EA37B409 for ; Tue, 21 May 2002 19:22:25 -0700 (PDT) Received: (from perforce@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g4M2MPM09898 for perforce@freebsd.org; Tue, 21 May 2002 19:22:25 -0700 (PDT) (envelope-from marcel@freebsd.org) Date: Tue, 21 May 2002 19:22:25 -0700 (PDT) Message-Id: <200205220222.g4M2MPM09898@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar Subject: PERFORCE change 11693 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=11693 Change 11693 by marcel@marcel_vaio on 2002/05/21 19:22:11 Add PCI bus and PCI device records and dump them. This completes dumping of error records I've seen so far (with the exception of PCI bus records). The mca(8) tool only needs a manpage and possibly the ability to clear a record in the sysctl tree to make it committable. This commit also contains some minor renaming and a typo fix. Affected files ... ... //depot/projects/ia64/sbin/mca/mca.c#4 edit ... //depot/projects/ia64/sys/ia64/include/mca.h#6 edit Differences ... ==== //depot/projects/ia64/sbin/mca/mca.c#4 (text+ko) ==== @@ -119,19 +119,19 @@ { printf(" <%s-%d>\n", what, idx); if (cpu_mod->cpu_mod_flags & MCA_CPU_MOD_FLAGS_INFO) - printf(" info=%016llx\n", + printf(" info=0x%016llx\n", (long long)cpu_mod->cpu_mod_info); if (cpu_mod->cpu_mod_flags & MCA_CPU_MOD_FLAGS_REQID) - printf(" requester=%016llx\n", + printf(" requester=0x%016llx\n", (long long)cpu_mod->cpu_mod_reqid); if (cpu_mod->cpu_mod_flags & MCA_CPU_MOD_FLAGS_RSPID) - printf(" responder=%016llx\n", + printf(" responder=0x%016llx\n", (long long)cpu_mod->cpu_mod_rspid); if (cpu_mod->cpu_mod_flags & MCA_CPU_MOD_FLAGS_TGTID) - printf(" target=%016llx\n", + printf(" target=0x%016llx\n", (long long)cpu_mod->cpu_mod_tgtid); if (cpu_mod->cpu_mod_flags & MCA_CPU_MOD_FLAGS_IP) - printf(" ip=%016llx\n", + printf(" ip=0x%016llx\n", (long long)cpu_mod->cpu_mod_ip); printf(" \n", what, idx); } @@ -147,11 +147,11 @@ printf(" \n"); if (cpu->cpu_flags & MCA_CPU_FLAGS_ERRMAP) - printf(" errmap=%016llx\n", (long long)cpu->cpu_errmap); + printf(" errmap=0x%016llx\n", (long long)cpu->cpu_errmap); if (cpu->cpu_flags & MCA_CPU_FLAGS_STATE) - printf(" state=%016llx\n", (long long)cpu->cpu_state); + printf(" state=0x%016llx\n", (long long)cpu->cpu_state); if (cpu->cpu_flags & MCA_CPU_FLAGS_CR_LID) - printf(" cr_lid=%016llx\n", (long long)cpu->cpu_cr_lid); + printf(" cr_lid=0x%016llx\n", (long long)cpu->cpu_cr_lid); mod = (struct mca_cpu_mod*)(cpu + 1); n = MCA_CPU_FLAGS_CACHE(cpu->cpu_flags); @@ -172,7 +172,7 @@ cpuid = (struct mca_cpu_cpuid*)mod; for (i = 0; i < 6; i++) - printf(" cpuid%d=%016llx\n", i, + printf(" cpuid%d=0x%016llx\n", i, (long long)cpuid->cpuid[i]); psi = (struct mca_cpu_psi*)(cpuid + 1); @@ -187,11 +187,11 @@ printf(" \n"); if (mem->mem_flags & MCA_MEM_FLAGS_STATUS) - printf(" status=%016llx\n", (long long)mem->mem_status); + printf(" status=0x%016llx\n", (long long)mem->mem_status); if (mem->mem_flags & MCA_MEM_FLAGS_ADDR) - printf(" address=%016llx\n", (long long)mem->mem_addr); + printf(" address=0x%016llx\n", (long long)mem->mem_addr); if (mem->mem_flags & MCA_MEM_FLAGS_ADDRMASK) - printf(" mask=%016llx\n", (long long)mem->mem_addrmask); + printf(" mask=0x%016llx\n", (long long)mem->mem_addrmask); if (mem->mem_flags & MCA_MEM_FLAGS_NODE) printf(" node=0x%04x\n", mem->mem_node); if (mem->mem_flags & MCA_MEM_FLAGS_CARD) @@ -201,7 +201,7 @@ if (mem->mem_flags & MCA_MEM_FLAGS_BANK) printf(" bank=0x%04x\n", mem->mem_bank); if (mem->mem_flags & MCA_MEM_FLAGS_DEVICE) - printf(" device=0x04x\n", mem->mem_device); + printf(" device=0x%04x\n", mem->mem_device); if (mem->mem_flags & MCA_MEM_FLAGS_ROW) printf(" row=0x%04x\n", mem->mem_row); if (mem->mem_flags & MCA_MEM_FLAGS_COLUMN) @@ -209,18 +209,19 @@ if (mem->mem_flags & MCA_MEM_FLAGS_BITPOS) printf(" bit=0x%04x\n", mem->mem_bitpos); if (mem->mem_flags & MCA_MEM_FLAGS_REQID) - printf(" requester=%016llx\n", + printf(" requester=0x%016llx\n", (long long)mem->mem_reqid); if (mem->mem_flags & MCA_MEM_FLAGS_RSPID) - printf(" responder=%016llx\n", + printf(" responder=0x%016llx\n", (long long)mem->mem_rspid); if (mem->mem_flags & MCA_MEM_FLAGS_TGTID) - printf(" target=%016llx\n", (long long)mem->mem_tgtid); - + printf(" target=0x%016llx\n", + (long long)mem->mem_tgtid); if (mem->mem_flags & MCA_MEM_FLAGS_BUSDATA) - printf(" status=%016llx\n", (long long)mem->mem_busdata); - if (mem->mem_flags & MCA_MEM_FLAGS_PLATFORM_ID) - printf(" platform=%s\n", guid(&mem->mem_platform)); + printf(" status=0x%016llx\n", + (long long)mem->mem_busdata); + if (mem->mem_flags & MCA_MEM_FLAGS_OEM_ID) + printf(" oem=%s\n", guid(&mem->mem_oem_id)); /* TODO: Dump OEM data */ printf(" \n"); @@ -233,9 +234,40 @@ } static void -show_pci_bus(void) +show_pci_bus(struct mca_pcibus_record *pcibus) { - printf(" # PCI BUS\n"); + printf(" \n"); + + if (pcibus->pcibus_flags & MCA_PCIBUS_FLAGS_STATUS) + printf(" status=0x%016llx\n", + (long long)pcibus->pcibus_status); + if (pcibus->pcibus_flags & MCA_PCIBUS_FLAGS_ERROR) + printf(" error=0x%04x\n", pcibus->pcibus_error); + if (pcibus->pcibus_flags & MCA_PCIBUS_FLAGS_BUS) + printf(" bus=0x%04x\n", pcibus->pcibus_bus); + if (pcibus->pcibus_flags & MCA_PCIBUS_FLAGS_ADDR) + printf(" address=0x%016llx\n", + (long long)pcibus->pcibus_addr); + if (pcibus->pcibus_flags & MCA_PCIBUS_FLAGS_DATA) + printf(" data=0x%016llx\n", + (long long)pcibus->pcibus_data); + if (pcibus->pcibus_flags & MCA_PCIBUS_FLAGS_CMD) + printf(" cmd=0x%016llx\n", + (long long)pcibus->pcibus_cmd); + if (pcibus->pcibus_flags & MCA_PCIBUS_FLAGS_REQID) + printf(" requester=0x%016llx\n", + (long long)pcibus->pcibus_reqid); + if (pcibus->pcibus_flags & MCA_PCIBUS_FLAGS_RSPID) + printf(" responder=0x%016llx\n", + (long long)pcibus->pcibus_rspid); + if (pcibus->pcibus_flags & MCA_PCIBUS_FLAGS_TGTID) + printf(" target=0x%016llx\n", + (long long)pcibus->pcibus_tgtid); + if (pcibus->pcibus_flags & MCA_PCIBUS_FLAGS_OEM_ID) + printf(" oem=%s\n", guid(&pcibus->pcibus_oem_id)); + /* TODO: Dump OEM data */ + + printf(" \n"); } static void @@ -245,9 +277,33 @@ } static void -show_pci_dev(void) +show_pci_dev(struct mca_pcidev_record *pcidev) { - printf(" # PCI DEV\n"); + printf(" \n"); + + if (pcidev->pcidev_flags & MCA_PCIDEV_FLAGS_STATUS) + printf(" status=0x%016llx\n", + (long long)pcidev->pcidev_status); + if (pcidev->pcidev_flags & MCA_PCIDEV_FLAGS_INFO) { + printf(" vendor=0x%04x\n", + pcidev->pcidev_info.info_vendor); + printf(" device=0x%04x\n", + pcidev->pcidev_info.info_device); + printf(" class=0x%06x\n", + MCA_PCIDEV_INFO_CLASS(pcidev->pcidev_info.info_ccfn)); + printf(" function=0x%02x\n", + MCA_PCIDEV_INFO_FUNCTION(pcidev->pcidev_info.info_ccfn)); + printf(" slot=0x%02x\n", + pcidev->pcidev_info.info_slot); + printf(" bus=0x%04x\n", + pcidev->pcidev_info.info_bus); + printf(" segment=0x%04x\n", + pcidev->pcidev_info.info_segment); + } + /* TODO: dump registers */ + /* TODO: Dump OEM data */ + + printf(" \n"); } static void @@ -278,11 +334,11 @@ else if (!memcmp(&sh->sh_guid, &guid_sel, sizeof(guid_sel))) show_sel(); else if (!memcmp(&sh->sh_guid, &guid_pci_bus, sizeof(guid_pci_bus))) - show_pci_bus(); + show_pci_bus((struct mca_pcibus_record*)(sh + 1)); else if (!memcmp(&sh->sh_guid, &guid_smbios, sizeof(guid_smbios))) show_smbios(); else if (!memcmp(&sh->sh_guid, &guid_pci_dev, sizeof(guid_pci_dev))) - show_pci_dev(); + show_pci_dev((struct mca_pcidev_record*)(sh + 1)); else if (!memcmp(&sh->sh_guid, &guid_generic, sizeof(guid_generic))) show_generic(); ==== //depot/projects/ia64/sys/ia64/include/mca.h#6 (text+ko) ==== @@ -86,13 +86,13 @@ uint64_t cpu_errmap; uint64_t cpu_state; uint64_t cpu_cr_lid; - /* Nx cpu_mod (cache) */ - /* Nx cpu_mod (TLB) */ - /* Nx cpu_mod (bus) */ - /* Nx cpu_mod (reg) */ - /* Nx cpu_mod (MS) */ - /* cpu_cpuid */ - /* cpu_psi */ + /* Nx cpu_mod (cache). */ + /* Nx cpu_mod (TLB). */ + /* Nx cpu_mod (bus). */ + /* Nx cpu_mod (reg). */ + /* Nx cpu_mod (MS). */ + /* cpu_cpuid. */ + /* cpu_psi. */ }; struct mca_cpu_cpuid { @@ -146,7 +146,7 @@ #define MCA_MEM_FLAGS_RSPID (1ULL << 12) #define MCA_MEM_FLAGS_TGTID (1ULL << 13) #define MCA_MEM_FLAGS_BUSDATA (1ULL << 14) -#define MCA_MEM_FLAGS_PLATFORM_ID (1ULL << 15) +#define MCA_MEM_FLAGS_OEM_ID (1ULL << 15) #define MCA_MEM_FLAGS_OEM_DATA (1ULL << 16) uint64_t mem_status; uint64_t mem_addr; @@ -163,9 +163,69 @@ uint64_t mem_rspid; uint64_t mem_tgtid; uint64_t mem_busdata; - struct mca_guid mem_platform; /* XXX not really a GUID. */ + struct mca_guid mem_oem_id; /* XXX not really a GUID. */ uint16_t mem_oem_length; /* Size of OEM data. */ - /* N bytes of OEM platform data */ + /* N bytes of OEM platform data. */ +}; + +struct mca_pcibus_record { + uint64_t pcibus_flags; +#define MCA_PCIBUS_FLAGS_STATUS (1ULL << 0) +#define MCA_PCIBUS_FLAGS_ERROR (1ULL << 1) +#define MCA_PCIBUS_FLAGS_BUS (1ULL << 2) +#define MCA_PCIBUS_FLAGS_ADDR (1ULL << 3) +#define MCA_PCIBUS_FLAGS_DATA (1ULL << 4) +#define MCA_PCIBUS_FLAGS_CMD (1ULL << 5) +#define MCA_PCIBUS_FLAGS_REQID (1ULL << 6) +#define MCA_PCIBUS_FLAGS_RSPID (1ULL << 7) +#define MCA_PCIBUS_FLAGS_TGTID (1ULL << 8) +#define MCA_PCIBUS_FLAGS_OEM_ID (1ULL << 9) +#define MCA_PCIBUS_FLAGS_OEM_DATA (1ULL << 10) + uint64_t pcibus_status; + uint16_t pcibus_error; + uint16_t pcibus_bus; + uint32_t __reserved; + uint64_t pcibus_addr; + uint64_t pcibus_data; + uint64_t pcibus_cmd; + uint64_t pcibus_reqid; + uint64_t pcibus_rspid; + uint64_t pcibus_tgtid; + struct mca_guid pcibus_oem_id; /* XXX not really a GUID. */ + uint16_t pcibus_oem_length; /* Size of OEM data. */ + /* N bytes of OEM platform data. */ +}; + +struct mca_pcidev_record { + uint64_t pcidev_flags; +#define MCA_PCIDEV_FLAGS_STATUS (1ULL << 0) +#define MCA_PCIDEV_FLAGS_INFO (1ULL << 1) +#define MCA_PCIDEV_FLAGS_REG_MEM (1ULL << 2) +#define MCA_PCIDEV_FLAGS_REG_IO (1ULL << 3) +#define MCA_PCIDEV_FLAGS_REG_DATA (1ULL << 4) +#define MCA_PCIDEV_FLAGS_OEM_DATA (1ULL << 5) + uint64_t pcidev_status; + struct { + uint16_t info_vendor; + uint16_t info_device; + uint32_t info_ccfn; /* Class code & funct. nr. */ +#define MCA_PCIDEV_INFO_CLASS(x) ((x) & 0xffffff) +#define MCA_PCIDEV_INFO_FUNCTION(x) (((x) >> 24) & 0xff) + uint8_t info_slot; + uint8_t info_bus; + uint8_t info_segment; + uint8_t __res0; + uint32_t __res1; + } pcidev_info; + uint32_t pcidev_reg_mem; + uint32_t pcidev_reg_io; + /* Nx pcidev_reg. */ + /* M bytes of OEM platform data. */ +}; + +struct mca_pcidev_reg { + uint64_t pcidev_reg_addr; + uint64_t pcidev_reg_data; }; #define MCA_GUID_CPU \ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message