Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
a1716d50
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
a1716d50
编写于
7月 05, 2008
作者:
I
Ingo Molnar
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'x86/s2ram-fix' into x86/urgent
上级
64e83b5a
4b4f7280
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
59 addition
and
5 deletion
+59
-5
arch/x86/kernel/acpi/realmode/wakeup.S
arch/x86/kernel/acpi/realmode/wakeup.S
+37
-1
arch/x86/kernel/acpi/realmode/wakeup.h
arch/x86/kernel/acpi/realmode/wakeup.h
+5
-0
arch/x86/kernel/acpi/sleep.c
arch/x86/kernel/acpi/sleep.c
+15
-1
drivers/acpi/sleep/main.c
drivers/acpi/sleep/main.c
+2
-3
未找到文件。
arch/x86/kernel/acpi/realmode/wakeup.S
浏览文件 @
a1716d50
...
...
@@ -5,6 +5,7 @@
#include <asm/msr-index.h>
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/processor-flags.h>
.
code16
.
section
".header"
,
"a"
...
...
@@ -24,6 +25,11 @@ pmode_gdt: .quad 0
realmode_flags
:
.
long
0
real_magic
:
.
long
0
trampoline_segment
:
.
word
0
_pad1
:
.
byte
0
wakeup_jmp
:
.
byte
0xea
/*
ljmpw
*/
wakeup_jmp_off
:
.
word
3
f
wakeup_jmp_seg
:
.
word
0
wakeup_gdt
:
.
quad
0
,
0
,
0
signature
:
.
long
0x51ee1111
.
text
...
...
@@ -34,11 +40,34 @@ _start:
cli
cld
/
*
Apparently
some
dimwit
BIOS
programmers
don
't know how to
program
a
PM
to
RM
transition
,
and
we
might
end
up
here
with
junk
in
the
data
segment
descriptor
registers
.
The
only
way
to
repair
that
is
to
go
into
PM
and
fix
it
ourselves
...
*/
movw
$
16
,
%
cx
lgdtl
%
cs
:
wakeup_gdt
movl
%
cr0
,
%
eax
orb
$X86_CR0_PE
,
%
al
movl
%
eax
,
%
cr0
jmp
1
f
1
:
ljmpw
$
8
,
$
2
f
2
:
movw
%
cx
,
%
ds
movw
%
cx
,
%
es
movw
%
cx
,
%
ss
movw
%
cx
,
%
fs
movw
%
cx
,
%
gs
andb
$~
X86_CR0_PE
,
%
al
movl
%
eax
,
%
cr0
jmp
wakeup_jmp
3
:
/
*
Set
up
segments
*/
movw
%
cs
,
%
ax
movw
%
ax
,
%
ds
movw
%
ax
,
%
es
movw
%
ax
,
%
ss
lidtl
wakeup_idt
movl
$wakeup_stack_end
,
%
esp
...
...
@@ -98,7 +127,14 @@ bogus_real_magic:
jmp
1
b
.
data
.
balign
4
.
balign
8
/
*
This
is
the
standard
real
-
mode
IDT
*/
wakeup_idt
:
.
word
0xffff
/*
limit
*/
.
long
0
/*
address
*/
.
word
0
.
globl
HEAP
,
heap_end
HEAP
:
.
long
wakeup_heap
...
...
arch/x86/kernel/acpi/realmode/wakeup.h
浏览文件 @
a1716d50
...
...
@@ -24,6 +24,11 @@ struct wakeup_header {
u32
realmode_flags
;
u32
real_magic
;
u16
trampoline_segment
;
/* segment with trampoline code, 64-bit only */
u8
_pad1
;
u8
wakeup_jmp
;
u16
wakeup_jmp_off
;
u16
wakeup_jmp_seg
;
u64
wakeup_gdt
[
3
];
u32
signature
;
/* To check we have correct structure */
}
__attribute__
((
__packed__
));
...
...
arch/x86/kernel/acpi/sleep.c
浏览文件 @
a1716d50
...
...
@@ -50,6 +50,20 @@ int acpi_save_state_mem(void)
header
->
video_mode
=
saved_video_mode
;
header
->
wakeup_jmp_seg
=
acpi_wakeup_address
>>
4
;
/* GDT[0]: GDT self-pointer */
header
->
wakeup_gdt
[
0
]
=
(
u64
)(
sizeof
(
header
->
wakeup_gdt
)
-
1
)
+
((
u64
)(
acpi_wakeup_address
+
((
char
*
)
&
header
->
wakeup_gdt
-
(
char
*
)
acpi_realmode
))
<<
16
);
/* GDT[1]: real-mode-like code segment */
header
->
wakeup_gdt
[
1
]
=
(
0x009bULL
<<
40
)
+
((
u64
)
acpi_wakeup_address
<<
16
)
+
0xffff
;
/* GDT[2]: real-mode-like data segment */
header
->
wakeup_gdt
[
2
]
=
(
0x0093ULL
<<
40
)
+
((
u64
)
acpi_wakeup_address
<<
16
)
+
0xffff
;
#ifndef CONFIG_64BIT
store_gdt
((
struct
desc_ptr
*
)
&
header
->
pmode_gdt
);
...
...
@@ -111,7 +125,7 @@ void __init acpi_reserve_bootmem(void)
return
;
}
acpi_wakeup_address
=
acpi_realmode
;
acpi_wakeup_address
=
virt_to_phys
((
void
*
)
acpi_realmode
)
;
}
...
...
drivers/acpi/sleep/main.c
浏览文件 @
a1716d50
...
...
@@ -36,9 +36,8 @@ static int acpi_sleep_prepare(u32 acpi_state)
if
(
!
acpi_wakeup_address
)
{
return
-
EFAULT
;
}
acpi_set_firmware_waking_vector
((
acpi_physical_address
)
virt_to_phys
((
void
*
)
acpi_wakeup_address
));
acpi_set_firmware_waking_vector
(
(
acpi_physical_address
)
acpi_wakeup_address
);
}
ACPI_FLUSH_CPU_CACHE
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录