Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 May 2002 21:43:44 -0700 (PDT)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 11997 for review
Message-ID:  <200205280443.g4S4hil07721@freefall.freebsd.org>

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

Change 11997 by marcel@marcel_nfs on 2002/05/27 21:43:09

	Remove MCA specific GUID structures and definitions and switch
	to using <sys/uuid.h>. Replace GUID with UUID to be consistent.
	In sbin/mca/mca.c, print the UUID in its string representation,
	not its C declaration.

Affected files ...

... //depot/projects/ia64/sbin/mca/mca.c#5 edit
... //depot/projects/ia64/sys/ia64/ia64/machdep.c#39 edit
... //depot/projects/ia64/sys/ia64/ia64/mca.c#3 edit
... //depot/projects/ia64/sys/ia64/ia64/mp_machdep.c#16 edit
... //depot/projects/ia64/sys/ia64/include/mca.h#8 edit
... //depot/projects/ia64/sys/sys/uuid.h#3 edit

Differences ...

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

@@ -30,6 +30,7 @@
 #include <sys/types.h>
 #include <sys/mman.h>
 #include <sys/sysctl.h>
+#include <sys/uuid.h>
 
 /*
  * Hack to make this compile on non-ia64 machines.
@@ -77,16 +78,14 @@
 }
 
 static const char *
-guid(struct mca_guid *g)
+uuid(struct uuid *id)
 {
 	static char buffer[64];
-	char sub[32];
 
-	sprintf(sub, "{%02x,%02x,%02x,%02x,%02x,%02x,%02x,%02x}",
-	    g->data4[0], g->data4[1], g->data4[2], g->data4[3],
-	    g->data4[4], g->data4[5], g->data4[6], g->data4[7]);
-	sprintf(buffer, "{%08lx,%04x,%04x,%s}", (long)g->data1,
-	    g->data2, g->data3, sub);
+	sprintf(buffer, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
+	    id->time_low, id->time_mid, id->time_hi_and_version,
+	    id->clock_seq_hi_and_reserved, id->clock_seq_low, id->node[0],
+	    id->node[1], id->node[2], id->node[3], id->node[4], id->node[5]);
 	return (buffer);
 }
 
@@ -109,7 +108,7 @@
 	    BCD(rh->rh_time[MCA_RH_TIME_MIN]),
 	    BCD(rh->rh_time[MCA_RH_TIME_SEC]));
 	if (rh->rh_flags & MCA_RH_FLAGS_PLATFORM_ID)
-		printf("    platform=%s\n", guid(&rh->rh_platform));
+		printf("    platform=%s\n", uuid(&rh->rh_platform));
 	printf("  </header>\n");
 	return (rh->rh_length);
 }
@@ -221,7 +220,7 @@
 		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));
+		printf("      oem=%s\n", uuid(&mem->mem_oem_id));
 	/* TODO: Dump OEM data */
 
 	printf("    </memory>\n");
@@ -264,7 +263,7 @@
 		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));
+		printf("      oem=%s\n", uuid(&pcibus->pcibus_oem_id));
 	/* TODO: Dump OEM data */
 
 	printf("    </pci-bus>\n");
@@ -315,31 +314,31 @@
 static size_t
 show_section(struct mca_section_header *sh)
 {
-	static struct mca_guid guid_cpu = MCA_GUID_CPU;
-	static struct mca_guid guid_memory = MCA_GUID_MEMORY;
-	static struct mca_guid guid_sel = MCA_GUID_SEL;
-	static struct mca_guid guid_pci_bus = MCA_GUID_PCI_BUS;
-	static struct mca_guid guid_smbios = MCA_GUID_SMBIOS;
-	static struct mca_guid guid_pci_dev = MCA_GUID_PCI_DEV;
-	static struct mca_guid guid_generic = MCA_GUID_GENERIC;
+	static struct uuid uuid_cpu = MCA_UUID_CPU;
+	static struct uuid uuid_memory = MCA_UUID_MEMORY;
+	static struct uuid uuid_sel = MCA_UUID_SEL;
+	static struct uuid uuid_pci_bus = MCA_UUID_PCI_BUS;
+	static struct uuid uuid_smbios = MCA_UUID_SMBIOS;
+	static struct uuid uuid_pci_dev = MCA_UUID_PCI_DEV;
+	static struct uuid uuid_generic = MCA_UUID_GENERIC;
 
 	printf("  <section>\n");
-	printf("    guid=%s\n", guid(&sh->sh_guid));
+	printf("    uuid=%s\n", uuid(&sh->sh_uuid));
 	printf("    revision=%d.%d\n", BCD(sh->sh_major), BCD(sh->sh_minor));
 
-	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((struct mca_mem_record*)(sh + 1));
-	else if (!memcmp(&sh->sh_guid, &guid_sel, sizeof(guid_sel)))
+	if (!memcmp(&sh->sh_uuid, &uuid_cpu, sizeof(uuid_cpu)))
+		show_cpu((void*)(sh + 1));
+	else if (!memcmp(&sh->sh_uuid, &uuid_memory, sizeof(uuid_memory)))
+		show_memory((void*)(sh + 1));
+	else if (!memcmp(&sh->sh_uuid, &uuid_sel, sizeof(uuid_sel)))
 		show_sel();
-	else if (!memcmp(&sh->sh_guid, &guid_pci_bus, sizeof(guid_pci_bus)))
-		show_pci_bus((struct mca_pcibus_record*)(sh + 1));
-	else if (!memcmp(&sh->sh_guid, &guid_smbios, sizeof(guid_smbios)))
+	else if (!memcmp(&sh->sh_uuid, &uuid_pci_bus, sizeof(uuid_pci_bus)))
+		show_pci_bus((void*)(sh + 1));
+	else if (!memcmp(&sh->sh_uuid, &uuid_smbios, sizeof(uuid_smbios)))
 		show_smbios();
-	else if (!memcmp(&sh->sh_guid, &guid_pci_dev, sizeof(guid_pci_dev)))
-		show_pci_dev((struct mca_pcidev_record*)(sh + 1));
-	else if (!memcmp(&sh->sh_guid, &guid_generic, sizeof(guid_generic)))
+	else if (!memcmp(&sh->sh_uuid, &uuid_pci_dev, sizeof(uuid_pci_dev)))
+		show_pci_dev((void*)(sh + 1));
+	else if (!memcmp(&sh->sh_uuid, &uuid_generic, sizeof(uuid_generic)))
 		show_generic();
 
 	printf("  </section>\n");

==== //depot/projects/ia64/sys/ia64/ia64/machdep.c#39 (text+ko) ====

@@ -58,6 +58,7 @@
 #include <sys/linker.h>
 #include <sys/random.h>
 #include <sys/cons.h>
+#include <sys/uuid.h>
 #include <net/netisr.h>
 #include <vm/vm.h>
 #include <vm/vm_kern.h>

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

@@ -33,6 +33,7 @@
 #include <sys/malloc.h>
 #include <sys/mutex.h>
 #include <sys/sysctl.h>
+#include <sys/uuid.h>
 #include <vm/vm.h>
 #include <vm/vm_kern.h>
 #include <machine/mca.h>

==== //depot/projects/ia64/sys/ia64/ia64/mp_machdep.c#16 (text+ko) ====

@@ -37,6 +37,7 @@
 #include <sys/pcpu.h>
 #include <sys/smp.h>
 #include <sys/sysctl.h>
+#include <sys/uuid.h>
 
 #include <vm/vm.h>
 #include <vm/pmap.h>

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

@@ -29,13 +29,6 @@
 #ifndef _MACHINE_MCA_H_
 #define _MACHINE_MCA_H_
 
-struct mca_guid {
-	uint32_t	data1;
-	uint16_t	data2;
-	uint16_t	data3;
-	uint8_t		data4[8];
-};
-
 struct mca_record_header {
 	uint64_t	rh_seqnr;		/* Record id. */
 	uint8_t		rh_major;		/* BCD (=02). */
@@ -55,11 +48,11 @@
 #define	MCA_RH_TIME_MON		5
 #define	MCA_RH_TIME_YEAR	6
 #define	MCA_RH_TIME_CENT	7
-	struct mca_guid	rh_platform;		/* XXX not really a GUID. */
+	struct uuid	rh_platform;
 };
 
 struct mca_section_header {
-	struct mca_guid	sh_guid;
+	struct uuid	sh_uuid;
 	uint8_t		sh_major;		/* BCD (=02). */
 	uint8_t		sh_minor;		/* BCD (=00). */
 	uint8_t		sh_flags;
@@ -163,7 +156,7 @@
 	uint64_t	mem_rspid;
 	uint64_t	mem_tgtid;
 	uint64_t	mem_busdata;
-	struct mca_guid	mem_oem_id;		/* XXX not really a GUID. */
+	struct uuid	mem_oem_id;
 	uint16_t	mem_oem_length;		/* Size of OEM data. */
 	/* N bytes of OEM platform data. */
 };
@@ -191,7 +184,7 @@
 	uint64_t	pcibus_reqid;
 	uint64_t	pcibus_rspid;
 	uint64_t	pcibus_tgtid;
-	struct mca_guid	pcibus_oem_id;		/* XXX not really a GUID. */
+	struct uuid	pcibus_oem_id;
 	uint16_t	pcibus_oem_length;	/* Size of OEM data. */
 	/* N bytes of OEM platform data. */
 };
@@ -228,20 +221,20 @@
 	uint64_t	pcidev_reg_data;
 };
 
-#define	MCA_GUID_CPU		\
-	{0xe429faf1,0x3cb7,0x11d4,{0xbc,0xa7,0x00,0x80,0xc7,0x3c,0x88,0x81}}
-#define	MCA_GUID_MEMORY		\
-	{0xe429faf2,0x3cb7,0x11d4,{0xbc,0xa7,0x00,0x80,0xc7,0x3c,0x88,0x81}}
-#define	MCA_GUID_SEL		\
-	{0xe429faf3,0x3cb7,0x11d4,{0xbc,0xa7,0x00,0x80,0xc7,0x3c,0x88,0x81}}
-#define	MCA_GUID_PCI_BUS	\
-	{0xe429faf4,0x3cb7,0x11d4,{0xbc,0xa7,0x00,0x80,0xc7,0x3c,0x88,0x81}}
-#define	MCA_GUID_SMBIOS		\
-	{0xe429faf5,0x3cb7,0x11d4,{0xbc,0xa7,0x00,0x80,0xc7,0x3c,0x88,0x81}}
-#define	MCA_GUID_PCI_DEV	\
-	{0xe429faf6,0x3cb7,0x11d4,{0xbc,0xa7,0x00,0x80,0xc7,0x3c,0x88,0x81}}
-#define	MCA_GUID_GENERIC	\
-	{0xe429faf7,0x3cb7,0x11d4,{0xbc,0xa7,0x00,0x80,0xc7,0x3c,0x88,0x81}}
+#define	MCA_UUID_CPU		\
+	{0xe429faf1,0x3cb7,0x11d4,0xbc,0xa7,{0x00,0x80,0xc7,0x3c,0x88,0x81}}
+#define	MCA_UUID_MEMORY		\
+	{0xe429faf2,0x3cb7,0x11d4,0xbc,0xa7,{0x00,0x80,0xc7,0x3c,0x88,0x81}}
+#define	MCA_UUID_SEL		\
+	{0xe429faf3,0x3cb7,0x11d4,0xbc,0xa7,{0x00,0x80,0xc7,0x3c,0x88,0x81}}
+#define	MCA_UUID_PCI_BUS	\
+	{0xe429faf4,0x3cb7,0x11d4,0xbc,0xa7,{0x00,0x80,0xc7,0x3c,0x88,0x81}}
+#define	MCA_UUID_SMBIOS		\
+	{0xe429faf5,0x3cb7,0x11d4,0xbc,0xa7,{0x00,0x80,0xc7,0x3c,0x88,0x81}}
+#define	MCA_UUID_PCI_DEV	\
+	{0xe429faf6,0x3cb7,0x11d4,0xbc,0xa7,{0x00,0x80,0xc7,0x3c,0x88,0x81}}
+#define	MCA_UUID_GENERIC	\
+	{0xe429faf7,0x3cb7,0x11d4,0xbc,0xa7,{0x00,0x80,0xc7,0x3c,0x88,0x81}}
 
 #ifdef _KERNEL
 

==== //depot/projects/ia64/sys/sys/uuid.h#3 (text+ko) ====

@@ -52,6 +52,8 @@
 
 #define	UUID_NODE_LEN	_UUID_NODE_LEN
 
+struct sbuf;
+
 int snprintf_uuid(char *, size_t, struct uuid *);
 int printf_uuid(struct uuid *);
 int sbuf_printf_uuid(struct sbuf *, struct uuid *);

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?200205280443.g4S4hil07721>