Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Handle persistent memory. Currently only debug output.
details: https://anonhg.NetBSD.org/src/rev/afef558f4ed5
branches: trunk
changeset: 351471:afef558f4ed5
user: nonaka <nonaka%NetBSD.org@localhost>
date: Tue Feb 14 13:29:09 2017 +0000
description:
Handle persistent memory. Currently only debug output.
diffstat:
sys/arch/i386/stand/efiboot/efimemory.c | 18 +++++++++++++++---
sys/arch/x86/acpi/acpi_machdep.c | 6 ++++--
sys/arch/x86/include/efi.h | 3 ++-
sys/arch/x86/x86/efi.c | 10 +++++++---
sys/arch/x86/x86/x86_machdep.c | 6 ++++--
sys/external/bsd/gnu-efi/dist/inc/efidef.h | 3 ++-
6 files changed, 34 insertions(+), 12 deletions(-)
diffs (190 lines):
diff -r 859c604697e7 -r afef558f4ed5 sys/arch/i386/stand/efiboot/efimemory.c
--- a/sys/arch/i386/stand/efiboot/efimemory.c Tue Feb 14 13:25:22 2017 +0000
+++ b/sys/arch/i386/stand/efiboot/efimemory.c Tue Feb 14 13:29:09 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: efimemory.c,v 1.3 2017/02/11 10:13:46 nonaka Exp $ */
+/* $NetBSD: efimemory.c,v 1.4 2017/02/14 13:29:09 nonaka Exp $ */
/*-
* Copyright (c) 2016 Kimihiro Nonaka <nonaka%netbsd.org@localhost>
@@ -35,7 +35,15 @@
"available",
"reserved",
"ACPI reclaimable",
- "ACPI NVS"
+ "ACPI NVS",
+ "unusable",
+ "disabled",
+ "Persistent",
+ "undefined (8)",
+ "undefined (9)",
+ "undefined (10)",
+ "undefined (11)",
+ "Persistent (Legacy)"
};
static const char *efimemtypes[] = {
@@ -53,6 +61,7 @@
"MemoryMappedIO",
"MemoryMappedIOPortSpace",
"PalCode",
+ "PersistentMemory",
};
static int
@@ -74,6 +83,9 @@
case EfiACPIMemoryNVS:
return BIM_NVS;
+ case EfiPersistentMemory:
+ return BIM_PMEM;
+
case EfiReservedMemoryType:
case EfiRuntimeServicesCode:
case EfiRuntimeServicesData:
@@ -82,9 +94,9 @@
case EfiMemoryMappedIOPortSpace:
case EfiPalCode:
case EfiMaxMemoryType:
+ default:
return BIM_Reserved;
}
- return BIM_Reserved;
}
EFI_MEMORY_DESCRIPTOR *
diff -r 859c604697e7 -r afef558f4ed5 sys/arch/x86/acpi/acpi_machdep.c
--- a/sys/arch/x86/acpi/acpi_machdep.c Tue Feb 14 13:25:22 2017 +0000
+++ b/sys/arch/x86/acpi/acpi_machdep.c Tue Feb 14 13:29:09 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_machdep.c,v 1.17 2017/02/14 13:23:50 nonaka Exp $ */
+/* $NetBSD: acpi_machdep.c,v 1.18 2017/02/14 13:29:09 nonaka Exp $ */
/*
* Copyright 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.17 2017/02/14 13:23:50 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.18 2017/02/14 13:29:09 nonaka Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -395,6 +395,8 @@
(type == BIM_Reserved) ? "Reserved" :
(type == BIM_ACPI) ? "ACPI" :
(type == BIM_NVS) ? "NVS" :
+ (type == BIM_PMEM) ? "Persistent" :
+ (type == BIM_PRAM) ? "Persistent (Legacy)" :
"unknown");
switch (type) {
diff -r 859c604697e7 -r afef558f4ed5 sys/arch/x86/include/efi.h
--- a/sys/arch/x86/include/efi.h Tue Feb 14 13:25:22 2017 +0000
+++ b/sys/arch/x86/include/efi.h Tue Feb 14 13:29:09 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: efi.h,v 1.4 2017/02/14 13:23:50 nonaka Exp $ */
+/* $NetBSD: efi.h,v 1.5 2017/02/14 13:29:09 nonaka Exp $ */
/*-
* Copyright (c) 2004 Marcel Moolenaar
@@ -74,6 +74,7 @@
#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_PMEM 14 /* Persistent memory. */
uint32_t __pad;
uint64_t md_phys;
uint64_t md_virt;
diff -r 859c604697e7 -r afef558f4ed5 sys/arch/x86/x86/efi.c
--- a/sys/arch/x86/x86/efi.c Tue Feb 14 13:25:22 2017 +0000
+++ b/sys/arch/x86/x86/efi.c Tue Feb 14 13:29:09 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: efi.c,v 1.7 2017/02/14 13:23:50 nonaka Exp $ */
+/* $NetBSD: efi.c,v 1.8 2017/02/14 13:29:09 nonaka Exp $ */
/*-
* Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: efi.c,v 1.7 2017/02/14 13:23:50 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: efi.c,v 1.8 2017/02/14 13:29:09 nonaka Exp $");
#include <sys/kmem.h>
#include <sys/param.h>
@@ -320,6 +320,9 @@
case EFI_MD_TYPE_FIRMWARE:
return BIM_NVS;
+ case EFI_MD_TYPE_PMEM:
+ return BIM_PMEM;
+
case EFI_MD_TYPE_NULL:
case EFI_MD_TYPE_RT_CODE:
case EFI_MD_TYPE_RT_DATA:
@@ -327,9 +330,9 @@
case EFI_MD_TYPE_IOMEM:
case EFI_MD_TYPE_IOPORT:
case EFI_MD_TYPE_PALCODE:
+ default:
return BIM_Reserved;
}
- return BIM_Reserved;
}
const char *
@@ -350,6 +353,7 @@
"MemoryMappedIO",
"MemoryMappedIOPortSpace",
"PalCode",
+ "PersistentMemory",
};
if (type < __arraycount(efimemtypes))
diff -r 859c604697e7 -r afef558f4ed5 sys/arch/x86/x86/x86_machdep.c
--- a/sys/arch/x86/x86/x86_machdep.c Tue Feb 14 13:25:22 2017 +0000
+++ b/sys/arch/x86/x86/x86_machdep.c Tue Feb 14 13:29:09 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: x86_machdep.c,v 1.88 2017/02/14 13:23:50 nonaka Exp $ */
+/* $NetBSD: x86_machdep.c,v 1.89 2017/02/14 13:29:09 nonaka Exp $ */
/*-
* Copyright (c) 2002, 2006, 2007 YAMAMOTO Takashi,
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.88 2017/02/14 13:23:50 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.89 2017/02/14 13:29:09 nonaka Exp $");
#include "opt_modular.h"
#include "opt_physmem.h"
@@ -658,6 +658,8 @@
(type == BIM_Reserved) ? "Reserved" :
(type == BIM_ACPI) ? "ACPI" :
(type == BIM_NVS) ? "NVS" :
+ (type == BIM_PMEM) ? "Persistent" :
+ (type == BIM_PRAM) ? "Persistent (Legacy)" :
"unknown");
#endif
diff -r 859c604697e7 -r afef558f4ed5 sys/external/bsd/gnu-efi/dist/inc/efidef.h
--- a/sys/external/bsd/gnu-efi/dist/inc/efidef.h Tue Feb 14 13:25:22 2017 +0000
+++ b/sys/external/bsd/gnu-efi/dist/inc/efidef.h Tue Feb 14 13:29:09 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: efidef.h,v 1.1.1.1 2014/04/01 16:16:07 jakllsch Exp $ */
+/* $NetBSD: efidef.h,v 1.2 2017/02/14 13:29:09 nonaka Exp $ */
#ifndef _EFI_DEF_H
#define _EFI_DEF_H
@@ -162,6 +162,7 @@
EfiMemoryMappedIO,
EfiMemoryMappedIOPortSpace,
EfiPalCode,
+ EfiPersistentMemory,
EfiMaxMemoryType
} EFI_MEMORY_TYPE;
Home |
Main Index |
Thread Index |
Old Index