#define MALI_SWAP_LOW_MEM_DEFAULT_VALUE (60*1024*1024)
#define MALI_SWAP_INVALIDATE_MALI_ADDRESS (0) /* Used to mark the given memory cookie is invalidate. */
#define MALI_SWAP_GLOBAL_SWAP_FILE_SIZE (0xFFFFFFFF)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
+#define MALI_SWAP_GLOBAL_SWAP_FILE_INDEX ((MALI_SWAP_GLOBAL_SWAP_FILE_SIZE) >> PAGE_SHIFT)
+#else
#define MALI_SWAP_GLOBAL_SWAP_FILE_INDEX ((MALI_SWAP_GLOBAL_SWAP_FILE_SIZE) >> PAGE_CACHE_SHIFT)
+#endif
#define MALI_SWAP_GLOBAL_SWAP_FILE_INDEX_RESERVE (1 << 15) /* Reserved for CoW nonlinear swap backend memory, the space size is 128MB. */
unsigned int mali_mem_swap_out_threshold_value = MALI_SWAP_LOW_MEM_DEFAULT_VALUE;
dma_unmap_page(&mali_platform_device->dev, page_node->swap_it->dma_addr,
_MALI_OSK_MALI_PAGE_SIZE, DMA_TO_DEVICE);
set_page_dirty(page_node->swap_it->page);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
+ put_page(page_node->swap_it->page);
+#else
page_cache_release(page_node->swap_it->page);
+#endif
}
void mali_mem_swap_unlock_single_mem_backend(mali_mem_backend *mem_bkend)
#define MALI_SWAP_LOW_MEM_DEFAULT_VALUE (60*1024*1024)
#define MALI_SWAP_INVALIDATE_MALI_ADDRESS (0) /* Used to mark the given memory cookie is invalidate. */
#define MALI_SWAP_GLOBAL_SWAP_FILE_SIZE (0xFFFFFFFF)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
+#define MALI_SWAP_GLOBAL_SWAP_FILE_INDEX ((MALI_SWAP_GLOBAL_SWAP_FILE_SIZE) >> PAGE_SHIFT)
+#else
#define MALI_SWAP_GLOBAL_SWAP_FILE_INDEX ((MALI_SWAP_GLOBAL_SWAP_FILE_SIZE) >> PAGE_CACHE_SHIFT)
+#endif
#define MALI_SWAP_GLOBAL_SWAP_FILE_INDEX_RESERVE (1 << 15) /* Reserved for CoW nonlinear swap backend memory, the space size is 128MB. */
unsigned int mali_mem_swap_out_threshold_value = MALI_SWAP_LOW_MEM_DEFAULT_VALUE;
dma_unmap_page(&mali_platform_device->dev, page_node->swap_it->dma_addr,
_MALI_OSK_MALI_PAGE_SIZE, DMA_TO_DEVICE);
set_page_dirty(page_node->swap_it->page);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
+ put_page(page_node->swap_it->page);
+#else
page_cache_release(page_node->swap_it->page);
+#endif
}
void mali_mem_swap_unlock_single_mem_backend(mali_mem_backend *mem_bkend)
#define MALI_SWAP_LOW_MEM_DEFAULT_VALUE (60*1024*1024)
#define MALI_SWAP_INVALIDATE_MALI_ADDRESS (0) /* Used to mark the given memory cookie is invalidate. */
#define MALI_SWAP_GLOBAL_SWAP_FILE_SIZE (0xFFFFFFFF)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
+#define MALI_SWAP_GLOBAL_SWAP_FILE_INDEX ((MALI_SWAP_GLOBAL_SWAP_FILE_SIZE) >> PAGE_SHIFT)
+#else
#define MALI_SWAP_GLOBAL_SWAP_FILE_INDEX ((MALI_SWAP_GLOBAL_SWAP_FILE_SIZE) >> PAGE_CACHE_SHIFT)
+#endif
#define MALI_SWAP_GLOBAL_SWAP_FILE_INDEX_RESERVE (1 << 15) /* Reserved for CoW nonlinear swap backend memory, the space size is 128MB. */
unsigned int mali_mem_swap_out_threshold_value = MALI_SWAP_LOW_MEM_DEFAULT_VALUE;
dma_unmap_page(&mali_platform_device->dev, page_node->swap_it->dma_addr,
_MALI_OSK_MALI_PAGE_SIZE, DMA_TO_DEVICE);
set_page_dirty(page_node->swap_it->page);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
+ put_page(page_node->swap_it->page);
+#else
page_cache_release(page_node->swap_it->page);
+#endif
}
void mali_mem_swap_unlock_single_mem_backend(mali_mem_backend *mem_bkend)