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
63 pj 1
#include <kernel/kern.h>
80 pj 2
#include "ll/sys/cdefs.h"
63 pj 3
 
80 pj 4
__BEGIN_DECLS
5
 
63 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 atomic_t int
27
 
28
#ifndef NULL
29
        #define NULL 0
30
#endif
31
 
32
#define jiffies 0               /* Has to be controlled...      */
33
#define HZ 100                  /* Has to be controlled...      */
34
extern long unsigned int loops_per_sec; /* ... */
35
#define EISA_bus 0              /* We do not support EISA buses...      */
36
 
37
#define NET_BH 1                /* ???? */
38
 
39
/* Linux Module stub emulation... */
40
#define MOD_INC_USE_COUNT       /* Do nothing... */
41
#define MOD_DEC_USE_COUNT       /* Do nothing... */
42
#define MOD_IN_USE      0       /* No module => never in use... */
43
 
44
#define GFP_KERNEL      0x03    /* Don't know what it is... */
45
#define GFP_ATOMIC      0x01    /* Don't know what it is... */
46
 
47
 
48
/*      Linux kernel call emulation     */
49
#define kmalloc(a,b) malloc(a)
50
//#define printk cprintf I would like to use the kernel printk if possible...
51
#define check_region(a,b) 0
52
#define request_region(a,b,c)
53
 
54
/* Linux funcs emulation... */
55
#define outb_p(v,p) outp(p,v)
56
#define outb(v,p) outp(p,v)
57
#define outw(v,p) outpw(p,v)
58
#define outl(v,p) outpd(p,v)
59
#define inb_p(p) inp(p)
60
#define inb(p) inp(p)
61
#define inw(p) inpw(p)
62
#define inl(p) inpd(p)
168 giacomo 63
#define malloc(a) malloc(a)
63 pj 64
 
65
#define mark_bh(NET_BH)                 /* Don't use soft int emulation... */
66
 
67
 
68
#define cli() kern_cli()
69
#define sti() kern_sti()
70
#define save_flags(f) f = kern_fsave()
71
#define restore_flags(f) kern_frestore(f)
72
 
73
 
74
/* URKA Stubs */
75
 
76
extern void panic_stub(void);
77
/* #define eth_header panic_stub */
78
#define eth_rebuild_header panic_stub
79
#define eth_header_cache_bind panic_stub
80
#define eth_header_cache_update panic_stub
81
 
82
 
83
#define atomic_sub(a,b)
84
 
85
 
86
#define vremap(a,b) 0
87
 
88
 
89
extern __inline__ int suser(void)
90
{
91
  return 1;
92
}
93
 
94
 
95
// spinlocks
96
#define spinlock_t DWORD
97
#define spin_lock(x)   (void)(x)
98
#define spin_unlock(x) (void)(x)
99
 
100
#define spin_lock_irqsave(x,y) y = kern_fsave()
101
#define spin_unlock_irqrestore(x,y) kern_frestore(y)
102
#define spin_lock_init(x)
103
#define SPIN_LOCK_UNLOCKED (spinlock_t) 0
104
 
105
 
106
extern __inline__ void panic(const char *c)
107
{
108
  cputs((char *)c);
109
  sys_end();
110
}
111
 
112
/* below tuff added for rtl8139 net driver
113
   at some point this stuff should moved in a more conevenient place.
114
*/
115
 
116
/* *** from linux-2.2.17/include/linux/compatmac.h */  
117
#define capable(x)                   suser()
118
 
119
/* *** from linux-2.2.17/include/linux/capability.h */
120
#define CAP_NET_ADMIN        12
121
 
122
/* *** from linux-2.2.17/include/linux/byteorder/little_endian.h */
123
#define __le16_to_cpu(x) ((__u16)(x))
124
 
125
/* *** from linux-2.2.17/include/linux/byteorder/generic.h */
126
#define le16_to_cpu __le16_to_cpu
127
 
80 pj 128
__END_DECLS
63 pj 129
#endif