📄 env.h
字号:
/* See COPYRIGHT for copyright information. */#ifndef JOS_INC_ENV_H#define JOS_INC_ENV_H#include <inc/types.h>#include <inc/queue.h>#include <inc/trap.h>#include <inc/memlayout.h>typedef int32_t envid_t;// An environment ID 'envid_t' has three parts://// +1+---------------21-----------------+--------10--------+// |0| Uniqueifier | Environment |// | | | Index |// +------------------------------------+------------------+// \--- ENVX(eid) --///// The environment index ENVX(eid) equals the environment's offset in the// 'envs[]' array. The uniqueifier distinguishes environments that were// created at different times, but share the same environment index.//// All real environments are greater than 0 (so the sign bit is zero).// envid_ts less than 0 signify errors. The envid_t == 0 is special, and// stands for the current environment.#define LOG2NENV 10#define NENV (1 << LOG2NENV)#define ENVX(envid) ((envid) & (NENV - 1))// Values of env_status in struct Env#define ENV_FREE 0#define ENV_RUNNABLE 1#define ENV_NOT_RUNNABLE 2struct Env { struct Trapframe env_tf; // Saved registers LIST_ENTRY(Env) env_link; // Free list link pointers envid_t env_id; // Unique environment identifier envid_t env_parent_id; // env_id of this env's parent unsigned env_status; // Status of the environment uint32_t env_runs; // Number of times environment has run // Address space pde_t *env_pgdir; // Kernel virtual address of page dir physaddr_t env_cr3; // Physical address of page dir};#endif // !JOS_INC_ENV_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -