svn commit: r303261 - in head/sys: amd64/amd64 amd64/include/pc arm/arm arm64/arm64 i386/include/pc sys

Alexander Motin mav at FreeBSD.org
Sun Jul 24 09:15:13 UTC 2016


Author: mav
Date: Sun Jul 24 09:15:11 2016
New Revision: 303261
URL: https://svnweb.freebsd.org/changeset/base/303261

Log:
  Add more UEFI/e820 memory types from latest specifications.
  
  This is only cosmetics.
  
  MFC after:	2 weeks

Modified:
  head/sys/amd64/amd64/machdep.c
  head/sys/amd64/include/pc/bios.h
  head/sys/arm/arm/machdep.c
  head/sys/arm64/arm64/machdep.c
  head/sys/i386/include/pc/bios.h
  head/sys/sys/efi.h

Modified: head/sys/amd64/amd64/machdep.c
==============================================================================
--- head/sys/amd64/amd64/machdep.c	Sun Jul 24 09:00:16 2016	(r303260)
+++ head/sys/amd64/amd64/machdep.c	Sun Jul 24 09:15:11 2016	(r303261)
@@ -1090,7 +1090,8 @@ add_efi_map_entries(struct efi_map_heade
 		"ACPIMemoryNVS",
 		"MemoryMappedIO",
 		"MemoryMappedIOPortSpace",
-		"PalCode"
+		"PalCode",
+		"PersistentMemory"
 	};
 
 	/*
@@ -1111,7 +1112,7 @@ add_efi_map_entries(struct efi_map_heade
 	for (i = 0, p = map; i < ndesc; i++,
 	    p = efi_next_descriptor(p, efihdr->descriptor_size)) {
 		if (boothowto & RB_VERBOSE) {
-			if (p->md_type <= EFI_MD_TYPE_PALCODE)
+			if (p->md_type < nitems(types))
 				type = types[p->md_type];
 			else
 				type = "<INVALID>";
@@ -1133,6 +1134,12 @@ add_efi_map_entries(struct efi_map_heade
 				printf("RP ");
 			if (p->md_attr & EFI_MD_ATTR_XP)
 				printf("XP ");
+			if (p->md_attr & EFI_MD_ATTR_NV)
+				printf("NV ");
+			if (p->md_attr & EFI_MD_ATTR_MORE_RELIABLE)
+				printf("MORE_RELIABLE ");
+			if (p->md_attr & EFI_MD_ATTR_RO)
+				printf("RO ");
 			if (p->md_attr & EFI_MD_ATTR_RT)
 				printf("RUNTIME");
 			printf("\n");

Modified: head/sys/amd64/include/pc/bios.h
==============================================================================
--- head/sys/amd64/include/pc/bios.h	Sun Jul 24 09:00:16 2016	(r303260)
+++ head/sys/amd64/include/pc/bios.h	Sun Jul 24 09:15:11 2016	(r303261)
@@ -40,6 +40,9 @@
 #define	SMAP_TYPE_ACPI_RECLAIM	3
 #define	SMAP_TYPE_ACPI_NVS	4
 #define	SMAP_TYPE_ACPI_ERROR	5
+#define	SMAP_TYPE_DISABLED	6
+#define	SMAP_TYPE_PMEM		7
+#define	SMAP_TYPE_PRAM		12
 
 #define	SMAP_XATTR_ENABLED	0x00000001
 #define	SMAP_XATTR_NON_VOLATILE	0x00000002

Modified: head/sys/arm/arm/machdep.c
==============================================================================
--- head/sys/arm/arm/machdep.c	Sun Jul 24 09:00:16 2016	(r303260)
+++ head/sys/arm/arm/machdep.c	Sun Jul 24 09:15:11 2016	(r303261)
@@ -1424,7 +1424,8 @@ add_efi_map_entries(struct efi_map_heade
 		"ACPIMemoryNVS",
 		"MemoryMappedIO",
 		"MemoryMappedIOPortSpace",
-		"PalCode"
+		"PalCode",
+		"PersistentMemory"
 	};
 
 	*mrcnt = 0;
@@ -1448,7 +1449,7 @@ add_efi_map_entries(struct efi_map_heade
 	for (i = 0, j = 0, p = map; i < ndesc; i++,
 	    p = efi_next_descriptor(p, efihdr->descriptor_size)) {
 		if (boothowto & RB_VERBOSE) {
-			if (p->md_type <= EFI_MD_TYPE_PALCODE)
+			if (p->md_type < nitems(types))
 				type = types[p->md_type];
 			else
 				type = "<INVALID>";
@@ -1470,6 +1471,12 @@ add_efi_map_entries(struct efi_map_heade
 				printf("RP ");
 			if (p->md_attr & EFI_MD_ATTR_XP)
 				printf("XP ");
+			if (p->md_attr & EFI_MD_ATTR_NV)
+				printf("NV ");
+			if (p->md_attr & EFI_MD_ATTR_MORE_RELIABLE)
+				printf("MORE_RELIABLE ");
+			if (p->md_attr & EFI_MD_ATTR_RO)
+				printf("RO ");
 			if (p->md_attr & EFI_MD_ATTR_RT)
 				printf("RUNTIME");
 			printf("\n");

Modified: head/sys/arm64/arm64/machdep.c
==============================================================================
--- head/sys/arm64/arm64/machdep.c	Sun Jul 24 09:00:16 2016	(r303260)
+++ head/sys/arm64/arm64/machdep.c	Sun Jul 24 09:15:11 2016	(r303261)
@@ -707,7 +707,8 @@ add_efi_map_entries(struct efi_map_heade
 		"ACPIMemoryNVS",
 		"MemoryMappedIO",
 		"MemoryMappedIOPortSpace",
-		"PalCode"
+		"PalCode",
+		"PersistentMemory"
 	};
 
 	/*
@@ -728,7 +729,7 @@ add_efi_map_entries(struct efi_map_heade
 	for (i = 0, p = map; i < ndesc; i++,
 	    p = efi_next_descriptor(p, efihdr->descriptor_size)) {
 		if (boothowto & RB_VERBOSE) {
-			if (p->md_type <= EFI_MD_TYPE_PALCODE)
+			if (p->md_type < nitems(types))
 				type = types[p->md_type];
 			else
 				type = "<INVALID>";
@@ -750,6 +751,12 @@ add_efi_map_entries(struct efi_map_heade
 				printf("RP ");
 			if (p->md_attr & EFI_MD_ATTR_XP)
 				printf("XP ");
+			if (p->md_attr & EFI_MD_ATTR_NV)
+				printf("NV ");
+			if (p->md_attr & EFI_MD_ATTR_MORE_RELIABLE)
+				printf("MORE_RELIABLE ");
+			if (p->md_attr & EFI_MD_ATTR_RO)
+				printf("RO ");
 			if (p->md_attr & EFI_MD_ATTR_RT)
 				printf("RUNTIME");
 			printf("\n");

Modified: head/sys/i386/include/pc/bios.h
==============================================================================
--- head/sys/i386/include/pc/bios.h	Sun Jul 24 09:00:16 2016	(r303260)
+++ head/sys/i386/include/pc/bios.h	Sun Jul 24 09:15:11 2016	(r303261)
@@ -210,6 +210,9 @@ struct PIR_table 
 #define	SMAP_TYPE_ACPI_RECLAIM	3
 #define	SMAP_TYPE_ACPI_NVS	4
 #define	SMAP_TYPE_ACPI_ERROR	5
+#define	SMAP_TYPE_DISABLED	6
+#define	SMAP_TYPE_PMEM		7
+#define	SMAP_TYPE_PRAM		12
 
 #define	SMAP_XATTR_ENABLED	0x00000001
 #define	SMAP_XATTR_NON_VOLATILE	0x00000002

Modified: head/sys/sys/efi.h
==============================================================================
--- head/sys/sys/efi.h	Sun Jul 24 09:00:16 2016	(r303260)
+++ head/sys/sys/efi.h	Sun Jul 24 09:15:11 2016	(r303261)
@@ -69,6 +69,7 @@ struct efi_md {
 #define	EFI_MD_TYPE_IOMEM	11	/* Memory-mapped I/O. */
 #define	EFI_MD_TYPE_IOPORT	12	/* I/O port space. */
 #define	EFI_MD_TYPE_PALCODE	13	/* PAL */
+#define	EFI_MD_TYPE_PERSISTENT	14	/* Persistent memory. */
 	uint32_t	__pad;
 	uint64_t	md_phys;
 	void		*md_virt;
@@ -82,6 +83,10 @@ struct efi_md {
 #define	EFI_MD_ATTR_WP		0x0000000000001000UL
 #define	EFI_MD_ATTR_RP		0x0000000000002000UL
 #define	EFI_MD_ATTR_XP		0x0000000000004000UL
+#define	EFI_MD_ATTR_NV		0x0000000000008000UL
+#define	EFI_MD_ATTR_MORE_RELIABLE \
+				0x0000000000010000UL
+#define	EFI_MD_ATTR_RO		0x0000000000020000UL
 #define	EFI_MD_ATTR_RT		0x8000000000000000UL
 };
 


More information about the svn-src-head mailing list