Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
513ad84b
K
Kernel
项目概览
openeuler
/
Kernel
大约 1 年 前同步成功
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
513ad84b
编写于
2月 21, 2008
作者:
I
Ingo Molnar
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
x86: de-macro start_thread()
Signed-off-by:
N
Ingo Molnar
<
mingo@elte.hu
>
上级
1180e01d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
33 addition
and
26 deletion
+33
-26
arch/x86/kernel/process_32.c
arch/x86/kernel/process_32.c
+15
-0
arch/x86/kernel/process_64.c
arch/x86/kernel/process_64.c
+15
-0
include/asm-x86/processor.h
include/asm-x86/processor.h
+3
-26
未找到文件。
arch/x86/kernel/process_32.c
浏览文件 @
513ad84b
...
...
@@ -512,6 +512,21 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
return
err
;
}
void
start_thread
(
struct
pt_regs
*
regs
,
unsigned
long
new_ip
,
unsigned
long
new_sp
)
{
__asm__
(
"movl %0, %%gs"
::
"r"
(
0
));
regs
->
fs
=
0
;
set_fs
(
USER_DS
);
regs
->
ds
=
__USER_DS
;
regs
->
es
=
__USER_DS
;
regs
->
ss
=
__USER_DS
;
regs
->
cs
=
__USER_CS
;
regs
->
ip
=
new_ip
;
regs
->
sp
=
new_sp
;
}
EXPORT_SYMBOL_GPL
(
start_thread
);
#ifdef CONFIG_SECCOMP
static
void
hard_disable_TSC
(
void
)
{
...
...
arch/x86/kernel/process_64.c
浏览文件 @
513ad84b
...
...
@@ -528,6 +528,21 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
return
err
;
}
void
start_thread
(
struct
pt_regs
*
regs
,
unsigned
long
new_ip
,
unsigned
long
new_sp
)
{
asm
volatile
(
"movl %0, %%fs; movl %0, %%es; movl %0, %%ds"
::
"r"
(
0
));
load_gs_index
(
0
);
regs
->
ip
=
new_ip
;
regs
->
sp
=
new_sp
;
write_pda
(
oldrsp
,
new_sp
);
regs
->
cs
=
__USER_CS
;
regs
->
ss
=
__USER_DS
;
regs
->
flags
=
0x200
;
set_fs
(
USER_DS
);
}
EXPORT_SYMBOL_GPL
(
start_thread
);
/*
* This special macro can be used to load a debugging register
*/
...
...
include/asm-x86/processor.h
浏览文件 @
513ad84b
...
...
@@ -817,20 +817,6 @@ static inline void spin_lock_prefetch(const void *x)
.io_bitmap = { [0 ... IO_BITMAP_LONGS] = ~0 }, \
}
#define start_thread(regs, new_eip, new_esp) \
do { \
__asm__("movl %0,%%gs": :"r" (0)); \
regs->fs = 0; \
set_fs(USER_DS); \
regs->ds = __USER_DS; \
regs->es = __USER_DS; \
regs->ss = __USER_DS; \
regs->cs = __USER_CS; \
regs->ip = new_eip; \
regs->sp = new_esp; \
} while (0)
extern
unsigned
long
thread_saved_pc
(
struct
task_struct
*
tsk
);
#define THREAD_SIZE_LONGS (THREAD_SIZE/sizeof(unsigned long))
...
...
@@ -887,18 +873,6 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk);
.x86_tss.sp0 = (unsigned long)&init_stack + sizeof(init_stack) \
}
#define start_thread(regs, new_rip, new_rsp) do { \
asm volatile("movl %0,%%fs; movl %0,%%es; movl %0,%%ds": :"r" (0)); \
load_gs_index(0); \
(regs)->ip = (new_rip); \
(regs)->sp = (new_rsp); \
write_pda(oldrsp, (new_rsp)); \
(regs)->cs = __USER_CS; \
(regs)->ss = __USER_DS; \
(regs)->flags = 0x200; \
set_fs(USER_DS); \
} while (0)
/*
* Return saved PC of a blocked thread.
* What is this good for? it will be always the scheduler or ret_from_fork.
...
...
@@ -909,6 +883,9 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk);
#define KSTK_ESP(tsk) -1
/* sorry. doesn't work for syscall. */
#endif
/* CONFIG_X86_64 */
extern
void
start_thread
(
struct
pt_regs
*
regs
,
unsigned
long
new_ip
,
unsigned
long
new_sp
);
/*
* This decides where the kernel will search for a free chunk of vm
* space during mmap's.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录