Subversion Repositories shark

Rev

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

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