Rev 1618 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
629 | giacomo | 1 | #include <kernel/kern.h> |
2 | #include <stdlib.h> |
||
1621 | fabio | 3 | #include <arch/sys/cdefs.h> |
629 | giacomo | 4 | |
5 | __BEGIN_DECLS |
||
6 | |||
7 | #ifndef __UNIXCOMP__ |
||
8 | #define __UNIXCOMP__ |
||
9 | |||
10 | #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) |
||
11 | #define LINUX_VERSION_CODE 0x20209 |
||
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 s16 signed short int |
||
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 |
||
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 |
||
45 | |||
46 | #define caddr_t unsigned int |
||
47 | |||
48 | #define atomic_t int |
||
49 | |||
50 | #ifndef NULL |
||
51 | #define NULL 0 |
||
52 | #endif |
||
53 | |||
54 | #define HZ 100 /* Has to be controlled... */ |
||
55 | #define jiffies (sys_gettime(NULL)*HZ/1000000) /* Has to be controlled... */ |
||
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... */ |
||
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) |
||
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) |
||
77 | //#define printk cprintf I would like to use the kernel printk if possible... |
||
78 | #define check_region(a,b) 0 |
||
79 | #define request_region(a,b,c) |
||
80 | #define release_region(a,b) |
||
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 | |||
95 | #define __cli() kern_cli() |
||
96 | #define __sti() kern_sti() |
||
97 | #define cli() kern_cli() |
||
98 | #define sti() kern_sti() |
||
99 | #define __save_flags(f) f = kern_fsave() |
||
100 | #define __restore_flags(f) kern_frestore(f) |
||
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 |
||
135 | #define spin_lock_irq(lock) kern_cli() |
||
136 | #define spin_unlock_irq(lock) kern_sti() |
||
137 | |||
138 | extern __inline__ void panic(const char *c) |
||
139 | { |
||
140 | cputs((char *)c); |
||
927 | pj | 141 | exit(1); |
629 | giacomo | 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 | |||
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 |
||
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 | |||
177 | __END_DECLS |
||
178 | #endif |