diff options
author | Mihai Caraman <mihai.caraman@freescale.com> | 2014-04-17 09:41:09 (GMT) |
---|---|---|
committer | Jose Rivera <German.Rivera@freescale.com> | 2014-04-30 01:25:38 (GMT) |
commit | 5f3005e9f6cbd4d01597407aa8a7aa5a2f5a381c (patch) | |
tree | 0029236c8f95f4101b4b1ad40a72dc54800c0dcd /arch/powerpc/mm/hugetlbpage-book3e.c | |
parent | 993d07a27f10ad4a5d4847d964a6634674c4e2ee (diff) | |
download | linux-fsl-qoriq-5f3005e9f6cbd4d01597407aa8a7aa5a2f5a381c.tar.xz |
powerpc/booke3e: Move tlb lock/unlock functions
Move book3e_tlb_lock/unlock functions from hugetlbpages to mm to be
used from other kernel places.
Signed-off-by: Mihai Caraman <mihai.caraman@freescale.com>
(cherry picked and merged from sdk1.5 commit c84bbd80aebb40de4fcc7894759dfff8857d405c)
Change-Id: I89239824880e81c8257fe612cad903eebbb5adbe
Reviewed-on: http://git.am.freescale.net:8181/11559
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Stuart Yoder <stuart.yoder@freescale.com>
Reviewed-by: Jose Rivera <German.Rivera@freescale.com>
Diffstat (limited to 'arch/powerpc/mm/hugetlbpage-book3e.c')
-rw-r--r-- | arch/powerpc/mm/hugetlbpage-book3e.c | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/arch/powerpc/mm/hugetlbpage-book3e.c b/arch/powerpc/mm/hugetlbpage-book3e.c index 603ea93..dbe06fe 100644 --- a/arch/powerpc/mm/hugetlbpage-book3e.c +++ b/arch/powerpc/mm/hugetlbpage-book3e.c @@ -13,57 +13,6 @@ static inline int mmu_get_tsize(int psize) return mmu_psize_defs[psize].enc; } -#if defined(CONFIG_PPC_FSL_BOOK3E) && defined(CONFIG_PPC64) -#include <asm/paca.h> - -static inline void book3e_tlb_lock(void) -{ - struct paca_struct *paca = get_paca(); - struct tlb_per_core *percore; - unsigned long tmp; - - if (!(paca->tlb_per_core_ptr & 1)) - return; - - percore = (struct tlb_per_core *)(paca->tlb_per_core_ptr & ~1UL); - - asm volatile("1: lbarx %0, 0, %1;" - "cmpdi %0, 0;" - "bne 2f;" - "li %0, 1;" - "stbcx. %0, 0, %1;" - "bne 1b;" - "b 3f;" - "2: lbzx %0, 0, %1;" - "cmpdi %0, 0;" - "bne 2b;" - "b 1b;" - "3:" : "=&r" (tmp) : "r" (&percore->lock) : "memory"); -} - -static inline void book3e_tlb_unlock(void) -{ - struct paca_struct *paca = get_paca(); - struct tlb_per_core *percore; - - if (!(paca->tlb_per_core_ptr & 1)) - return; - - percore = (struct tlb_per_core *)(paca->tlb_per_core_ptr & ~1UL); - - isync(); - percore->lock = 0; -} -#else -static inline void book3e_tlb_lock(void) -{ -} - -static inline void book3e_tlb_unlock(void) -{ -} -#endif - #ifdef CONFIG_PPC_FSL_BOOK3E #ifdef CONFIG_PPC64 static inline int tlb1_next(void) |