diff options
author | Srikant Patnaik | 2015-01-13 15:08:24 +0530 |
---|---|---|
committer | Srikant Patnaik | 2015-01-13 15:08:24 +0530 |
commit | 97327692361306d1e6259021bc425e32832fdb50 (patch) | |
tree | fe9088f3248ec61e24f404f21b9793cb644b7f01 /include/linux/wmt-mb.h | |
parent | 2d05a8f663478a44e088d122e0d62109bbc801d0 (diff) | |
parent | a3a8b90b61e21be3dde9101c4e86c881e0f06210 (diff) | |
download | FOSSEE-netbook-kernel-source-97327692361306d1e6259021bc425e32832fdb50.tar.gz FOSSEE-netbook-kernel-source-97327692361306d1e6259021bc425e32832fdb50.tar.bz2 FOSSEE-netbook-kernel-source-97327692361306d1e6259021bc425e32832fdb50.zip |
dirty fix to merging
Diffstat (limited to 'include/linux/wmt-mb.h')
-rwxr-xr-x | include/linux/wmt-mb.h | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/include/linux/wmt-mb.h b/include/linux/wmt-mb.h new file mode 100755 index 00000000..8c1a48d7 --- /dev/null +++ b/include/linux/wmt-mb.h @@ -0,0 +1,101 @@ +/*++ + * WonderMedia Memory Block driver + * + * Copyright c 2010 WonderMedia Technologies, Inc. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * WonderMedia Technologies, Inc. + * 10F, 529, Chung-Cheng Road, Hsin-Tien, Taipei 231, R.O.C +--*/ +#ifndef MEMBLOCK_H +#define MEMBLOCK_H + +#include <linux/types.h> + +struct prdt_struct{ + unsigned int addr; + unsigned short size; + unsigned short reserve : 15; + unsigned short EDT : 1; +}__attribute__((packed)) ; + +struct mmu_table_info{ + unsigned int addr; + unsigned int size; + unsigned int offset; +}__attribute__((packed)) ; + +// 1 presents the task init that would never be released +#define MB_DEF_TGID 0 + +#ifdef CONFIG_WMT_MB_RESERVE_FROM_IO +#define mb_virt_to_phys(v) mb_do_virt_to_phys(v,MB_DEF_TGID,THE_MB_USER) +#define mb_phys_to_virt(p) mb_do_phys_to_virt(p,MB_DEF_TGID,THE_MB_USER) +#else +#define mb_virt_to_phys(v) virt_to_phys(v) +#define mb_phys_to_virt(p) phys_to_virt(p) +#endif +#define mb_user_to_virt(u) mb_do_user_to_virt(u,MB_DEF_TGID,THE_MB_USER) +#define mb_user_to_phys(u) mb_do_user_to_phys(u,MB_DEF_TGID,THE_MB_USER) +/* all addresses are physical */ +#define mb_alloc(s) mb_do_alloc(s,MB_DEF_TGID,THE_MB_USER) +#define mb_free(p) mb_do_free(p,MB_DEF_TGID,THE_MB_USER) +#define mb_get(p) mb_do_get(p,MB_DEF_TGID,THE_MB_USER) +#define mb_put(p) mb_do_put(p,MB_DEF_TGID,THE_MB_USER) +#define mb_counter(p) mb_do_counter(p,THE_MB_USER) + +void *mb_do_phys_to_virt(unsigned long phys, pid_t, char *); +unsigned long mb_do_virt_to_phys(void *virt, pid_t, char *); +unsigned long mb_do_user_to_virt(unsigned long, pid_t, char *); +unsigned long mb_do_user_to_phys(unsigned long, pid_t, char *); +unsigned long mb_do_alloc(unsigned long, pid_t, char *); +int mb_do_free(unsigned long, pid_t, char *); +int mb_do_get(unsigned long, pid_t, char *); +int mb_do_put(unsigned long, pid_t, char *); +int mb_do_counter(unsigned long, char *); + +int user_to_prdt( + unsigned long user, + unsigned int size, + struct prdt_struct *next, + unsigned int items); + +unsigned int wmt_mmu_table_size(unsigned int size); +void wmt_mmu_table_dump(struct mmu_table_info *info); +// To fix framebuffer build issue +#if 0 +int wmt_mmu_table_check( + unsigned int mmuPhys, + unsigned int mmuSize, + unsigned int size); +unsigned int wmt_mmu_table_from_phys( + unsigned int mmuPhys, + unsigned int mmuSize, + unsigned int addr, + unsigned int size); +unsigned int wmt_mmu_table_from_user( + unsigned int mmuPhys, + unsigned int mmuSize, + unsigned int user, + unsigned int size); +#endif +unsigned int wmt_mmu_table_create( + unsigned int addr, + unsigned int size, + unsigned int addrType, + struct mmu_table_info *info); +unsigned int wmt_mmu_table_destroy(struct mmu_table_info *info); + +#endif |