source: cmedia/trunk/Sblive/emu_wrapper.h@ 354

Last change on this file since 354 was 354, checked in by stevenhl, 17 years ago

Import untested baseline cmedia sources, work products and binaries
Binaries and work products should be deleted from repository.
once new builds are verified to work.

File size: 1.8 KB
Line 
1/* $Id: emu_wrapper.h,v 1.2 2001/04/14 17:03:36 sandervl Exp $ */
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#define tasklet_struct tq_struct
38
39#ifdef TARGET_OS2
40void tasklet_hi_schedule(struct tasklet_struct *t);
41#else
42#define tasklet_hi_schedule(t) queue_task((t), &tq_immediate); \
43 mark_bh(IMMEDIATE_BH)
44#endif
45
46#define tasklet_init(t,f,d) (t)->next = NULL; \
47 (t)->sync = 0; \
48 (t)->routine = (void (*)(void *))(f); \
49 (t)->data = (void *)(d)
50
51
52#ifdef TARGET_OS2
53#define tasklet_unlock_wait(t)
54#else
55#define tasklet_unlock_wait(t) while (test_bit(0, &(t)->sync)) { }
56#endif
57
58#ifdef MODULE
59#define __exit
60#define module_init(x) int init_module(void) { return x(); }
61#define module_exit(x) void cleanup_module(void) { x(); }
62#endif
63
64
65#ifdef TARGET_OS2
66#define MODULE_DEVICE_TABLE(type,name)
67#endif
68#endif
Note: See TracBrowser for help on using the repository browser.