0001
0002
0003
0004
0005
0006 #include <linux/platform_device.h>
0007 #include <linux/init.h>
0008 #include <linux/ioport.h>
0009
0010 static int found(struct resource *res, void *data)
0011 {
0012 return 1;
0013 }
0014
0015 static __init int register_e820_pmem(void)
0016 {
0017 struct platform_device *pdev;
0018 int rc;
0019
0020 rc = walk_iomem_res_desc(IORES_DESC_PERSISTENT_MEMORY_LEGACY,
0021 IORESOURCE_MEM, 0, -1, NULL, found);
0022 if (rc <= 0)
0023 return 0;
0024
0025
0026
0027
0028
0029 pdev = platform_device_alloc("e820_pmem", -1);
0030
0031 rc = platform_device_add(pdev);
0032 if (rc)
0033 platform_device_put(pdev);
0034
0035 return rc;
0036 }
0037 device_initcall(register_e820_pmem);