aboutsummaryrefslogtreecommitdiffstats
path: root/arch/microblaze/include/asm/pgtable.h
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /arch/microblaze/include/asm/pgtable.h
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'arch/microblaze/include/asm/pgtable.h')
-rw-r--r--arch/microblaze/include/asm/pgtable.h49
1 files changed, 27 insertions, 22 deletions
diff --git a/arch/microblaze/include/asm/pgtable.h b/arch/microblaze/include/asm/pgtable.h
index ca2d92871545..b2af42311a12 100644
--- a/arch/microblaze/include/asm/pgtable.h
+++ b/arch/microblaze/include/asm/pgtable.h
@@ -57,6 +57,13 @@ static inline int pte_file(pte_t pte) { return 0; }
57 57
58#define pgprot_noncached_wc(prot) prot 58#define pgprot_noncached_wc(prot) prot
59 59
60/*
61 * All 32bit addresses are effectively valid for vmalloc...
62 * Sort of meaningless for non-VM targets.
63 */
64#define VMALLOC_START 0
65#define VMALLOC_END 0xffffffff
66
60#else /* CONFIG_MMU */ 67#else /* CONFIG_MMU */
61 68
62#include <asm-generic/4level-fixup.h> 69#include <asm-generic/4level-fixup.h>
@@ -404,20 +411,19 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
404static inline unsigned long pte_update(pte_t *p, unsigned long clr, 411static inline unsigned long pte_update(pte_t *p, unsigned long clr,
405 unsigned long set) 412 unsigned long set)
406{ 413{
407 unsigned long old, tmp, msr; 414 unsigned long flags, old, tmp;
408 415
409 __asm__ __volatile__("\ 416 raw_local_irq_save(flags);
410 msrclr %2, 0x2\n\ 417
411 nop\n\ 418 __asm__ __volatile__( "lw %0, %2, r0 \n"
412 lw %0, %4, r0\n\ 419 "andn %1, %0, %3 \n"
413 andn %1, %0, %5\n\ 420 "or %1, %1, %4 \n"
414 or %1, %1, %6\n\ 421 "sw %1, %2, r0 \n"
415 sw %1, %4, r0\n\ 422 : "=&r" (old), "=&r" (tmp)
416 mts rmsr, %2\n\ 423 : "r" ((unsigned long)(p + 1) - 4), "r" (clr), "r" (set)
417 nop" 424 : "cc");
418 : "=&r" (old), "=&r" (tmp), "=&r" (msr), "=m" (*p) 425
419 : "r" ((unsigned long)(p + 1) - 4), "r" (clr), "r" (set), "m" (*p) 426 raw_local_irq_restore(flags);
420 : "cc");
421 427
422 return old; 428 return old;
423} 429}
@@ -437,8 +443,9 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
437 *ptep = pte; 443 *ptep = pte;
438} 444}
439 445
440static inline int ptep_test_and_clear_young(struct mm_struct *mm, 446#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
441 unsigned long addr, pte_t *ptep) 447static inline int ptep_test_and_clear_young(struct vm_area_struct *vma,
448 unsigned long address, pte_t *ptep)
442{ 449{
443 return (pte_update(ptep, _PAGE_ACCESSED, 0) & _PAGE_ACCESSED) != 0; 450 return (pte_update(ptep, _PAGE_ACCESSED, 0) & _PAGE_ACCESSED) != 0;
444} 451}
@@ -450,6 +457,7 @@ static inline int ptep_test_and_clear_dirty(struct mm_struct *mm,
450 (_PAGE_DIRTY | _PAGE_HWWRITE), 0) & _PAGE_DIRTY) != 0; 457 (_PAGE_DIRTY | _PAGE_HWWRITE), 0) & _PAGE_DIRTY) != 0;
451} 458}
452 459
460#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
453static inline pte_t ptep_get_and_clear(struct mm_struct *mm, 461static inline pte_t ptep_get_and_clear(struct mm_struct *mm,
454 unsigned long addr, pte_t *ptep) 462 unsigned long addr, pte_t *ptep)
455{ 463{
@@ -497,12 +505,9 @@ static inline pmd_t *pmd_offset(pgd_t *dir, unsigned long address)
497#define pte_offset_kernel(dir, addr) \ 505#define pte_offset_kernel(dir, addr) \
498 ((pte_t *) pmd_page_kernel(*(dir)) + pte_index(addr)) 506 ((pte_t *) pmd_page_kernel(*(dir)) + pte_index(addr))
499#define pte_offset_map(dir, addr) \ 507#define pte_offset_map(dir, addr) \
500 ((pte_t *) kmap_atomic(pmd_page(*(dir)), KM_PTE0) + pte_index(addr)) 508 ((pte_t *) kmap_atomic(pmd_page(*(dir))) + pte_index(addr))
501#define pte_offset_map_nested(dir, addr) \
502 ((pte_t *) kmap_atomic(pmd_page(*(dir)), KM_PTE1) + pte_index(addr))
503 509
504#define pte_unmap(pte) kunmap_atomic(pte, KM_PTE0) 510#define pte_unmap(pte) kunmap_atomic(pte)
505#define pte_unmap_nested(pte) kunmap_atomic(pte, KM_PTE1)
506 511
507/* Encode and decode a nonlinear file mapping entry */ 512/* Encode and decode a nonlinear file mapping entry */
508#define PTE_FILE_MAX_BITS 29 513#define PTE_FILE_MAX_BITS 29
@@ -567,7 +572,7 @@ void __init *early_get_page(void);
567 572
568extern unsigned long ioremap_bot, ioremap_base; 573extern unsigned long ioremap_bot, ioremap_base;
569 574
570void *consistent_alloc(int gfp, size_t size, dma_addr_t *dma_handle); 575void *consistent_alloc(gfp_t gfp, size_t size, dma_addr_t *dma_handle);
571void consistent_free(size_t size, void *vaddr); 576void consistent_free(size_t size, void *vaddr);
572void consistent_sync(void *vaddr, size_t size, int direction); 577void consistent_sync(void *vaddr, size_t size, int direction);
573void consistent_sync_page(struct page *page, unsigned long offset, 578void consistent_sync_page(struct page *page, unsigned long offset,