Impact: cleanup

Unify and demacro pud_index.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
This commit is contained in:
Jeremy Fitzhardinge 2009-02-05 11:30:57 -08:00
Родитель 777cba16aa
Коммит 7cfb81024b
2 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -500,6 +500,12 @@ static inline struct page *pgd_page(pgd_t pgd)
{ {
return pfn_to_page(pgd_val(pgd) >> PAGE_SHIFT); return pfn_to_page(pgd_val(pgd) >> PAGE_SHIFT);
} }
/* to find an entry in a page-table-directory. */
static inline unsigned pud_index(unsigned long address)
{
return (address >> PUD_SHIFT) & (PTRS_PER_PUD - 1);
}
#endif /* PAGETABLE_LEVELS > 3 */ #endif /* PAGETABLE_LEVELS > 3 */
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */

Просмотреть файл

@ -183,8 +183,6 @@ static inline int pgd_large(pgd_t pgd) { return 0; }
#define mk_kernel_pgd(address) __pgd((address) | _KERNPG_TABLE) #define mk_kernel_pgd(address) __pgd((address) | _KERNPG_TABLE)
/* PUD - Level3 access */ /* PUD - Level3 access */
/* to find an entry in a page-table-directory. */
#define pud_index(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD - 1))
#define pud_offset(pgd, address) \ #define pud_offset(pgd, address) \
((pud_t *)pgd_page_vaddr(*(pgd)) + pud_index((address))) ((pud_t *)pgd_page_vaddr(*(pgd)) + pud_index((address)))