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

📄 os.h

📁 国内一位牛人自己开发的操作系统
💻 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

⌨️ 快捷键说明

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