Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1254228
| From | Toshi Kani <toshi.kani@hpe.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 2/3] resource: Add region_intersects_pmem() |
| Date | 2015-10-23 01:30 +0200 |
| Message-ID | <qmxt0-x2-21@gated-at.bofh.it> (permalink) |
| References | <qmxsZ-x2-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Add region_intersects_pmem(), which checks if a specified address
range is persistent memory registered as "Persistent Memory" in
the iomem_resource list.
Note, it does not support legacy persistent memory registered as
"Persistent Memory (legacy)". It can be supported by extending
this function or a separate function, if necessary.
This interface is exported so that it can be called from modules,
such as the EINJ driver.
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
---
include/linux/mm.h | 1 +
kernel/resource.c | 12 ++++++++++++
2 files changed, 13 insertions(+)
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 699224e..ae1790f 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -361,6 +361,7 @@ enum {
int region_intersects(resource_size_t offset, size_t size, const char *type,
unsigned long flags);
int region_intersects_ram(resource_size_t offset, size_t size);
+int region_intersects_pmem(resource_size_t offset, size_t size);
/* Support for virtually mapped pages */
struct page *vmalloc_to_page(const void *addr);
diff --git a/kernel/resource.c b/kernel/resource.c
index 8a77ed8..b6b61a1 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -547,6 +547,18 @@ int region_intersects_ram(resource_size_t start, size_t size)
IORESOURCE_MEM | IORESOURCE_BUSY);
}
+/*
+ * region_intersects_pmem() checks if a specified address range is
+ * persistent memory, registered as "Persistent Memory", in the
+ * iomem_resource list.
+ */
+int region_intersects_pmem(resource_size_t start, size_t size)
+{
+ return region_intersects(start, size, "Persistent Memory",
+ IORESOURCE_MEM);
+}
+EXPORT_SYMBOL_GPL(region_intersects_pmem);
+
void __weak arch_remove_reservations(struct resource *avail)
{
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH 0/3] Allow EINJ to inject memory error to NVDIMM Toshi Kani <toshi.kani@hpe.com> - 2015-10-23 01:30 +0200
[PATCH 1/3] resource: Add @flags to region_intersects() Toshi Kani <toshi.kani@hpe.com> - 2015-10-23 01:30 +0200
[PATCH 3/3] ACPI/APEI/EINJ: Allow memory error injection to NVDIMM Toshi Kani <toshi.kani@hpe.com> - 2015-10-23 01:30 +0200
Re: [PATCH 3/3] ACPI/APEI/EINJ: Allow memory error injection to NVDIMM Dan Williams <dan.j.williams@intel.com> - 2015-10-23 02:20 +0200
Re: [PATCH 3/3] ACPI/APEI/EINJ: Allow memory error injection to NVDIMM Toshi Kani <toshi.kani@hpe.com> - 2015-10-23 16:10 +0200
[PATCH 2/3] resource: Add region_intersects_pmem() Toshi Kani <toshi.kani@hpe.com> - 2015-10-23 01:30 +0200
csiph-web