pmem: Add cache flush ioctl for pmem buffers

Change-Id: I9156bad829e8c65087f122b48cc57638902fab12
Signed-off-by: Dima Zavin <dima@android.com>
This commit is contained in:
Dima Zavin
2010-03-02 15:47:57 -08:00
committed by Colin Cross
parent d3d0cbff72
commit d5fb3c725b
2 changed files with 11 additions and 0 deletions

View File

@@ -1148,6 +1148,16 @@ static long pmem_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
DLOG("connect\n");
return pmem_connect(arg, file);
break;
case PMEM_CACHE_FLUSH:
{
struct pmem_region region;
DLOG("flush\n");
if (copy_from_user(&region, (void __user *)arg,
sizeof(struct pmem_region)))
return -EFAULT;
flush_pmem_file(file, region.offset, region.len);
break;
}
default:
if (pmem[id].ioctl)
return pmem[id].ioctl(file, cmd, arg);

View File

@@ -33,6 +33,7 @@
* struct (with offset set to 0).
*/
#define PMEM_GET_TOTAL_SIZE _IOW(PMEM_IOCTL_MAGIC, 7, unsigned int)
#define PMEM_CACHE_FLUSH _IOW(PMEM_IOCTL_MAGIC, 8, unsigned int)
struct android_pmem_platform_data
{