]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/blobdiff - kernel/resource.c
resources: introduce generic page_is_ram()
[mirror_ubuntu-eoan-kernel.git] / kernel / resource.c
index fb11a58b95948a08c57ec46033f538d974a480dd..b4d637a552565a620db6a44ce2392a7d380e89fc 100644 (file)
@@ -297,6 +297,19 @@ int walk_system_ram_range(unsigned long start_pfn, unsigned long nr_pages,
 
 #endif
 
+static int __is_ram(unsigned long pfn, unsigned long nr_pages, void *arg)
+{
+       return 1;
+}
+/*
+ * This generic page_is_ram() returns true if specified address is
+ * registered as "System RAM" in iomem_resource list.
+ */
+int __attribute__((weak)) page_is_ram(unsigned long pfn)
+{
+       return walk_system_ram_range(pfn, 1, NULL, __is_ram) == 1;
+}
+
 /*
  * Find empty slot in the resource tree given range and alignment.
  */