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