x86: clean up arch/x86/ia32/syscall32.c
White space and coding style clenaup. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
Родитель
c202f298de
Коммит
6ec875666d
|
@ -1,8 +1,9 @@
|
||||||
/* Copyright 2002,2003 Andi Kleen, SuSE Labs */
|
/*
|
||||||
|
* Copyright 2002,2003 Andi Kleen, SuSE Labs
|
||||||
/* vsyscall handling for 32bit processes. Map a stub page into it
|
*
|
||||||
on demand because 32bit cannot reach the kernel's fixmaps */
|
* vsyscall handling for 32bit processes. Map a stub page into it on
|
||||||
|
* demand because 32bit cannot reach the kernel's fixmaps
|
||||||
|
*/
|
||||||
#include <linux/mm.h>
|
#include <linux/mm.h>
|
||||||
#include <linux/string.h>
|
#include <linux/string.h>
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
|
@ -50,31 +51,33 @@ int syscall32_setup_pages(struct linux_binprm *bprm, int exstack)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __init init_syscall32(void)
|
static int __init init_syscall32(void)
|
||||||
{
|
{
|
||||||
char *syscall32_page = (void *)get_zeroed_page(GFP_KERNEL);
|
char *syscall32_page = (void *)get_zeroed_page(GFP_KERNEL);
|
||||||
if (!syscall32_page)
|
|
||||||
panic("Cannot allocate syscall32 page");
|
if (!syscall32_page)
|
||||||
|
panic("Cannot allocate syscall32 page");
|
||||||
syscall32_pages[0] = virt_to_page(syscall32_page);
|
syscall32_pages[0] = virt_to_page(syscall32_page);
|
||||||
if (use_sysenter > 0) {
|
if (use_sysenter > 0) {
|
||||||
memcpy(syscall32_page, syscall32_sysenter,
|
memcpy(syscall32_page, syscall32_sysenter,
|
||||||
syscall32_sysenter_end - syscall32_sysenter);
|
syscall32_sysenter_end - syscall32_sysenter);
|
||||||
} else {
|
} else {
|
||||||
memcpy(syscall32_page, syscall32_syscall,
|
memcpy(syscall32_page, syscall32_syscall,
|
||||||
syscall32_syscall_end - syscall32_syscall);
|
syscall32_syscall_end - syscall32_syscall);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
__initcall(init_syscall32);
|
||||||
__initcall(init_syscall32);
|
|
||||||
|
|
||||||
/* May not be __init: called during resume */
|
/* May not be __init: called during resume */
|
||||||
void syscall32_cpu_init(void)
|
void syscall32_cpu_init(void)
|
||||||
{
|
{
|
||||||
if (use_sysenter < 0)
|
if (use_sysenter < 0)
|
||||||
use_sysenter = (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL);
|
use_sysenter = (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL);
|
||||||
|
|
||||||
/* Load these always in case some future AMD CPU supports
|
/*
|
||||||
SYSENTER from compat mode too. */
|
* Load these always in case some future AMD CPU supports
|
||||||
|
* SYSENTER from compat mode too.
|
||||||
|
*/
|
||||||
checking_wrmsrl(MSR_IA32_SYSENTER_CS, (u64)__KERNEL_CS);
|
checking_wrmsrl(MSR_IA32_SYSENTER_CS, (u64)__KERNEL_CS);
|
||||||
checking_wrmsrl(MSR_IA32_SYSENTER_ESP, 0ULL);
|
checking_wrmsrl(MSR_IA32_SYSENTER_ESP, 0ULL);
|
||||||
checking_wrmsrl(MSR_IA32_SYSENTER_EIP, (u64)ia32_sysenter_target);
|
checking_wrmsrl(MSR_IA32_SYSENTER_EIP, (u64)ia32_sysenter_target);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче