Rev 80 |
Go to most recent revision |
Blame |
Compare with Previous |
Last modification |
View Log
| RSS feed
#include <kernel/kern.h>
#include "ll/sys/cdefs.h"
__BEGIN_DECLS
#ifndef __UNIXCOMP__
#define __UNIXCOMP__
#define LINUX_VERSION_CODE 0x22000
#define SA_NOCLDSTOP 1
#define SA_SHIRQ 0x04000000
#define SA_STACK 0x08000000
#define SA_RESTART 0x10000000
#define SA_INTERRUPT 0x20000000
#define SA_NOMASK 0x40000000
#define SA_ONESHOT 0x80000000
#define PAGE_SIZE 0x400
/* #define USE_SHARED_IRQ */
struct pt_regs {
}; /* This have to be checked... */
#define atomic_t int
#ifndef NULL
#define NULL 0
#endif
#define jiffies 0 /* Has to be controlled... */
#define HZ 100 /* Has to be controlled... */
extern long unsigned int loops_per_sec; /* ... */
#define EISA_bus 0 /* We do not support EISA buses... */
#define NET_BH 1 /* ???? */
/* Linux Module stub emulation... */
#define MOD_INC_USE_COUNT /* Do nothing... */
#define MOD_DEC_USE_COUNT /* Do nothing... */
#define MOD_IN_USE 0 /* No module => never in use... */
#define GFP_KERNEL 0x03 /* Don't know what it is... */
#define GFP_ATOMIC 0x01 /* Don't know what it is... */
/* Linux kernel call emulation */
#define kmalloc(a,b) malloc(a)
//#define printk cprintf I would like to use the kernel printk if possible...
#define check_region(a,b) 0
#define request_region(a,b,c)
/* Linux funcs emulation... */
#define outb_p(v,p) outp(p,v)
#define outb(v,p) outp(p,v)
#define outw(v,p) outpw(p,v)
#define outl(v,p) outpd(p,v)
#define inb_p(p) inp(p)
#define inb(p) inp(p)
#define inw(p) inpw(p)
#define inl(p) inpd(p)
#define malloc(a) kern_alloc(a)
#define mark_bh(NET_BH) /* Don't use soft int emulation... */
#define cli() kern_cli()
#define sti() kern_sti()
#define save_flags(f) f = kern_fsave()
#define restore_flags(f) kern_frestore(f)
/* URKA Stubs */
extern void panic_stub(void);
/* #define eth_header panic_stub */
#define eth_rebuild_header panic_stub
#define eth_header_cache_bind panic_stub
#define eth_header_cache_update panic_stub
#define atomic_sub(a,b)
#define vremap(a,b) 0
extern __inline__ int suser(void)
{
return 1;
}
// spinlocks
#define spinlock_t DWORD
#define spin_lock(x) (void)(x)
#define spin_unlock(x) (void)(x)
#define spin_lock_irqsave(x,y) y = kern_fsave()
#define spin_unlock_irqrestore(x,y) kern_frestore(y)
#define spin_lock_init(x)
#define SPIN_LOCK_UNLOCKED (spinlock_t) 0
extern __inline__ void panic(const char *c)
{
cputs((char *)c);
sys_end();
}
/* below tuff added for rtl8139 net driver
at some point this stuff should moved in a more conevenient place.
*/
/* *** from linux-2.2.17/include/linux/compatmac.h */
#define capable(x) suser()
/* *** from linux-2.2.17/include/linux/capability.h */
#define CAP_NET_ADMIN 12
/* *** from linux-2.2.17/include/linux/byteorder/little_endian.h */
#define __le16_to_cpu(x) ((__u16)(x))
/* *** from linux-2.2.17/include/linux/byteorder/generic.h */
#define le16_to_cpu __le16_to_cpu
__END_DECLS
#endif