-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean up the espfix code: - Introduced PER_CPU() macro to be used from asm - Introduced GET_DESC_BASE() macro to be used from asm - Rewrote the fixup code in asm, as calling a C code with the altered %ss appeared to be unsafe - No longer altering the stack from a .fixup section - 16bit per-cpu stack is no longer used, instead the stack segment base is patched the way so that the high word of the kernel and user %esp are the same. - Added the limit-patching for the espfix segment. (Chuck Ebbert) [jeremy@goop.org: use the x86 scaling addressing mode rather than shifting] Signed-off-by: Stas Sergeev <stsp@aknet.ru> Signed-off-by: Andi Kleen <ak@suse.de> Acked-by: Zachary Amsden <zach@vmware.com> Acked-by: Chuck Ebbert <76306.1226@compuserve.com> Acked-by: Jan Beulich <jbeulich@novell.com> Cc: Andi Kleen <ak@muc.de> Signed-off-by: Jeremy Fitzhardinge <jeremy@goop.org> Signed-off-by: Andrew Morton <akpm@osdl.org>
- Loading branch information
Stas Sergeev
authored and
Andi Kleen
committed
Dec 7, 2006
1 parent
bb81a09
commit be44d2a
Showing
7 changed files
with
103 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,31 @@ | ||
#ifndef __ARCH_I386_PERCPU__ | ||
#define __ARCH_I386_PERCPU__ | ||
|
||
#ifndef __ASSEMBLY__ | ||
#include <asm-generic/percpu.h> | ||
#else | ||
|
||
/* | ||
* PER_CPU finds an address of a per-cpu variable. | ||
* | ||
* Args: | ||
* var - variable name | ||
* cpu - 32bit register containing the current CPU number | ||
* | ||
* The resulting address is stored in the "cpu" argument. | ||
* | ||
* Example: | ||
* PER_CPU(cpu_gdt_descr, %ebx) | ||
*/ | ||
#ifdef CONFIG_SMP | ||
#define PER_CPU(var, cpu) \ | ||
movl __per_cpu_offset(,cpu,4), cpu; \ | ||
addl $per_cpu__/**/var, cpu; | ||
#else /* ! SMP */ | ||
#define PER_CPU(var, cpu) \ | ||
movl $per_cpu__/**/var, cpu; | ||
#endif /* SMP */ | ||
|
||
#endif /* !__ASSEMBLY__ */ | ||
|
||
#endif /* __ARCH_I386_PERCPU__ */ |