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