Rev 333 | 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 |
||
442 | giacomo | 34 | #define s16 signed short int |
2 | pj | 35 | //#define u_short unsigned short int |
36 | #define ushort unsigned short int |
||
37 | //#define u_char unsigned char |
||
38 | #define u8 unsigned char |
||
39 | #define __u8 unsigned char |
||
202 | pj | 40 | #define uint8_t unsigned char |
41 | #define uint16_t unsigned short int |
||
42 | #define uint32_t unsigned int |
||
43 | #define uint unsigned int |
||
44 | #define ulong unsigned long |
||
2 | pj | 45 | |
202 | pj | 46 | #define caddr_t unsigned int |
47 | |||
2 | pj | 48 | #define atomic_t int |
49 | |||
50 | #ifndef NULL |
||
51 | #define NULL 0 |
||
52 | #endif |
||
53 | |||
54 | #define HZ 100 /* Has to be controlled... */ |
||
218 | giacomo | 55 | #define jiffies (sys_gettime(NULL)*HZ/1000000) /* Has to be controlled... */ |
2 | pj | 56 | extern long unsigned int loops_per_sec; /* ... */ |
57 | #define EISA_bus 0 /* We do not support EISA buses... */ |
||
58 | |||
59 | #define NET_BH 1 /* ???? */ |
||
60 | |||
61 | /* Linux Module stub emulation... */ |
||
62 | #define MOD_INC_USE_COUNT /* Do nothing... */ |
||
63 | #define MOD_DEC_USE_COUNT /* Do nothing... */ |
||
64 | #define MOD_IN_USE 0 /* No module => never in use... */ |
||
218 | giacomo | 65 | #define MODULE_AUTHOR(a) |
66 | #define MODULE_DESCRIPTION(a) |
||
67 | #define MODULE_LICENSE(a) |
||
68 | #define MODULE_PARM(a,b) |
||
69 | #define MODULE_PARM_DESC(a,b) |
||
2 | pj | 70 | |
71 | #define GFP_KERNEL 0x03 /* Don't know what it is... */ |
||
72 | #define GFP_ATOMIC 0x01 /* Don't know what it is... */ |
||
73 | |||
74 | |||
75 | /* Linux kernel call emulation */ |
||
76 | #define kmalloc(a,b) malloc(a) |
||
19 | pj | 77 | //#define printk cprintf I would like to use the kernel printk if possible... |
2 | pj | 78 | #define check_region(a,b) 0 |
79 | #define request_region(a,b,c) |
||
202 | pj | 80 | #define release_region(a,b) |
2 | pj | 81 | |
82 | /* Linux funcs emulation... */ |
||
83 | #define outb_p(v,p) outp(p,v) |
||
84 | #define outb(v,p) outp(p,v) |
||
85 | #define outw(v,p) outpw(p,v) |
||
86 | #define outl(v,p) outpd(p,v) |
||
87 | #define inb_p(p) inp(p) |
||
88 | #define inb(p) inp(p) |
||
89 | #define inw(p) inpw(p) |
||
90 | #define inl(p) inpd(p) |
||
91 | |||
92 | #define mark_bh(NET_BH) /* Don't use soft int emulation... */ |
||
93 | |||
94 | |||
218 | giacomo | 95 | #define __cli() kern_cli() |
96 | #define __sti() kern_sti() |
||
2 | pj | 97 | #define cli() kern_cli() |
98 | #define sti() kern_sti() |
||
218 | giacomo | 99 | #define __save_flags(f) f = kern_fsave() |
100 | #define __restore_flags(f) kern_frestore(f) |
||
2 | pj | 101 | #define save_flags(f) f = kern_fsave() |
102 | #define restore_flags(f) kern_frestore(f) |
||
103 | |||
104 | |||
105 | /* URKA Stubs */ |
||
106 | |||
107 | extern void panic_stub(void); |
||
108 | /* #define eth_header panic_stub */ |
||
109 | #define eth_rebuild_header panic_stub |
||
110 | #define eth_header_cache_bind panic_stub |
||
111 | #define eth_header_cache_update panic_stub |
||
112 | |||
113 | |||
114 | #define atomic_sub(a,b) |
||
115 | |||
116 | |||
117 | #define vremap(a,b) 0 |
||
118 | |||
119 | |||
120 | extern __inline__ int suser(void) |
||
121 | { |
||
122 | return 1; |
||
123 | } |
||
124 | |||
125 | |||
126 | // spinlocks |
||
127 | #define spinlock_t DWORD |
||
128 | #define spin_lock(x) (void)(x) |
||
129 | #define spin_unlock(x) (void)(x) |
||
130 | |||
131 | #define spin_lock_irqsave(x,y) y = kern_fsave() |
||
132 | #define spin_unlock_irqrestore(x,y) kern_frestore(y) |
||
133 | #define spin_lock_init(x) |
||
134 | #define SPIN_LOCK_UNLOCKED (spinlock_t) 0 |
||
218 | giacomo | 135 | #define spin_lock_irq(lock) kern_cli() |
136 | #define spin_unlock_irq(lock) kern_sti() |
||
2 | pj | 137 | |
138 | extern __inline__ void panic(const char *c) |
||
139 | { |
||
140 | cputs((char *)c); |
||
141 | sys_end(); |
||
142 | } |
||
143 | |||
144 | /* below tuff added for rtl8139 net driver |
||
145 | at some point this stuff should moved in a more conevenient place. |
||
146 | */ |
||
147 | |||
148 | /* *** from linux-2.2.17/include/linux/compatmac.h */ |
||
149 | #define capable(x) suser() |
||
150 | |||
218 | giacomo | 151 | #define __devinitdata |
152 | #define __devinit |
||
153 | |||
154 | struct pci_device_id { |
||
155 | unsigned int vendor, device; /* Vendor and device ID or PCI_ANY_ID */ |
||
156 | unsigned int subvendor, subdevice; /* Subsystem ID's or PCI_ANY_ID */ |
||
157 | unsigned int class, class_mask; /* (class,subclass,prog-if) triplet */ |
||
158 | unsigned long driver_data; /* Data private to the driver */ |
||
159 | }; |
||
160 | #define PCI_ANY_ID (~0) |
||
161 | #define MODULE_DEVICE_TABLE(a,b) |
||
162 | |||
163 | #ifdef CONFIG_HIGHMEM |
||
164 | typedef u64 dma_addr_t; |
||
165 | #else |
||
166 | typedef u32 dma_addr_t; |
||
167 | #endif |
||
2 | pj | 168 | /* *** from linux-2.2.17/include/linux/capability.h */ |
169 | #define CAP_NET_ADMIN 12 |
||
170 | |||
171 | /* *** from linux-2.2.17/include/linux/byteorder/little_endian.h */ |
||
172 | #define __le16_to_cpu(x) ((__u16)(x)) |
||
173 | |||
174 | /* *** from linux-2.2.17/include/linux/byteorder/generic.h */ |
||
175 | #define le16_to_cpu __le16_to_cpu |
||
176 | |||
80 | pj | 177 | __END_DECLS |
2 | pj | 178 | #endif |