Merge branch 'staging-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
[pandora-kernel.git] / drivers / staging / tidspbridge / include / dspbridge / dmm.h
1 /*
2  * dmm.h
3  *
4  * DSP-BIOS Bridge driver support functions for TI OMAP processors.
5  *
6  * The Dynamic Memory Mapping(DMM) module manages the DSP Virtual address
7  * space that can be directly mapped to any MPU buffer or memory region.
8  *
9  * Copyright (C) 2005-2006 Texas Instruments, Inc.
10  *
11  * This package is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License version 2 as
13  * published by the Free Software Foundation.
14  *
15  * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
16  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
17  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
18  */
19
20 #ifndef DMM_
21 #define DMM_
22
23 #include <dspbridge/dbdefs.h>
24
25 struct dmm_object;
26
27 /* DMM attributes used in dmm_create() */
28 struct dmm_mgrattrs {
29         u32 reserved;
30 };
31
32 #define DMMPOOLSIZE      0x4000000
33
34 /*
35  *  ======== dmm_get_handle ========
36  *  Purpose:
37  *      Return the dynamic memory manager object for this device.
38  *      This is typically called from the client process.
39  */
40
41 extern int dmm_get_handle(void *hprocessor,
42                                  struct dmm_object **dmm_manager);
43
44 extern int dmm_reserve_memory(struct dmm_object *dmm_mgr,
45                                      u32 size, u32 *prsv_addr);
46
47 extern int dmm_un_reserve_memory(struct dmm_object *dmm_mgr,
48                                         u32 rsv_addr);
49
50 extern int dmm_map_memory(struct dmm_object *dmm_mgr, u32 addr,
51                                  u32 size);
52
53 extern int dmm_un_map_memory(struct dmm_object *dmm_mgr,
54                                     u32 addr, u32 *psize);
55
56 extern int dmm_destroy(struct dmm_object *dmm_mgr);
57
58 extern int dmm_delete_tables(struct dmm_object *dmm_mgr);
59
60 extern int dmm_create(struct dmm_object **dmm_manager,
61                              struct dev_object *hdev_obj,
62                              const struct dmm_mgrattrs *mgr_attrts);
63
64 extern bool dmm_init(void);
65
66 extern void dmm_exit(void);
67
68 extern int dmm_create_tables(struct dmm_object *dmm_mgr,
69                                     u32 addr, u32 size);
70
71 #ifdef DSP_DMM_DEBUG
72 u32 dmm_mem_map_dump(struct dmm_object *dmm_mgr);
73 #endif
74
75 #endif /* DMM_ */