Ejemplo n.º 1
0
int __init sysenter_setup(void)
{
	char *vdso32_start, *vdso32_end;
	int npages, i;

#ifdef CONFIG_COMPAT
	if (vdso32_syscall()) {
		vdso32_start = vdso32_syscall_start;
		vdso32_end = vdso32_syscall_end;
		vdso32_pages = vdso32_syscall_pages;
	} else
#endif
	if (vdso32_sysenter()) {
		vdso32_start = vdso32_sysenter_start;
		vdso32_end = vdso32_sysenter_end;
		vdso32_pages = vdso32_sysenter_pages;
	} else {
		vdso32_start = vdso32_int80_start;
		vdso32_end = vdso32_int80_end;
		vdso32_pages = vdso32_int80_pages;
	}

	npages = ((vdso32_end - vdso32_start) + PAGE_SIZE - 1) / PAGE_SIZE;
	vdso32_size = npages << PAGE_SHIFT;
	for (i = 0; i < npages; i++)
		vdso32_pages[i] = virt_to_page(vdso32_start + i*PAGE_SIZE);

	patch_vdso32(vdso32_start, vdso32_size);

	return 0;
}
Ejemplo n.º 2
0
int __init sysenter_setup(void)
{
    void *syscall_page = (void *)get_zeroed_page(GFP_ATOMIC);
    const void *vsyscall;
    size_t vsyscall_len;

    vdso32_pages[0] = virt_to_page(syscall_page);

#ifdef CONFIG_X86_32
    gate_vma_init();
#endif

    if (vdso32_syscall()) {
        vsyscall = &vdso32_syscall_start;
        vsyscall_len = &vdso32_syscall_end - &vdso32_syscall_start;
    } else if (vdso32_sysenter()) {
        vsyscall = &vdso32_sysenter_start;
        vsyscall_len = &vdso32_sysenter_end - &vdso32_sysenter_start;
    } else {
        vsyscall = &vdso32_int80_start;
        vsyscall_len = &vdso32_int80_end - &vdso32_int80_start;
    }

    memcpy(syscall_page, vsyscall, vsyscall_len);
    relocate_vdso(syscall_page);

    return 0;
}
Ejemplo n.º 3
0
int __init sysenter_setup(void)
{
#ifdef CONFIG_COMPAT
	if (vdso32_syscall())
		selected_vdso32 = &vdso_image_32_syscall;
	else
#endif
	if (vdso32_sysenter())
		selected_vdso32 = &vdso_image_32_sysenter;
	else
		selected_vdso32 = &vdso_image_32_int80;

	init_vdso_image(selected_vdso32);

	return 0;
}