Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 356166
b: refs/heads/master
c: 4cbeb51
h: refs/heads/master
v: v3
  • Loading branch information
Dave Hansen authored and H. Peter Anvin committed Jan 26, 2013
1 parent 732f86d commit fd8ff8a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a25b9316841c5afa226f8f70a457861b35276a92
refs/heads/master: 4cbeb51b860c57ba8b2ae50c4016ee7a41f5fbd5
14 changes: 14 additions & 0 deletions trunk/arch/x86/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ pte_t *populate_extra_pte(unsigned long vaddr);

#ifndef __ASSEMBLY__
#include <linux/mm_types.h>
#include <linux/log2.h>

static inline int pte_none(pte_t pte)
{
Expand Down Expand Up @@ -781,6 +782,19 @@ static inline void clone_pgd_range(pgd_t *dst, pgd_t *src, int count)
memcpy(dst, src, count * sizeof(pgd_t));
}

#define PTE_SHIFT ilog2(PTRS_PER_PTE)
static inline int page_level_shift(enum pg_level level)
{
return (PAGE_SHIFT - PTE_SHIFT) + level * PTE_SHIFT;
}
static inline unsigned long page_level_size(enum pg_level level)
{
return 1UL << page_level_shift(level);
}
static inline unsigned long page_level_mask(enum pg_level level)
{
return ~(page_level_size(level) - 1);
}

#include <asm-generic/pgtable.h>
#endif /* __ASSEMBLY__ */
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/include/asm/pgtable_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ extern void native_pagetable_init(void);
struct seq_file;
extern void arch_report_meminfo(struct seq_file *m);

enum {
enum pg_level {
PG_LEVEL_NONE,
PG_LEVEL_4K,
PG_LEVEL_2M,
Expand Down

0 comments on commit fd8ff8a

Please sign in to comment.