Subversion Repositories shark

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 pj 1
#include <kernel/kern.h>
2
 
3
#ifndef __UNIXCOMP__
4
#define __UNIXCOMP__
5
 
6
#define LINUX_VERSION_CODE 0x22000
7
 
8
#define SA_NOCLDSTOP    1
9
#define SA_SHIRQ        0x04000000
10
#define SA_STACK        0x08000000
11
#define SA_RESTART      0x10000000
12
#define SA_INTERRUPT    0x20000000
13
#define SA_NOMASK       0x40000000
14
#define SA_ONESHOT      0x80000000
15
 
16
#define PAGE_SIZE 0x400
17
 
18
/* #define USE_SHARED_IRQ */
19
 
20
struct pt_regs {
21
        };              /* This have to be checked...   */
22
 
23
#define __u32 unsigned long int
24
#define u32 unsigned long int
25
#define s32 signed long int
26
//#define u_long unsigned long int
27
#define __u16 unsigned short int
28
#define u16 unsigned short int
29
//#define u_short unsigned short int
30
#define ushort unsigned short int
31
//#define u_char unsigned char
32
#define u8 unsigned char
33
#define __u8 unsigned char
34
 
35
#define atomic_t int
36
 
37
#ifndef NULL
38
        #define NULL 0
39
#endif
40
 
41
#define jiffies 0               /* Has to be controlled...      */
42
#define HZ 100                  /* Has to be controlled...      */
43
extern long unsigned int loops_per_sec; /* ... */
44
#define EISA_bus 0              /* We do not support EISA buses...      */
45
 
46
#define NET_BH 1                /* ???? */
47
 
48
/* Linux Module stub emulation... */
49
#define MOD_INC_USE_COUNT       /* Do nothing... */
50
#define MOD_DEC_USE_COUNT       /* Do nothing... */
51
#define MOD_IN_USE      0       /* No module => never in use... */
52
 
53
#define GFP_KERNEL      0x03    /* Don't know what it is... */
54
#define GFP_ATOMIC      0x01    /* Don't know what it is... */
55
 
56
 
57
/*      Linux kernel call emulation     */
58
#define kmalloc(a,b) malloc(a)
59
#define printk cprintf
60
#define check_region(a,b) 0
61
#define request_region(a,b,c)
62
 
63
/* Linux funcs emulation... */
64
#define outb_p(v,p) outp(p,v)
65
#define outb(v,p) outp(p,v)
66
#define outw(v,p) outpw(p,v)
67
#define outl(v,p) outpd(p,v)
68
#define inb_p(p) inp(p)
69
#define inb(p) inp(p)
70
#define inw(p) inpw(p)
71
#define inl(p) inpd(p)
72
#define malloc(a) kern_alloc(a)
73
 
74
#define mark_bh(NET_BH)                 /* Don't use soft int emulation... */
75
 
76
 
77
#define cli() kern_cli()
78
#define sti() kern_sti()
79
#define save_flags(f) f = kern_fsave()
80
#define restore_flags(f) kern_frestore(f)
81
 
82
 
83
/* URKA Stubs */
84
 
85
extern void panic_stub(void);
86
/* #define eth_header panic_stub */
87
#define eth_rebuild_header panic_stub
88
#define eth_header_cache_bind panic_stub
89
#define eth_header_cache_update panic_stub
90
 
91
 
92
#define atomic_sub(a,b)
93
 
94
 
95
#define vremap(a,b) 0
96
 
97
 
98
extern __inline__ int suser(void)
99
{
100
  return 1;
101
}
102
 
103
 
104
// spinlocks
105
#define spinlock_t DWORD
106
#define spin_lock(x)   (void)(x)
107
#define spin_unlock(x) (void)(x)
108
 
109
#define spin_lock_irqsave(x,y) y = kern_fsave()
110
#define spin_unlock_irqrestore(x,y) kern_frestore(y)
111
#define spin_lock_init(x)
112
#define SPIN_LOCK_UNLOCKED (spinlock_t) 0
113
 
114
 
115
extern __inline__ void panic(const char *c)
116
{
117
  cputs((char *)c);
118
  sys_end();
119
}
120
 
121
/* below tuff added for rtl8139 net driver
122
   at some point this stuff should moved in a more conevenient place.
123
*/
124
 
125
/* *** from linux-2.2.17/include/linux/compatmac.h */  
126
#define capable(x)                   suser()
127
 
128
/* *** from linux-2.2.17/include/linux/capability.h */
129
#define CAP_NET_ADMIN        12
130
 
131
/* *** from linux-2.2.17/include/linux/byteorder/little_endian.h */
132
#define __le16_to_cpu(x) ((__u16)(x))
133
 
134
/* *** from linux-2.2.17/include/linux/byteorder/generic.h */
135
#define le16_to_cpu __le16_to_cpu
136
 
137
#endif