Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
deca9fef
提交
deca9fef
10月 15, 2008
创建
作者:
kolya
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
indent
上级
c100d9ee
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
19 行增加
和
19 行删除
+19
-19
proc.h
proc.h
+19
-19
没有找到文件。
proc.h
浏览文件 @
deca9fef
...
@@ -24,19 +24,19 @@ enum proc_state { UNUSED, EMBRYO, SLEEPING, RUNNABLE, RUNNING, ZOMBIE };
...
@@ -24,19 +24,19 @@ enum proc_state { UNUSED, EMBRYO, SLEEPING, RUNNABLE, RUNNING, ZOMBIE };
// Per-process state
// Per-process state
struct
proc
{
struct
proc
{
char
*
mem
;
// Start of process memory (kernel address)
char
*
mem
;
// Start of process memory (kernel address)
uint
sz
;
// Size of process memory (bytes)
uint
sz
;
// Size of process memory (bytes)
char
*
kstack
;
// Bottom of kernel stack for this process
char
*
kstack
;
// Bottom of kernel stack for this process
enum
proc_state
state
;
// Process state
enum
proc_state
state
;
// Process state
int
pid
;
// Process ID
int
pid
;
// Process ID
struct
proc
*
parent
;
// Parent process
struct
proc
*
parent
;
// Parent process
void
*
chan
;
// If non-zero, sleeping on chan
void
*
chan
;
// If non-zero, sleeping on chan
int
killed
;
// If non-zero, have been killed
int
killed
;
// If non-zero, have been killed
struct
file
*
ofile
[
NOFILE
];
// Open files
struct
file
*
ofile
[
NOFILE
];
// Open files
struct
inode
*
cwd
;
// Current directory
struct
inode
*
cwd
;
// Current directory
struct
context
*
context
;
// Switch here to run process
struct
context
*
context
;
// Switch here to run process
struct
trapframe
*
tf
;
// Trap frame for current syscall
struct
trapframe
*
tf
;
// Trap frame for current syscall
char
name
[
16
];
// Process name (debugging)
char
name
[
16
];
// Process name (debugging)
};
};
// Process memory is laid out contiguously, low addresses first:
// Process memory is laid out contiguously, low addresses first:
...
@@ -47,14 +47,14 @@ struct proc {
...
@@ -47,14 +47,14 @@ struct proc {
// Per-CPU state
// Per-CPU state
struct
cpu
{
struct
cpu
{
uchar
apicid
;
// Local APIC ID
uchar
apicid
;
// Local APIC ID
struct
proc
*
curproc
;
// Process currently running.
struct
proc
*
curproc
;
// Process currently running.
struct
context
*
context
;
// Switch here to enter scheduler
struct
context
*
context
;
// Switch here to enter scheduler
struct
taskstate
ts
;
// Used by x86 to find stack for interrupt
struct
taskstate
ts
;
// Used by x86 to find stack for interrupt
struct
segdesc
gdt
[
NSEGS
];
// x86 global descriptor table
struct
segdesc
gdt
[
NSEGS
];
// x86 global descriptor table
volatile
uint
booted
;
// Has the CPU started?
volatile
uint
booted
;
// Has the CPU started?
int
ncli
;
// Depth of pushcli nesting.
int
ncli
;
// Depth of pushcli nesting.
int
intena
;
// Were interrupts enabled before pushcli?
int
intena
;
// Were interrupts enabled before pushcli?
};
};
extern
struct
cpu
cpus
[
NCPU
];
extern
struct
cpu
cpus
[
NCPU
];
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论