Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
76c882f1
提交
76c882f1
12月 24, 2011
创建
作者:
Silas Boyd-Wickizer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Change initnet to create a worker thread to do the initialization.
lwIP can't run (or be initialized) until the kernel creates the scheduler thread, so create a worker thread that inits lwIP.
上级
e1c40af9
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
27 行增加
和
6 行删除
+27
-6
net.c
net.c
+27
-6
没有找到文件。
net.c
浏览文件 @
76c882f1
#include "types.h"
#include "kernel.h"
#ifdef LWIP
#include "lwip/tcpip.h"
#endif
#include "types.h"
#include "kernel.h"
#include "queue.h"
#include "proc.h"
static
u8
ping_packet
[]
=
{
0x52
,
0x55
,
0x0a
,
0x00
,
0x02
,
0x02
,
0x52
,
0x54
,
0x00
,
0x12
,
0x34
,
0x56
,
0x08
,
0x00
,
0x45
,
0x00
,
0x00
,
0x54
,
0x00
,
0x00
,
...
...
@@ -56,14 +58,33 @@ int errno;
static
void
tcpip_init_done
(
void
*
arg
)
{
cprintf
(
"tcpip_init_done: %lx
\n
"
,
arg
);
volatile
long
*
tcpip_done
=
arg
;
*
tcpip_done
=
1
;
}
void
initnet_worker
(
void
*
x
)
{
volatile
long
tcpip_done
=
0
;
tcpip_init
(
&
tcpip_init_done
,
(
void
*
)
&
tcpip_done
);
while
(
!
tcpip_done
)
yield
();
}
void
initnet
(
void
)
{
tcpip_init
(
&
tcpip_init_done
,
NULL
);
cprintf
(
"initnet:
\n
"
);
struct
proc
*
t
;
t
=
threadalloc
(
initnet_worker
,
NULL
);
if
(
t
==
NULL
)
panic
(
"initnet: threadalloc"
);
acquire
(
&
t
->
lock
);
t
->
state
=
RUNNABLE
;
addrun
(
t
);
release
(
&
t
->
lock
);
}
#else
void
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论