upload tizen1.0 source
[kernel/linux-2.6.36.git] / drivers / char / s5p_vmem.h
1 /* drivers/char/s5p_vmem.h
2  *
3  * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4  *              http://www.samsung.com/
5  *
6  * Header file for s5p_vmem
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License version 2 as
10  * published by the Free Software Foundation.
11 */
12
13 #if !defined(S5P_VMEM_H)
14 #define S5P_VMEM_H
15
16 #define MEM_IOCTL_MAGIC                 'M'
17
18 #define S5P_VMEM_ALLOC          _IOWR(MEM_IOCTL_MAGIC, 0, struct s5p_vmem_alloc)
19 #define S5P_VMEM_FREE           _IOWR(MEM_IOCTL_MAGIC, 1, struct s5p_vmem_alloc)
20
21 #define S5P_VMEM_SHARE_ALLOC    _IOWR(MEM_IOCTL_MAGIC, 4, struct s5p_vmem_alloc)
22 #define S5P_VMEM_SHARE_FREE     _IOWR(MEM_IOCTL_MAGIC, 5, struct s5p_vmem_alloc)
23
24 #define S5P_VMEM_CACHEABLE_ALLOC \
25         _IOWR(MEM_IOCTL_MAGIC, 6, struct s5p_vmem_alloc)
26 #define S5P_VMEM_CACHEABLE_SHARE_ALLOC  \
27         _IOWR(MEM_IOCTL_MAGIC, 7, struct s5p_vmem_alloc)
28 #define S5P_VMEM_RESET          _IOWR(MEM_IOCTL_MAGIC, 8, struct s5p_vmem_alloc)
29
30 #define S5P_VMEM_MAJOR  1
31 #define S5P_VMEM_MINOR  14
32 #undef USE_DMA_ALLOC
33
34 extern int s5p_vmem_mmap(struct file *filp, struct vm_area_struct *vma);
35 extern long s5p_vmem_ioctl(struct file *file, unsigned int cmd,
36                                 unsigned long arg);
37 extern int s5p_vmem_open(struct inode *inode, struct file *file);
38 extern int s5p_vmem_release(struct inode *inode, struct file *file);
39
40 struct s5p_vmem_alloc {
41         size_t size;
42         unsigned long vir_addr;
43         unsigned int cookie;
44         unsigned long vir_addr_k;
45 };
46
47 #endif /* S5P_VMEM_H */