コード例 #1
0
ファイル: espfix_64.c プロジェクト: zunaid321/ThunderStrike
void __init init_espfix_bsp(void)
{
	pgd_t *pgd_p;
	pteval_t ptemask;
	ptemask = __supported_pte_mask;
	/* Install the espfix pud into the kernel page directory */
	pgd_p = &init_level4_pgt[pgd_index(ESPFIX_BASE_ADDR)];
	pgd_populate(&init_mm, pgd_p, (pud_t *)espfix_pud_page);
	/* Randomize the locations */
	init_espfix_random();
	/* The rest is the same as for any other processor */
	init_espfix_ap();
}
コード例 #2
0
void __init init_espfix_bsp(void)
{
	pgd_t *pgd_p;
	pud_t *pud_p;
	unsigned long index = pgd_index(ESPFIX_BASE_ADDR);

	/* Install the espfix pud into the kernel page directory */
	pgd_p = &init_level4_pgt[index];
	pud_p = espfix_pud_page;
	paravirt_alloc_pud(&init_mm, __pa(pud_p) >> PAGE_SHIFT);
	set_pgd(pgd_p, __pgd(PGTABLE_PROT | __pa(pud_p)));

#ifdef CONFIG_PAX_PER_CPU_PGD
	clone_pgd_range(get_cpu_pgd(0, kernel) + index, swapper_pg_dir + index, 1);
	clone_pgd_range(get_cpu_pgd(0, user) + index, swapper_pg_dir + index, 1);
#endif

	/* Randomize the locations */
	init_espfix_random();

	/* The rest is the same as for any other processor */
	init_espfix_ap(0);
}