Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 May 2002 14:11:33 -0700 (PDT)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 11173 for review
Message-ID:  <200205112111.g4BLBXo44717@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=11173

Change 11173 by marcel@marcel_nfs on 2002/05/11 14:10:33

	Now that I got a clean machine check for a corrected memory error,
	add the record for future reference and add the code to dump it.
	I choose to create a subdirectory "records" to avoid polluting the
	source directory itself. The mca.log file will be moved or split
	or both.

Affected files ...

... //depot/projects/ia64/sbin/mca/mca.c#3 edit
... //depot/projects/ia64/sbin/mca/records/corrected_memory_error#1 add
... //depot/projects/ia64/sys/ia64/include/mca.h#4 edit

Differences ...

==== //depot/projects/ia64/sbin/mca/mca.c#3 (text+ko) ====

@@ -37,7 +37,7 @@
 #ifdef __ia64__
 #include <machine/mca.h>
 #else
-#include "/sys/ia64/include/mca.h"
+#include "../../sys/ia64/include/mca.h"
 #endif
 
 #include <err.h>
@@ -119,15 +119,20 @@
 {
 	printf("      <%s-%d>\n", what, idx);
 	if (cpu_mod->cpu_mod_flags & MCA_CPU_MOD_FLAGS_INFO)
-		printf("        info=%016llx\n", cpu_mod->cpu_mod_info);
+		printf("        info=%016llx\n",
+		    (long long)cpu_mod->cpu_mod_info);
 	if (cpu_mod->cpu_mod_flags & MCA_CPU_MOD_FLAGS_REQID)
-		printf("        requester=%016llx\n", cpu_mod->cpu_mod_reqid);
+		printf("        requester=%016llx\n",
+		    (long long)cpu_mod->cpu_mod_reqid);
 	if (cpu_mod->cpu_mod_flags & MCA_CPU_MOD_FLAGS_RSPID)
-		printf("        responder=%016llx\n", cpu_mod->cpu_mod_rspid);
+		printf("        responder=%016llx\n",
+		    (long long)cpu_mod->cpu_mod_rspid);
 	if (cpu_mod->cpu_mod_flags & MCA_CPU_MOD_FLAGS_TGTID)
-		printf("        target=%016llx\n", cpu_mod->cpu_mod_tgtid);
+		printf("        target=%016llx\n",
+		    (long long)cpu_mod->cpu_mod_tgtid);
 	if (cpu_mod->cpu_mod_flags & MCA_CPU_MOD_FLAGS_IP)
-		printf("        ip=%016llx\n", cpu_mod->cpu_mod_ip);
+		printf("        ip=%016llx\n",
+		    (long long)cpu_mod->cpu_mod_ip);
 	printf("      </%s-%d>\n", what, idx);
 }
 
@@ -167,7 +172,8 @@
 
 	cpuid = (struct mca_cpu_cpuid*)mod;
 	for (i = 0; i < 6; i++)
-		printf("      cpuid%d=%016llx\n", i, cpuid->cpuid[i]);
+		printf("      cpuid%d=%016llx\n", i,
+		    (long long)cpuid->cpuid[i]);
 
 	psi = (struct mca_cpu_psi*)(cpuid + 1);
 	/* TODO: Dump PSI */
@@ -176,9 +182,48 @@
 }
 
 static void
-show_memory(void)
+show_memory(struct mca_mem_record *mem)
 {
-	printf("    # MEMORY\n");
+	printf("    <memory>\n");
+
+	if (mem->mem_flags & MCA_MEM_FLAGS_STATUS)
+		printf("      status=%016llx\n", (long long)mem->mem_status);
+	if (mem->mem_flags & MCA_MEM_FLAGS_ADDR)
+		printf("      address=%016llx\n", (long long)mem->mem_addr);
+	if (mem->mem_flags & MCA_MEM_FLAGS_ADDRMASK)
+		printf("      mask=%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)
+		printf("      card=0x%04x\n", mem->mem_card);
+	if (mem->mem_flags & MCA_MEM_FLAGS_MODULE)
+		printf("      module=0x%04x\n", mem->mem_module);
+	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);
+	if (mem->mem_flags & MCA_MEM_FLAGS_ROW)
+		printf("      row=0x%04x\n", mem->mem_row);
+	if (mem->mem_flags & MCA_MEM_FLAGS_COLUMN)
+		printf("      column=0x%04x\n", mem->mem_column);
+	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",
+		    (long long)mem->mem_reqid);
+	if (mem->mem_flags & MCA_MEM_FLAGS_RSPID)
+		printf("        responder=%016llx\n",
+		    (long long)mem->mem_rspid);
+	if (mem->mem_flags & MCA_MEM_FLAGS_TGTID)
+		printf("        target=%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));
+	/* TODO: Dump OEM data */
+
+	printf("    </memory>\n");
 }
 
 static void
@@ -229,7 +274,7 @@
 	if (!memcmp(&sh->sh_guid, &guid_cpu, sizeof(guid_cpu)))
 		show_cpu((struct mca_cpu_record*)(sh + 1));
 	else if (!memcmp(&sh->sh_guid, &guid_memory, sizeof(guid_memory)))
-		show_memory();
+		show_memory((struct mca_mem_record*)(sh + 1));
 	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)))

==== //depot/projects/ia64/sys/ia64/include/mca.h#4 (text+ko) ====

@@ -129,6 +129,45 @@
 	uint64_t	cpu_psi_fr[256];	/* 16 bytes per register! */
 };
 
+struct mca_mem_record {
+	uint64_t	mem_flags;
+#define	MCA_MEM_FLAGS_STATUS		(1ULL << 0)
+#define	MCA_MEM_FLAGS_ADDR		(1ULL << 1)
+#define	MCA_MEM_FLAGS_ADDRMASK		(1ULL << 2)
+#define	MCA_MEM_FLAGS_NODE		(1ULL << 3)
+#define	MCA_MEM_FLAGS_CARD		(1ULL << 4)
+#define	MCA_MEM_FLAGS_MODULE		(1ULL << 5)
+#define	MCA_MEM_FLAGS_BANK		(1ULL << 6)
+#define	MCA_MEM_FLAGS_DEVICE		(1ULL << 7)
+#define	MCA_MEM_FLAGS_ROW		(1ULL << 8)
+#define	MCA_MEM_FLAGS_COLUMN		(1ULL << 9)
+#define	MCA_MEM_FLAGS_BITPOS		(1ULL << 10)
+#define	MCA_MEM_FLAGS_REQID		(1ULL << 11)
+#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_DATA		(1ULL << 16)
+	uint64_t	mem_status;
+	uint64_t	mem_addr;
+	uint64_t	mem_addrmask;
+	uint16_t	mem_node;
+	uint16_t	mem_card;
+	uint16_t	mem_module;
+	uint16_t	mem_bank;
+	uint16_t	mem_device;
+	uint16_t	mem_row;
+	uint16_t	mem_column;
+	uint16_t	mem_bitpos;
+	uint64_t	mem_reqid;
+	uint64_t	mem_rspid;
+	uint64_t	mem_tgtid;
+	uint64_t	mem_busdata;
+	struct mca_guid	mem_platform;		/* XXX not really a GUID. */
+	uint16_t	mem_oem_length;		/* Size of OEM data. */
+	/* N bytes of OEM platform data */
+};
+
 #define	MCA_GUID_CPU		\
 	{0xe429faf1,0x3cb7,0x11d4,{0xbc,0xa7,0x00,0x80,0xc7,0x3c,0x88,0x81}}
 #define	MCA_GUID_MEMORY		\

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?200205112111.g4BLBXo44717>