www.pudn.com > LFYOS.zip > os.h


#ifndef OS_KERNEL_LIBRARY 
#define OS_KERNEL_LIBRARY 
 
#include "../memory/memory.h" 
#include "platform.h" 
 
#define PARAMETER_POINTER	(0xc0000000) 
#define PHYSICAL_BLOCK_POINTER	(0xc0001000) 
 
#define get_kernel_parameter()				\ 
	((union system_call_parameter *)PARAMETER_POINTER) 
#define get_memory_parameter()				\ 
	((union memory_call_parameter *)PARAMETER_POINTER) 
#define get_file_system_parameter()			\ 
	((struct file_system_call_parameter *)PARAMETER_POINTER) 
 
#define get_thread_physical_block()	\ 
	((char *)PHYSICAL_BLOCK_POINTER) 
	 
static inline void call_kernel( 
	struct thread_environment *env) 
{ 
	extern void call_os_kernel(struct thread_environment *); 
	void  (*p)(struct thread_environment *); 
	p=call_os_kernel; 
	p(env); 
	return; 
}; 
 
static inline void call_memory( 
	struct thread_environment *env) 
{ 
	extern void call_memory_manager(struct thread_environment *); 
	void  (*p)(struct thread_environment *); 
	p=call_memory_manager; 
	p(env); 
	return; 
}; 
 
static inline int call_check_point(int *flag, 
	void (*fun)(void *),void *arg) 
{ 
	extern int check_point_routine( 
			int *flag,void (*fun)(void *),void *arg); 
	int (*p)(int *flag,void (*fun)(void *),void *arg); 
	p=check_point_routine; 
	return (p(flag,(void (*)(void *))fun,arg)); 
} 
 
#endif