⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 compatib.h

📁 这是一个符合posix.13 pse51的实时内核
💻 H
字号:
#include <mem.h>
#include <vm.h>

#ifndef __UNIXCOMP__
#define __UNIXCOMP__

#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 __u32 unsigned long int
#define u32 unsigned long int
#define s32 signed long int
#define u_long unsigned long int
#define __u16 unsigned short int
#define u16 unsigned short int
#define u_short unsigned short int
#define ushort unsigned short int
#define u_char unsigned char
#define u8 unsigned char

#define atomic_t int

#ifndef NULL
	#define NULL 0
#endif

#define jiffies sys_ticks()	/* 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 VM_printf
#define check_region(a,b) 0
#define request_region(a,b,c)

/* Linux funcs emulation... */
#define outb_p(v,p) VM_out(p,v)
#define outb(v,p) VM_out(p,v)
#define outw(v,p) VM_outw(p,v)
#define outl(v,p) VM_outd(p,v)
#define inb_p(p) VM_in(p)
#define inb(p) VM_in(p)
#define inw(p) VM_inw(p)
#define inl(p) VM_ind(p)
#define malloc(a) VM_alloc(a)

#define mark_bh(NET_BH) 		/* Don't use soft int emulation... */


#define cli() VM_disable()
#define sti() VM_enable()
#define save_flags(f) f = VM_save()
#define restore_flags(f) VM_restore(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

/*	Errors		*/

#define	EIO		 5	/* I/O error */
#define	ENXIO		 6	/* No such device or address */
#define	EAGAIN		11	/* Try again */
#define	ENOMEM		12	/* Out of memory */
#define	EBUSY		16	/* Device or resource busy */
#define	ENODEV		19	/* No such device */
#define	EINVAL		22	/* Invalid argument */

#define atomic_sub(a,b)


#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -