Initial commit
[kernel/linux-3.0.git] / drivers / gpu / vithar / osk / include / mali_osk_types.h
1 /*
2  *
3  * (C) COPYRIGHT 2010-2011 ARM Limited. All rights reserved.
4  *
5  * This program is free software and is provided to you under the terms of the GNU General Public License version 2
6  * as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence.
7  * 
8  * A copy of the licence is included with the program, and can also be obtained from Free Software
9  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
10  * 
11  */
12
13
14
15 #ifndef _OSK_TYPES_H_
16 #define _OSK_TYPES_H_
17
18 #ifndef _OSK_H_
19 #error "Include mali_osk.h directly"
20 #endif
21
22 #ifdef __cplusplus
23 extern "C"
24 {
25 #endif
26
27 typedef enum osk_error
28 {
29         OSK_ERR_NONE,          /**< Success */
30         OSK_ERR_FAIL,          /**< Unclassified failure */
31         OSK_ERR_MAP,           /**< Memory mapping operation failed */
32         OSK_ERR_ALLOC,         /**< Memory allocation failed */
33         OSK_ERR_ACCESS         /**< Permissions to access an object failed */
34 } osk_error;
35
36 #define OSK_STATIC_INLINE static __inline
37 #define OSK_BITS_PER_LONG (8 * sizeof(unsigned long))
38 #define OSK_ULONG_MAX (~0UL)
39
40 /**
41  * OSK workqueue flags
42  *
43  * Flags specifying the kind of workqueue to create. Flags can be combined.
44  */
45
46 /**
47  * By default a work queue guarantees non-reentrace on the same CPU. 
48  * When the OSK_WORKQ_NON_REENTRANT flag is set, this guarantee is 
49  * extended to all CPUs.
50  */
51 #define OSK_WORKQ_NON_REENTRANT  (1 << 0)
52 /**
53  * Work units submitted to a high priority queue start execution as soon
54  * as resources are available.
55  */
56 #define OSK_WORKQ_HIGH_PRIORITY  (1 << 1)
57 /**
58  * Ensures there is always a thread available to run tasks on this queue. This
59  * flag should be set if the work queue is involved in reclaiming memory when
60  * its work units run. 
61  */
62 #define OSK_WORKQ_RESCUER        (1 << 2)
63
64 /**
65  * Prototype for a function called when a OSK timer expires. See osk_timer_callback_set()
66  * that registers the callback function with a OSK timer.
67  */
68 typedef void (*osk_timer_callback)(void *);
69
70 typedef enum osk_power_state
71 {
72         OSK_POWER_STATE_OFF,            /**< Device is off */
73         OSK_POWER_STATE_IDLE,           /**< Device is idle */
74         OSK_POWER_STATE_ACTIVE          /**< Device is active */
75 } osk_power_state;
76
77 typedef enum osk_power_request_result
78 {
79         OSK_POWER_REQUEST_FINISHED,     /**< The driver successfully completed the power state change for the device */
80         OSK_POWER_REQUEST_FAILED,       /**< The driver for the device encountered an error changing the power state */
81         OSK_POWER_REQUEST_REFUSED       /**< The OS didn't allow the power state change for the device */
82 } osk_power_request_result;
83
84
85 #include <osk/mali_osk_arch_types.h>
86
87 #ifdef __cplusplus
88 }
89 #endif
90
91 #endif /* _OSK_TYPES_H_ */
92