-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 181035 b: refs/heads/master c: 5d9b4b1 h: refs/heads/master i: 181033: d201123 181031: a807968 v: v3
- Loading branch information
Matt Fleming
authored and
Paul Mundt
committed
Dec 17, 2009
1 parent
5088dd4
commit 8712ac5
Showing
8 changed files
with
135 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: b73c806341cfc7492ede6a2ce713cb579547d0ab | ||
refs/heads/master: 5d9b4b19f118abfb75e352841f7bf74580d7e427 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#ifndef __ASM_SH_PGALLOC_PMD_H | ||
#define __ASM_SH_PGALLOC_PMD_H | ||
|
||
static inline pgd_t *pgd_alloc(struct mm_struct *mm) | ||
{ | ||
pgd_t *pgd; | ||
int i; | ||
|
||
pgd = kzalloc(sizeof(*pgd) * PTRS_PER_PGD, GFP_KERNEL | __GFP_REPEAT); | ||
|
||
for (i = USER_PTRS_PER_PGD; i < PTRS_PER_PGD; i++) | ||
pgd[i] = swapper_pg_dir[i]; | ||
|
||
return pgd; | ||
} | ||
|
||
static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) | ||
{ | ||
kfree(pgd); | ||
} | ||
|
||
static inline void __check_pgt_cache(void) | ||
{ | ||
} | ||
|
||
static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd) | ||
{ | ||
set_pud(pud, __pud((unsigned long)pmd)); | ||
} | ||
|
||
static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) | ||
{ | ||
return quicklist_alloc(QUICK_PT, GFP_KERNEL | __GFP_REPEAT, NULL); | ||
} | ||
|
||
static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) | ||
{ | ||
quicklist_free(QUICK_PT, NULL, pmd); | ||
} | ||
|
||
#endif /* __ASM_SH_PGALLOC_PMD_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#ifndef __ASM_SH_PGTABLE_PMD_H | ||
#define __ASM_SH_PGTABLE_PMD_H | ||
|
||
#include <asm-generic/pgtable-nopud.h> | ||
|
||
/* | ||
* Some cores need a 3-level page table layout, for example when using | ||
* 64-bit PTEs and 4K pages. | ||
*/ | ||
|
||
#define PTE_MAGNITUDE 3 /* 64-bit PTEs on extended mode SH-X2 TLB */ | ||
|
||
/* PGD bits */ | ||
#define PGDIR_SHIFT 30 | ||
|
||
#define PTRS_PER_PGD 4 | ||
#define USER_PTRS_PER_PGD 2 | ||
|
||
/* PMD bits */ | ||
#define PMD_SHIFT (PAGE_SHIFT + (PAGE_SHIFT - 3)) | ||
#define PMD_SIZE (1UL << PMD_SHIFT) | ||
#define PMD_MASK (~(PMD_SIZE-1)) | ||
|
||
#define PTRS_PER_PMD (PAGE_SIZE / sizeof(pmd_t)) | ||
|
||
#define pmd_ERROR(e) \ | ||
printk("%s:%d: bad pmd %016llx.\n", __FILE__, __LINE__, pmd_val(e)) | ||
|
||
typedef struct { unsigned long long pmd; } pmd_t; | ||
#define pmd_val(x) ((x).pmd) | ||
#define __pmd(x) ((pmd_t) { (x) } ) | ||
|
||
static inline unsigned long pud_page_vaddr(pud_t pud) | ||
{ | ||
return pud_val(pud); | ||
} | ||
|
||
#define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1)) | ||
static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address) | ||
{ | ||
return (pmd_t *)pud_page_vaddr(*pud) + pmd_index(address); | ||
} | ||
|
||
#define pud_none(x) (!pud_val(x)) | ||
#define pud_present(x) (pud_val(x)) | ||
#define pud_clear(xp) do { set_pud(xp, __pud(0)); } while (0) | ||
#define pud_bad(x) (pud_val(x) & ~PAGE_MASK) | ||
|
||
/* | ||
* (puds are folded into pgds so this doesn't get actually called, | ||
* but the define is needed for a generic inline function.) | ||
*/ | ||
#define set_pud(pudptr, pudval) do { *(pudptr) = (pudval); } while(0) | ||
|
||
#endif /* __ASM_SH_PGTABLE_PMD_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters