1 | /* $Id: emu_wrapper.h 142 2000-04-23 14:55:46Z ktk $ */
|
---|
2 |
|
---|
3 | #ifndef __EMU_WRAPPER_H
|
---|
4 | #define __EMU_WRAPPER_H
|
---|
5 |
|
---|
6 | /* wrapper for 2.2 kernel */
|
---|
7 |
|
---|
8 | #include <linux/wrapper.h>
|
---|
9 |
|
---|
10 | #ifndef TARGET_OS2
|
---|
11 | #define vma_get_pgoff(v) vma_get_offset(v)
|
---|
12 | #endif
|
---|
13 |
|
---|
14 | #ifndef TARGET_OS2
|
---|
15 | #define DECLARE_WAITQUEUE(a, b) struct wait_queue a = {b, NULL};
|
---|
16 | #endif
|
---|
17 |
|
---|
18 | #ifdef TARGET_OS2
|
---|
19 | #define RSRCISIOREGION(dev,num) (!dev || ((dev)->resource[(num)].start != 0 && \
|
---|
20 | ((dev)->resource[(num)].flags & PCI_BASE_ADDRESS_SPACE) == PCI_BASE_ADDRESS_SPACE_IO))
|
---|
21 | #define RSRCADDRESS(dev,num) ((dev)->resource[(num)].start)
|
---|
22 | #else
|
---|
23 | #define wait_queue_head_t struct wait_queue *
|
---|
24 | #define init_waitqueue_head(a) init_waitqueue(a)
|
---|
25 | #define RSRCADDRESS(dev,num) ((dev)->base_address[(num)])
|
---|
26 |
|
---|
27 | #define RSRCISIOREGION(dev,num) (RSRCADDRESS(dev,num) != 0 && \
|
---|
28 | (RSRCADDRESS(dev,num) & PCI_BASE_ADDRESS_SPACE) == PCI_BASE_ADDRESS_SPACE_IO)
|
---|
29 | #define init_MUTEX(a) *(a) = MUTEX
|
---|
30 | #endif
|
---|
31 |
|
---|
32 | #define UP_INODE_SEM(a)
|
---|
33 | #define DOWN_INODE_SEM(a)
|
---|
34 |
|
---|
35 | #define GET_INODE_STRUCT() struct inode *inode = file->f_dentry->d_inode
|
---|
36 |
|
---|
37 | #ifdef TARGET_OS2
|
---|
38 | void tasklet_hi_schedule(struct tasklet_struct *t);
|
---|
39 | #else
|
---|
40 | #define tasklet_hi_schedule(t) queue_task((t), &tq_immediate); \
|
---|
41 | mark_bh(IMMEDIATE_BH)
|
---|
42 | #endif
|
---|
43 |
|
---|
44 | #define tasklet_init(t,f,d) (t)->next = NULL; \
|
---|
45 | (t)->sync = 0; \
|
---|
46 | (t)->routine = (void (*)(void *))(f); \
|
---|
47 | (t)->data = (void *)(d)
|
---|
48 |
|
---|
49 | #define tasklet_struct tq_struct
|
---|
50 |
|
---|
51 | #ifdef TARGET_OS2
|
---|
52 | #define tasklet_unlock_wait(t)
|
---|
53 | #else
|
---|
54 | #define tasklet_unlock_wait(t) while (test_bit(0, &(t)->sync)) { }
|
---|
55 | #endif
|
---|
56 |
|
---|
57 | #ifdef MODULE
|
---|
58 | #define __exit
|
---|
59 | #define module_init(x) int init_module(void) { return x(); }
|
---|
60 | #define module_exit(x) void cleanup_module(void) { x(); }
|
---|
61 | #endif
|
---|
62 |
|
---|
63 |
|
---|
64 | #ifdef TARGET_OS2
|
---|
65 | #define MODULE_DEVICE_TABLE(type,name)
|
---|
66 | #endif
|
---|
67 | #endif
|
---|