diff --git a/include/linux/ashmem.h b/include/linux/ashmem.h index c4af6c81..c05c180d 100644 --- a/include/linux/ashmem.h +++ b/include/linux/ashmem.h @@ -45,7 +45,6 @@ struct ashmem_pin { #define ASHMEM_GET_PIN_STATUS _IO(__ASHMEMIOC, 9) #define ASHMEM_PURGE_ALL_CACHES _IO(__ASHMEMIOC, 10) #define ASHMEM_CACHE_FLUSH_RANGE _IO(__ASHMEMIOC, 11) -#define ASHMEM_CACHE_CLEAN_RANGE _IO(__ASHMEMIOC, 12) int get_ashmem_file(int fd, struct file **filp, struct file **vm_file, unsigned long *len); diff --git a/mm/ashmem.c b/mm/ashmem.c index 2931594c..b23406e1 100644 --- a/mm/ashmem.c +++ b/mm/ashmem.c @@ -668,7 +668,7 @@ static unsigned int kgsl_virtaddr_to_physaddr(unsigned int virtaddr) } #endif -static int ashmem_flush_cache_range(struct ashmem_area *asma, unsigned long cmd) +static int ashmem_flush_cache_range(struct ashmem_area *asma) { #ifdef CONFIG_OUTER_CACHE unsigned long end; @@ -686,19 +686,7 @@ static int ashmem_flush_cache_range(struct ashmem_area *asma, unsigned long cmd) goto done; } - switch (cmd) { - case ASHMEM_CACHE_FLUSH_RANGE: - dmac_flush_range((const void *)addr, - (const void *)(addr + size)); - break; - case ASHMEM_CACHE_CLEAN_RANGE: - dmac_clean_range((const void *)addr, - (const void *)(addr + size)); - break; - default: - result = -EINVAL; - goto done; - } + flush_cache_user_range(addr, addr + size); #ifdef CONFIG_OUTER_CACHE for (end = addr; end < (addr + size); end += PAGE_SIZE) { unsigned long physaddr; @@ -708,14 +696,7 @@ static int ashmem_flush_cache_range(struct ashmem_area *asma, unsigned long cmd) goto done; } - switch (cmd) { - case ASHMEM_CACHE_FLUSH_RANGE: - outer_flush_range(physaddr, physaddr + PAGE_SIZE); - break; - case ASHMEM_CACHE_CLEAN_RANGE: - outer_clean_range(physaddr, physaddr + PAGE_SIZE); - break; - } + outer_flush_range(physaddr, physaddr + PAGE_SIZE); } mb(); #endif @@ -765,8 +746,7 @@ static long ashmem_ioctl(struct file *file, unsigned int cmd, unsigned long arg) } break; case ASHMEM_CACHE_FLUSH_RANGE: - case ASHMEM_CACHE_CLEAN_RANGE: - ret = ashmem_flush_cache_range(asma, cmd); + ret = ashmem_flush_cache_range(asma); break; }