--- zzzz-none-000/linux-2.6.39.4/drivers/char/mem.c 2011-08-03 19:43:28.000000000 +0000 +++ puma6-arm-6490-729/linux-2.6.39.4/drivers/char/mem.c 2021-11-10 13:23:10.000000000 +0000 @@ -8,6 +8,13 @@ * Shared /dev/zero mmapping support, Feb 2000, Kanoj Sarcar */ +/****************************************************************** + + Includes Intel Corporation's changes/modifications dated: 01/2013. + Changed/modified portions - Copyright(c) 2013, Intel Corporation. + +******************************************************************/ + #include #include #include @@ -34,6 +41,26 @@ # include #endif +#ifdef CONFIG_ARCH_GEN3 +int range_is_sys_ram(unsigned long pfn, unsigned long size) +{ + u64 from = ((u64)pfn) << PAGE_SHIFT; + u64 to = from + size; + u64 cursor = from; + + while (cursor < to) { + if (page_is_ram(pfn)) { + printk(KERN_INFO "system ram! pfn 0x%x.\n", (unsigned int)pfn); + return 1; + } + cursor += PAGE_SIZE; + pfn++; + } + return 0; +} +EXPORT_SYMBOL(range_is_sys_ram); +#endif + static inline unsigned long size_inside_page(unsigned long start, unsigned long size) {