Subversion Repositories Kolibri OS

Rev

Rev 1117 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1117 serge 1
 
2
#define __TYPES_H__
3
4
 
5
 
6
7
 
8
#define true                 1
9
10
 
11
typedef unsigned int         count_t;
12
typedef unsigned int         addr_t;
13
14
 
15
typedef unsigned short       u16;
16
typedef unsigned int         u32;
17
typedef unsigned long long   u64;
18
19
 
20
typedef unsigned short       __u16;
21
typedef unsigned int         __u32;
22
typedef unsigned long long   __u64;
23
24
 
25
typedef signed short        __s16;
26
typedef signed int          __s32;
27
typedef signed long long    __s64;
28
29
 
30
 
31
typedef unsigned short       uint16_t;
32
typedef unsigned int         uint32_t;
33
typedef unsigned long long   uint64_t;
34
35
 
36
typedef unsigned short       u16_t;
37
typedef unsigned int         u32_t;
38
typedef unsigned long long   u64_t;
39
40
 
41
42
 
43
typedef uint32_t             resource_size_t;
44
45
 
46
47
 
48
#define cpu_to_le32(v32) (v32)
49
#define cpu_to_le64(v64) (v64)
50
#define le16_to_cpu(v16) (v16)
51
#define le32_to_cpu(v32) (v32)
52
#define le64_to_cpu(v64) (v64)
53
54
 
55
#define unlikely(x)     __builtin_expect(!!(x), 0)
56
57
 
58
 
59
 
60
#define KERN_ALERT      "<1>"   /* action must be taken immediately     */
61
#define KERN_CRIT       "<2>"   /* critical conditions                  */
62
#define KERN_ERR        "<3>"   /* error conditions                     */
63
#define KERN_WARNING    "<4>"   /* warning conditions                   */
64
#define KERN_NOTICE     "<5>"   /* normal but significant condition     */
65
#define KERN_INFO       "<6>"   /* informational                        */
66
#define KERN_DEBUG      "<7>"   /* debug-level messages                 */
67
68
 
69
70
 
71
72
 
73
 
74
75
 
76
77
 
78
    printk(KERN_ERR "[" DRM_NAME ":%s] *ERROR* " fmt , __func__ , ##arg)
79
80
 
81
    printk(KERN_ERR "[" DRM_NAME ":%s] *ERROR* " fmt , __func__ , ##arg)
82
83
 
84
85
 
86
    BUILD_BUG_ON_ZERO(__builtin_types_compatible_p(typeof(a), typeof(&a[0])))
87
88
 
89
90
 
91
 
92
 
93
 
94
#define BUG() do { \
95
         printk("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __FUNCTION__); \
96
       /*  panic("BUG!"); */ \
97
 } while (0)
98
#endif
99
100
 
101
#define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while(0)
102
#endif
103
104
 
105
 
106
 
107
#define MTRR_TYPE_WRCOMB     1
108
#define MTRR_TYPE_WRTHROUGH  4
109
#define MTRR_TYPE_WRPROT     5
110
#define MTRR_TYPE_WRBACK     6
111
#define MTRR_NUM_TYPES       7
112
113
 
114
115
 
116
117
 
118
119
 
120
void*   memset(void *s, int c, size_t n);
121
size_t  strlen(const char *s);
122
123
 
124
125
 
126
127
 
128
{
129
    void *ret = malloc(size);
130
    memset(ret, 0, size);
131
    return ret;
132
}
133
134
 
135
136
 
137
//    struct kref refcount;
138
139
 
140
//    struct kref handlecount;
141
142
 
143
//    struct drm_device *dev;
144
145
 
146
//    struct file *filp;
147
148
 
149
//    struct drm_map_list map_list;
150
151
 
152
     * Size of the object, in bytes.  Immutable over the object's
153
     * lifetime.
154
     */
155
    size_t size;
156
157
 
158
     * Global name for this object, starts at 1. 0 means unnamed.
159
     * Access is covered by the object_name_lock in the related drm_device
160
     */
161
    int name;
162
163
 
164
     * Memory domains. These monitor which caches contain read/write data
165
     * related to the object. When transitioning from one set of domains
166
     * to another, the driver is called to ensure that caches are suitably
167
     * flushed and invalidated
168
     */
169
    uint32_t read_domains;
170
    uint32_t write_domain;
171
172
 
173
     * While validating an exec operation, the
174
     * new read/write domain values are computed here.
175
     * They will be transferred to the above values
176
     * at the point that any cache flushing occurs
177
     */
178
    uint32_t pending_read_domains;
179
    uint32_t pending_write_domain;
180
181
 
182
};
183
184
 
185
186
 
187
188
 
189
        const typeof( ((type *)0)->member ) *__mptr = (ptr);    \
190
        (type *)( (char *)__mptr - offsetof(type,member) );})
191
192
 
193
 
194
 
195
#define mb() __asm__ __volatile__("lock; addl $0,0(%esp)")
1119 serge 196
1117 serge 197
 
1119 serge 198
#define PAGE_SHIFT      12
199
1117 serge 200
 
1119 serge 201
1117 serge 202
 
1119 serge 203
 
1117 serge 204