os.h
来自「虚拟地址空间基于文件的操作系统」· C头文件 代码 · 共 52 行
H
52 行
#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 + =
减小字号Ctrl + -
显示快捷键?