Rev 168 | 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) |
||
218 | 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() |
||
218 | giacomo | 70 | #define __save_flags(f) f = kern_fsave() |
63 | pj | 71 | #define save_flags(f) f = kern_fsave() |
218 | giacomo | 72 | #define __restore_flags(f) kern_frestore(f) |
63 | pj | 73 | #define restore_flags(f) kern_frestore(f) |
218 | giacomo | 74 | #define __cli(f) kern_cli(f) |
75 | #define __sti(f) kern_cli(f) |
||
63 | pj | 76 | |
77 | |||
78 | /* URKA Stubs */ |
||
79 | |||
80 | extern void panic_stub(void); |
||
81 | /* #define eth_header panic_stub */ |
||
82 | #define eth_rebuild_header panic_stub |
||
83 | #define eth_header_cache_bind panic_stub |
||
84 | #define eth_header_cache_update panic_stub |
||
85 | |||
86 | |||
87 | #define atomic_sub(a,b) |
||
88 | |||
89 | |||
90 | #define vremap(a,b) 0 |
||
91 | |||
92 | |||
93 | extern __inline__ int suser(void) |
||
94 | { |
||
95 | return 1; |
||
96 | } |
||
97 | |||
98 | |||
99 | // spinlocks |
||
100 | #define spinlock_t DWORD |
||
101 | #define spin_lock(x) (void)(x) |
||
102 | #define spin_unlock(x) (void)(x) |
||
103 | |||
104 | #define spin_lock_irqsave(x,y) y = kern_fsave() |
||
105 | #define spin_unlock_irqrestore(x,y) kern_frestore(y) |
||
106 | #define spin_lock_init(x) |
||
107 | #define SPIN_LOCK_UNLOCKED (spinlock_t) 0 |
||
108 | |||
109 | |||
110 | extern __inline__ void panic(const char *c) |
||
111 | { |
||
112 | cputs((char *)c); |
||
113 | sys_end(); |
||
114 | } |
||
115 | |||
116 | /* below tuff added for rtl8139 net driver |
||
117 | at some point this stuff should moved in a more conevenient place. |
||
118 | */ |
||
119 | |||
120 | /* *** from linux-2.2.17/include/linux/compatmac.h */ |
||
121 | #define capable(x) suser() |
||
122 | |||
123 | /* *** from linux-2.2.17/include/linux/capability.h */ |
||
124 | #define CAP_NET_ADMIN 12 |
||
125 | |||
126 | /* *** from linux-2.2.17/include/linux/byteorder/little_endian.h */ |
||
127 | #define __le16_to_cpu(x) ((__u16)(x)) |
||
128 | |||
129 | /* *** from linux-2.2.17/include/linux/byteorder/generic.h */ |
||
130 | #define le16_to_cpu __le16_to_cpu |
||
131 | |||
80 | pj | 132 | __END_DECLS |
63 | pj | 133 | #endif |