aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/include/asm
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2010-01-06 01:49:08 -0500
committerPaul Mundt <lethal@linux-sh.org>2010-01-06 01:49:08 -0500
commitfa94ddea2b29fdda7640672c8a933dbd901f0278 (patch)
tree4e9204f1438f5ed44bff31e2abee598ad775321d /arch/sh/include/asm
parent6fbfe8d7cd7e71ceb281c5a1b9de6e5e0dfbf1c8 (diff)
parent56d45b62ce622a003da972428fdbba2b42102efb (diff)
Merge branch 'master' into sh/hw-breakpoints
Diffstat (limited to 'arch/sh/include/asm')
-rw-r--r--arch/sh/include/asm/pgalloc.h12
-rw-r--r--arch/sh/include/asm/pgalloc_nopmd.h30
-rw-r--r--arch/sh/include/asm/pgalloc_pmd.h41
-rw-r--r--arch/sh/include/asm/pgtable.h4
-rw-r--r--arch/sh/include/asm/pgtable_64.h11
-rw-r--r--arch/sh/include/asm/pgtable_pmd.h4
-rw-r--r--arch/sh/include/asm/timex.h10
7 files changed, 21 insertions, 91 deletions
diff --git a/arch/sh/include/asm/pgalloc.h b/arch/sh/include/asm/pgalloc.h
index 4ea27855c3b5..f8982f4e0405 100644
--- a/arch/sh/include/asm/pgalloc.h
+++ b/arch/sh/include/asm/pgalloc.h
@@ -4,12 +4,15 @@
4#include <linux/quicklist.h> 4#include <linux/quicklist.h>
5#include <asm/page.h> 5#include <asm/page.h>
6 6
7#define QUICK_PT 1 /* Other page table pages that are zero on free */ 7#define QUICK_PT 0 /* Other page table pages that are zero on free */
8
9extern pgd_t *pgd_alloc(struct mm_struct *);
10extern void pgd_free(struct mm_struct *mm, pgd_t *pgd);
8 11
9#ifdef CONFIG_PGTABLE_LEVELS_3 12#ifdef CONFIG_PGTABLE_LEVELS_3
10#include <asm/pgalloc_pmd.h> 13extern void pud_populate(struct mm_struct *mm, pud_t *pudp, pmd_t *pmd);
11#else 14extern pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address);
12#include <asm/pgalloc_nopmd.h> 15extern void pmd_free(struct mm_struct *mm, pmd_t *pmd);
13#endif 16#endif
14 17
15static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, 18static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd,
@@ -67,7 +70,6 @@ do { \
67 70
68static inline void check_pgt_cache(void) 71static inline void check_pgt_cache(void)
69{ 72{
70 __check_pgt_cache();
71 quicklist_trim(QUICK_PT, NULL, 25, 16); 73 quicklist_trim(QUICK_PT, NULL, 25, 16);
72} 74}
73 75
diff --git a/arch/sh/include/asm/pgalloc_nopmd.h b/arch/sh/include/asm/pgalloc_nopmd.h
deleted file mode 100644
index e4b344c37e74..000000000000
--- a/arch/sh/include/asm/pgalloc_nopmd.h
+++ /dev/null
@@ -1,30 +0,0 @@
1#ifndef __ASM_SH_PGALLOC_NOPMD_H
2#define __ASM_SH_PGALLOC_NOPMD_H
3
4#define QUICK_PGD 0 /* We preserve special mappings over free */
5
6static inline void pgd_ctor(void *x)
7{
8 pgd_t *pgd = x;
9
10 memcpy(pgd + USER_PTRS_PER_PGD,
11 swapper_pg_dir + USER_PTRS_PER_PGD,
12 (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
13}
14
15static inline pgd_t *pgd_alloc(struct mm_struct *mm)
16{
17 return quicklist_alloc(QUICK_PGD, GFP_KERNEL | __GFP_REPEAT, pgd_ctor);
18}
19
20static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
21{
22 quicklist_free(QUICK_PGD, NULL, pgd);
23}
24
25static inline void __check_pgt_cache(void)
26{
27 quicklist_trim(QUICK_PGD, NULL, 25, 16);
28}
29
30#endif /* __ASM_SH_PGALLOC_NOPMD_H */
diff --git a/arch/sh/include/asm/pgalloc_pmd.h b/arch/sh/include/asm/pgalloc_pmd.h
deleted file mode 100644
index 20f75cc4eb09..000000000000
--- a/arch/sh/include/asm/pgalloc_pmd.h
+++ /dev/null
@@ -1,41 +0,0 @@
1#ifndef __ASM_SH_PGALLOC_PMD_H
2#define __ASM_SH_PGALLOC_PMD_H
3
4static inline pgd_t *pgd_alloc(struct mm_struct *mm)
5{
6 pgd_t *pgd;
7 int i;
8
9 pgd = kzalloc(sizeof(*pgd) * PTRS_PER_PGD, GFP_KERNEL | __GFP_REPEAT);
10
11 for (i = USER_PTRS_PER_PGD; i < PTRS_PER_PGD; i++)
12 pgd[i] = swapper_pg_dir[i];
13
14 return pgd;
15}
16
17static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
18{
19 kfree(pgd);
20}
21
22static inline void __check_pgt_cache(void)
23{
24}
25
26static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd)
27{
28 set_pud(pud, __pud((unsigned long)pmd));
29}
30
31static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
32{
33 return quicklist_alloc(QUICK_PT, GFP_KERNEL | __GFP_REPEAT, NULL);
34}
35
36static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
37{
38 quicklist_free(QUICK_PT, NULL, pmd);
39}
40
41#endif /* __ASM_SH_PGALLOC_PMD_H */
diff --git a/arch/sh/include/asm/pgtable.h b/arch/sh/include/asm/pgtable.h
index 9effcc3b0d10..78598ec33d0a 100644
--- a/arch/sh/include/asm/pgtable.h
+++ b/arch/sh/include/asm/pgtable.h
@@ -141,9 +141,9 @@ typedef pte_t *pte_addr_t;
141#define pte_pfn(x) ((unsigned long)(((x).pte_low >> PAGE_SHIFT))) 141#define pte_pfn(x) ((unsigned long)(((x).pte_low >> PAGE_SHIFT)))
142 142
143/* 143/*
144 * No page table caches to initialise 144 * Initialise the page table caches
145 */ 145 */
146#define pgtable_cache_init() do { } while (0) 146extern void pgtable_cache_init(void);
147 147
148struct vm_area_struct; 148struct vm_area_struct;
149 149
diff --git a/arch/sh/include/asm/pgtable_64.h b/arch/sh/include/asm/pgtable_64.h
index 17cdbecc3adc..dd381588c695 100644
--- a/arch/sh/include/asm/pgtable_64.h
+++ b/arch/sh/include/asm/pgtable_64.h
@@ -43,11 +43,6 @@ static __inline__ void set_pte(pte_t *pteptr, pte_t pteval)
43} 43}
44#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) 44#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
45 45
46static __inline__ void pmd_set(pmd_t *pmdp,pte_t *ptep)
47{
48 pmd_val(*pmdp) = (unsigned long) ptep;
49}
50
51/* 46/*
52 * PGD defines. Top level. 47 * PGD defines. Top level.
53 */ 48 */
@@ -203,12 +198,6 @@ static __inline__ void pmd_set(pmd_t *pmdp,pte_t *ptep)
203#define pgprot_writecombine(prot) __pgprot(pgprot_val(prot) & ~_PAGE_CACHABLE) 198#define pgprot_writecombine(prot) __pgprot(pgprot_val(prot) & ~_PAGE_CACHABLE)
204 199
205/* 200/*
206 * Handling allocation failures during page table setup.
207 */
208extern void __handle_bad_pmd_kernel(pmd_t * pmd);
209#define __handle_bad_pmd(x) __handle_bad_pmd_kernel(x)
210
211/*
212 * PTE level access routines. 201 * PTE level access routines.
213 * 202 *
214 * Note1: 203 * Note1:
diff --git a/arch/sh/include/asm/pgtable_pmd.h b/arch/sh/include/asm/pgtable_pmd.h
index 78dc36e1c2dd..42a180e534a8 100644
--- a/arch/sh/include/asm/pgtable_pmd.h
+++ b/arch/sh/include/asm/pgtable_pmd.h
@@ -17,11 +17,11 @@
17#define USER_PTRS_PER_PGD 2 17#define USER_PTRS_PER_PGD 2
18 18
19/* PMD bits */ 19/* PMD bits */
20#define PMD_SHIFT (PAGE_SHIFT + (PAGE_SHIFT - 3)) 20#define PMD_SHIFT (PAGE_SHIFT + (PAGE_SHIFT - PTE_MAGNITUDE))
21#define PMD_SIZE (1UL << PMD_SHIFT) 21#define PMD_SIZE (1UL << PMD_SHIFT)
22#define PMD_MASK (~(PMD_SIZE-1)) 22#define PMD_MASK (~(PMD_SIZE-1))
23 23
24#define PTRS_PER_PMD (PAGE_SIZE / sizeof(pmd_t)) 24#define PTRS_PER_PMD ((1 << PGDIR_SHIFT) / PMD_SIZE)
25 25
26#define pmd_ERROR(e) \ 26#define pmd_ERROR(e) \
27 printk("%s:%d: bad pmd %016llx.\n", __FILE__, __LINE__, pmd_val(e)) 27 printk("%s:%d: bad pmd %016llx.\n", __FILE__, __LINE__, pmd_val(e))
diff --git a/arch/sh/include/asm/timex.h b/arch/sh/include/asm/timex.h
index b556d49e5f2b..18bf06d9c764 100644
--- a/arch/sh/include/asm/timex.h
+++ b/arch/sh/include/asm/timex.h
@@ -6,7 +6,17 @@
6#ifndef __ASM_SH_TIMEX_H 6#ifndef __ASM_SH_TIMEX_H
7#define __ASM_SH_TIMEX_H 7#define __ASM_SH_TIMEX_H
8 8
9/*
10 * Only parts using the legacy CPG code for their clock framework
11 * implementation need to define their own Pclk value. If provided, this
12 * can be used for accurately setting CLOCK_TICK_RATE, otherwise we
13 * simply fall back on the i8253 PIT value.
14 */
15#ifdef CONFIG_SH_PCLK_FREQ
9#define CLOCK_TICK_RATE (CONFIG_SH_PCLK_FREQ / 4) /* Underlying HZ */ 16#define CLOCK_TICK_RATE (CONFIG_SH_PCLK_FREQ / 4) /* Underlying HZ */
17#else
18#define CLOCK_TICK_RATE 1193180
19#endif
10 20
11#include <asm-generic/timex.h> 21#include <asm-generic/timex.h>
12 22