Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 42584
b: refs/heads/master
c: 21440cf
h: refs/heads/master
v: v3
  • Loading branch information
Paul Mundt committed Dec 6, 2006
1 parent adb0c8c commit 747b1b6
Show file tree
Hide file tree
Showing 9 changed files with 377 additions and 162 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: b552c7e8bceae8a04ae79ecee6fa369c1ba4f8e4
refs/heads/master: 21440cf04a64cd1b1209c12a6e1a3afba2a28709
49 changes: 47 additions & 2 deletions trunk/arch/sh/mm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,22 @@ config MEMORY_SIZE

config 32BIT
bool "Support 32-bit physical addressing through PMB"
depends on CPU_SH4A && MMU
depends on CPU_SH4A && MMU && (!X2TLB || BROKEN)
default y
help
If you say Y here, physical addressing will be extended to
32-bits through the SH-4A PMB. If this is not set, legacy
29-bit physical addressing will be used.

config X2TLB
bool "Enable extended TLB mode"
depends on CPU_SUBTYPE_SH7785 && MMU && EXPERIMENTAL
help
Selecting this option will enable the extended mode of the SH-X2
TLB. For legacy SH-X behaviour and interoperability, say N. For
all of the fun new features and a willingless to submit bug reports,
say Y.

config VSYSCALL
bool "Support vsyscall page"
depends on MMU
Expand All @@ -255,17 +264,53 @@ config VSYSCALL
For systems with an MMU that can afford to give up a page,
(the default value) say Y.

choice
prompt "Kernel page size"
default PAGE_SIZE_4KB

config PAGE_SIZE_4KB
bool "4kB"
help
This is the default page size used by all SuperH CPUs.

config PAGE_SIZE_8KB
bool "8kB"
depends on EXPERIMENTAL && X2TLB
help
This enables 8kB pages as supported by SH-X2 and later MMUs.

config PAGE_SIZE_64KB
bool "64kB"
depends on EXPERIMENTAL && CPU_SH4
help
This enables support for 64kB pages, possible on all SH-4
CPUs and later. Highly experimental, not recommended.

endchoice

choice
prompt "HugeTLB page size"
depends on HUGETLB_PAGE && CPU_SH4 && MMU
default HUGETLB_PAGE_SIZE_64K

config HUGETLB_PAGE_SIZE_64K
bool "64K"
bool "64kB"

config HUGETLB_PAGE_SIZE_256K
bool "256kB"
depends on X2TLB

config HUGETLB_PAGE_SIZE_1MB
bool "1MB"

config HUGETLB_PAGE_SIZE_4MB
bool "4MB"
depends on X2TLB

config HUGETLB_PAGE_SIZE_64MB
bool "64MB"
depends on X2TLB

endchoice

source "mm/Kconfig"
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/sh/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ static void set_pte_phys(unsigned long addr, unsigned long phys, pgprot_t prot)
pud = pud_offset(pgd, addr);
if (pud_none(*pud)) {
pmd = (pmd_t *)get_zeroed_page(GFP_ATOMIC);
set_pud(pud, __pud(__pa(pmd) | _KERNPG_TABLE | _PAGE_USER));
set_pud(pud, __pud(__pa(pmd) | _PAGE_TABLE));
if (pmd != pmd_offset(pud, 0)) {
pud_ERROR(*pud);
return;
Expand All @@ -103,7 +103,7 @@ static void set_pte_phys(unsigned long addr, unsigned long phys, pgprot_t prot)
pmd = pmd_offset(pud, addr);
if (pmd_none(*pmd)) {
pte = (pte_t *)get_zeroed_page(GFP_ATOMIC);
set_pmd(pmd, __pmd(__pa(pte) | _KERNPG_TABLE | _PAGE_USER));
set_pmd(pmd, __pmd(__pa(pte) | _PAGE_TABLE));
if (pte != pte_offset_kernel(pmd, 0)) {
pmd_ERROR(*pmd);
return;
Expand Down
4 changes: 1 addition & 3 deletions trunk/arch/sh/mm/ioremap.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ static inline void remap_area_pte(pte_t * pte, unsigned long address,
{
unsigned long end;
unsigned long pfn;
pgprot_t pgprot = __pgprot(_PAGE_PRESENT | _PAGE_RW |
_PAGE_DIRTY | _PAGE_ACCESSED |
_PAGE_HW_SHARED | _PAGE_FLAGS_HARD | flags);
pgprot_t pgprot = __pgprot(pgprot_val(PAGE_KERNEL_NOCACHE) | flags);

address &= ~PMD_MASK;
end = address + size;
Expand Down
12 changes: 2 additions & 10 deletions trunk/arch/sh/mm/pg-sh4.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ void clear_user_page(void *to, unsigned long address, struct page *page)
if (((address ^ (unsigned long)to) & CACHE_ALIAS) == 0)
clear_page(to);
else {
pgprot_t pgprot = __pgprot(_PAGE_PRESENT |
_PAGE_RW | _PAGE_CACHABLE |
_PAGE_DIRTY | _PAGE_ACCESSED |
_PAGE_HW_SHARED | _PAGE_FLAGS_HARD);
unsigned long phys_addr = PHYSADDR(to);
unsigned long p3_addr = P3SEG + (address & CACHE_ALIAS);
pgd_t *pgd = pgd_offset_k(p3_addr);
Expand All @@ -50,7 +46,7 @@ void clear_user_page(void *to, unsigned long address, struct page *page)
pte_t entry;
unsigned long flags;

entry = pfn_pte(phys_addr >> PAGE_SHIFT, pgprot);
entry = pfn_pte(phys_addr >> PAGE_SHIFT, PAGE_KERNEL);
down(&p3map_sem[(address & CACHE_ALIAS)>>12]);
set_pte(pte, entry);
local_irq_save(flags);
Expand All @@ -77,10 +73,6 @@ void copy_user_page(void *to, void *from, unsigned long address,
if (((address ^ (unsigned long)to) & CACHE_ALIAS) == 0)
copy_page(to, from);
else {
pgprot_t pgprot = __pgprot(_PAGE_PRESENT |
_PAGE_RW | _PAGE_CACHABLE |
_PAGE_DIRTY | _PAGE_ACCESSED |
_PAGE_HW_SHARED | _PAGE_FLAGS_HARD);
unsigned long phys_addr = PHYSADDR(to);
unsigned long p3_addr = P3SEG + (address & CACHE_ALIAS);
pgd_t *pgd = pgd_offset_k(p3_addr);
Expand All @@ -90,7 +82,7 @@ void copy_user_page(void *to, void *from, unsigned long address,
pte_t entry;
unsigned long flags;

entry = pfn_pte(phys_addr >> PAGE_SHIFT, pgprot);
entry = pfn_pte(phys_addr >> PAGE_SHIFT, PAGE_KERNEL);
down(&p3map_sem[(address & CACHE_ALIAS)>>12]);
set_pte(pte, entry);
local_irq_save(flags);
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/asm-sh/elf.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ typedef struct user_fpu_struct elf_fpregset_t;
#define ELF_ARCH EM_SH

#define USE_ELF_CORE_DUMP
#define ELF_EXEC_PAGESIZE 4096
#define ELF_EXEC_PAGESIZE PAGE_SIZE

/* This is the location that an ET_DYN program is loaded if exec'ed. Typical
use of this is to invoke "./ld.so someprog" to test out a new version of
Expand Down
35 changes: 29 additions & 6 deletions trunk/include/asm-sh/page.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,16 @@
[ P4 control ] 0xE0000000
*/


/* PAGE_SHIFT determines the page size */
#define PAGE_SHIFT 12
#if defined(CONFIG_PAGE_SIZE_4KB)
# define PAGE_SHIFT 12
#elif defined(CONFIG_PAGE_SIZE_8KB)
# define PAGE_SHIFT 13
#elif defined(CONFIG_PAGE_SIZE_64KB)
# define PAGE_SHIFT 16
#else
# error "Bogus kernel page size?"
#endif

#ifdef __ASSEMBLY__
#define PAGE_SIZE (1 << PAGE_SHIFT)
Expand All @@ -28,8 +35,14 @@

#if defined(CONFIG_HUGETLB_PAGE_SIZE_64K)
#define HPAGE_SHIFT 16
#elif defined(CONFIG_HUGETLB_PAGE_SIZE_256K)
#define HPAGE_SHIFT 18
#elif defined(CONFIG_HUGETLB_PAGE_SIZE_1MB)
#define HPAGE_SHIFT 20
#elif defined(CONFIG_HUGETLB_PAGE_SIZE_4MB)
#define HPAGE_SHIFT 22
#elif defined(CONFIG_HUGETLB_PAGE_SIZE_64MB)
#define HPAGE_SHIFT 26
#endif

#ifdef CONFIG_HUGETLB_PAGE
Expand Down Expand Up @@ -69,15 +82,25 @@ extern void __copy_user_page(void *to, void *from, void *orig_to);
/*
* These are used to make use of C type-checking..
*/
typedef struct { unsigned long pte; } pte_t;
typedef struct { unsigned long pgd; } pgd_t;
#ifdef CONFIG_X2TLB
typedef struct { unsigned long pte_low, pte_high; } pte_t;
typedef struct { unsigned long long pgprot; } pgprot_t;
#define pte_val(x) \
((x).pte_low | ((unsigned long long)(x).pte_high << 32))
#define __pte(x) \
({ pte_t __pte = {(x), ((unsigned long long)(x)) >> 32}; __pte; })
#else
typedef struct { unsigned long pte_low; } pte_t;
typedef struct { unsigned long pgprot; } pgprot_t;
#define pte_val(x) ((x).pte_low)
#define __pte(x) ((pte_t) { (x) } )
#endif

typedef struct { unsigned long pgd; } pgd_t;

#define pte_val(x) ((x).pte)
#define pgd_val(x) ((x).pgd)
#define pgprot_val(x) ((x).pgprot)

#define __pte(x) ((pte_t) { (x) } )
#define __pgd(x) ((pgd_t) { (x) } )
#define __pgprot(x) ((pgprot_t) { (x) } )

Expand Down
70 changes: 0 additions & 70 deletions trunk/include/asm-sh/pgtable-2level.h

This file was deleted.

Loading

0 comments on commit 747b1b6

Please sign in to comment.