Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
82b3980b
Commit
82b3980b
authored
Oct 29, 2002
by
Pavel Machek
Committed by
Christoph Hellwig
Oct 29, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] swsusp updates
This uses better constraints that do not go through the register unneccessarily.
parent
24cc3559
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
40 deletions
+38
-40
arch/i386/kernel/suspend.c
arch/i386/kernel/suspend.c
+23
-25
include/asm-i386/suspend.h
include/asm-i386/suspend.h
+15
-15
No files found.
arch/i386/kernel/suspend.c
View file @
82b3980b
...
...
@@ -54,10 +54,10 @@ static inline void save_processor_context (void)
/*
* descriptor tables
*/
asm
volatile
(
"sgdt
(%0)
"
:
"=m"
(
saved_context
.
gdt_limit
));
asm
volatile
(
"sidt
(%0)
"
:
"=m"
(
saved_context
.
idt_limit
));
asm
volatile
(
"sldt
(%0)
"
:
"=m"
(
saved_context
.
ldt
));
asm
volatile
(
"str
(%0)
"
:
"=m"
(
saved_context
.
tr
));
asm
volatile
(
"sgdt
%0
"
:
"=m"
(
saved_context
.
gdt_limit
));
asm
volatile
(
"sidt
%0
"
:
"=m"
(
saved_context
.
idt_limit
));
asm
volatile
(
"sldt
%0
"
:
"=m"
(
saved_context
.
ldt
));
asm
volatile
(
"str
%0
"
:
"=m"
(
saved_context
.
tr
));
/*
* save the general registers.
...
...
@@ -67,22 +67,22 @@ static inline void save_processor_context (void)
* It's really not necessary, and kinda fishy (check the assembly output),
* so it's avoided.
*/
asm
volatile
(
"movl %%esp,
(%0)
"
:
"=m"
(
saved_context
.
esp
));
asm
volatile
(
"movl %%eax,
(%0)
"
:
"=m"
(
saved_context
.
eax
));
asm
volatile
(
"movl %%ebx,
(%0)
"
:
"=m"
(
saved_context
.
ebx
));
asm
volatile
(
"movl %%ecx,
(%0)
"
:
"=m"
(
saved_context
.
ecx
));
asm
volatile
(
"movl %%edx,
(%0)
"
:
"=m"
(
saved_context
.
edx
));
asm
volatile
(
"movl %%ebp,
(%0)
"
:
"=m"
(
saved_context
.
ebp
));
asm
volatile
(
"movl %%esi,
(%0)
"
:
"=m"
(
saved_context
.
esi
));
asm
volatile
(
"movl %%edi,
(%0)
"
:
"=m"
(
saved_context
.
edi
));
asm
volatile
(
"movl %%esp,
%0
"
:
"=m"
(
saved_context
.
esp
));
asm
volatile
(
"movl %%eax,
%0
"
:
"=m"
(
saved_context
.
eax
));
asm
volatile
(
"movl %%ebx,
%0
"
:
"=m"
(
saved_context
.
ebx
));
asm
volatile
(
"movl %%ecx,
%0
"
:
"=m"
(
saved_context
.
ecx
));
asm
volatile
(
"movl %%edx,
%0
"
:
"=m"
(
saved_context
.
edx
));
asm
volatile
(
"movl %%ebp,
%0
"
:
"=m"
(
saved_context
.
ebp
));
asm
volatile
(
"movl %%esi,
%0
"
:
"=m"
(
saved_context
.
esi
));
asm
volatile
(
"movl %%edi,
%0
"
:
"=m"
(
saved_context
.
edi
));
/* FIXME: Need to save XMM0..XMM15? */
/*
* segment registers
*/
asm
volatile
(
"movw %%es, %0"
:
"=
r
"
(
saved_context
.
es
));
asm
volatile
(
"movw %%fs, %0"
:
"=
r
"
(
saved_context
.
fs
));
asm
volatile
(
"movw %%gs, %0"
:
"=
r
"
(
saved_context
.
gs
));
asm
volatile
(
"movw %%ss, %0"
:
"=
r
"
(
saved_context
.
ss
));
asm
volatile
(
"movw %%es, %0"
:
"=
m
"
(
saved_context
.
es
));
asm
volatile
(
"movw %%fs, %0"
:
"=
m
"
(
saved_context
.
fs
));
asm
volatile
(
"movw %%gs, %0"
:
"=
m
"
(
saved_context
.
gs
));
asm
volatile
(
"movw %%ss, %0"
:
"=
m
"
(
saved_context
.
ss
));
/*
* control registers
...
...
@@ -95,7 +95,7 @@ static inline void save_processor_context (void)
/*
* eflags
*/
asm
volatile
(
"pushfl ; popl
(%0)
"
:
"=m"
(
saved_context
.
eflags
));
asm
volatile
(
"pushfl ; popl
%0
"
:
"=m"
(
saved_context
.
eflags
));
}
static
void
...
...
@@ -125,9 +125,7 @@ static inline void restore_processor_context (void)
/*
* first restore %ds, so we can access our data properly
*/
asm
volatile
(
".align 4"
);
asm
volatile
(
"movw %0, %%ds"
::
"r"
((
u16
)
__KERNEL_DS
));
asm
volatile
(
"movw %0, %%ds"
::
"r"
(
__KERNEL_DS
));
/*
* control registers
...
...
@@ -136,7 +134,7 @@ static inline void restore_processor_context (void)
asm
volatile
(
"movl %0, %%cr3"
::
"r"
(
saved_context
.
cr3
));
asm
volatile
(
"movl %0, %%cr2"
::
"r"
(
saved_context
.
cr2
));
asm
volatile
(
"movl %0, %%cr0"
::
"r"
(
saved_context
.
cr0
));
/*
* segment registers
*/
...
...
@@ -167,9 +165,9 @@ static inline void restore_processor_context (void)
* now restore the descriptor tables to their proper values
* ltr is done i fix_processor_context().
*/
asm
volatile
(
"lgdt
(%0)
"
::
"m"
(
saved_context
.
gdt_limit
));
asm
volatile
(
"lidt
(%0)
"
::
"m"
(
saved_context
.
idt_limit
));
asm
volatile
(
"lldt
(%0)
"
::
"m"
(
saved_context
.
ldt
));
asm
volatile
(
"lgdt
%0
"
::
"m"
(
saved_context
.
gdt_limit
));
asm
volatile
(
"lidt
%0
"
::
"m"
(
saved_context
.
idt_limit
));
asm
volatile
(
"lldt
%0
"
::
"m"
(
saved_context
.
ldt
));
fix_processor_context
();
...
...
include/asm-i386/suspend.h
View file @
82b3980b
...
...
@@ -15,22 +15,22 @@ arch_prepare_suspend(void)
/* image of the saved processor state */
struct
saved_context
{
u
32
eax
,
ebx
,
ecx
,
edx
;
u
32
esp
,
ebp
,
esi
,
edi
;
u16
es
,
fs
,
gs
,
ss
;
u
32
cr0
,
cr2
,
cr3
,
cr4
;
u
nsigned
long
eax
,
ebx
,
ecx
,
edx
;
u
nsigned
long
esp
,
ebp
,
esi
,
edi
;
u16
es
,
fs
,
gs
,
ss
;
u
nsigned
long
cr0
,
cr2
,
cr3
,
cr4
;
u16
gdt_pad
;
u16
gdt_limit
;
u
32
gdt_base
;
u
nsigned
long
gdt_base
;
u16
idt_pad
;
u16
idt_limit
;
u
32
idt_base
;
u
nsigned
long
idt_base
;
u16
ldt
;
u16
tss
;
u
32
tr
;
u
32
safety
;
u
32
return_address
;
u
32
eflags
;
u
nsigned
long
tr
;
u
nsigned
long
safety
;
u
nsigned
long
return_address
;
u
nsigned
long
eflags
;
}
__attribute__
((
packed
));
#define loaddebug(thread,register) \
...
...
@@ -52,11 +52,11 @@ extern unsigned long saved_edi;
static
inline
void
acpi_save_register_state
(
unsigned
long
return_point
)
{
saved_eip
=
return_point
;
asm
volatile
(
"movl %%esp,
(%0)
"
:
"=m"
(
saved_esp
));
asm
volatile
(
"movl %%ebp,
(%0)
"
:
"=m"
(
saved_ebp
));
asm
volatile
(
"movl %%ebx,
(%0)
"
:
"=m"
(
saved_ebx
));
asm
volatile
(
"movl %%edi,
(%0)
"
:
"=m"
(
saved_edi
));
asm
volatile
(
"movl %%esi,
(%0)
"
:
"=m"
(
saved_esi
));
asm
volatile
(
"movl %%esp,
%0
"
:
"=m"
(
saved_esp
));
asm
volatile
(
"movl %%ebp,
%0
"
:
"=m"
(
saved_ebp
));
asm
volatile
(
"movl %%ebx,
%0
"
:
"=m"
(
saved_ebx
));
asm
volatile
(
"movl %%edi,
%0
"
:
"=m"
(
saved_edi
));
asm
volatile
(
"movl %%esi,
%0
"
:
"=m"
(
saved_esi
));
}
#define acpi_restore_register_state() do {} while (0)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment