-
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: 77695 b: refs/heads/master c: cdcc970 h: refs/heads/master i: 77693: 1cc9d5f 77691: 74831c8 77687: ef16f83 77679: 9fb8f7a 77663: 4812d91 77631: 8d3c7ac 77567: 29a7615 v: v3
- Loading branch information
Paul Mundt
committed
Jan 28, 2008
1 parent
7c7eeaf
commit 010fc00
Showing
6 changed files
with
174 additions
and
272 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: 9085fa1255fc16bf0dbd217e9f4cdccf16f064d3 | ||
refs/heads/master: cdcc970829e81da3445346cb71b2ea264c9952b9 |
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,27 @@ | ||
#ifndef __ASM_SH_CPU_SH5_MMU_CONTEXT_H | ||
#define __ASM_SH_CPU_SH5_MMU_CONTEXT_H | ||
|
||
/* Common defines */ | ||
#define TLB_STEP 0x00000010 | ||
#define TLB_PTEH 0x00000000 | ||
#define TLB_PTEL 0x00000008 | ||
|
||
/* PTEH defines */ | ||
#define PTEH_ASID_SHIFT 2 | ||
#define PTEH_VALID 0x0000000000000001 | ||
#define PTEH_SHARED 0x0000000000000002 | ||
#define PTEH_MATCH_ASID 0x00000000000003ff | ||
|
||
#ifndef __ASSEMBLY__ | ||
/* This has to be a common function because the next location to fill | ||
* information is shared. */ | ||
extern void __do_tlb_refill(unsigned long address, unsigned long long is_text_not_data, pte_t *pte); | ||
|
||
/* Profiling counter. */ | ||
#ifdef CONFIG_SH64_PROC_TLB | ||
extern unsigned long long calls_to_do_fast_page_fault; | ||
#endif | ||
|
||
#endif /* __ASSEMBLY__ */ | ||
|
||
#endif /* __ASM_SH_CPU_SH5_MMU_CONTEXT_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,47 @@ | ||
#ifndef __ASM_SH_MMU_CONTEXT_32_H | ||
#define __ASM_SH_MMU_CONTEXT_32_H | ||
|
||
/* | ||
* Destroy context related info for an mm_struct that is about | ||
* to be put to rest. | ||
*/ | ||
static inline void destroy_context(struct mm_struct *mm) | ||
{ | ||
/* Do nothing */ | ||
} | ||
|
||
static inline void set_asid(unsigned long asid) | ||
{ | ||
unsigned long __dummy; | ||
|
||
__asm__ __volatile__ ("mov.l %2, %0\n\t" | ||
"and %3, %0\n\t" | ||
"or %1, %0\n\t" | ||
"mov.l %0, %2" | ||
: "=&r" (__dummy) | ||
: "r" (asid), "m" (__m(MMU_PTEH)), | ||
"r" (0xffffff00)); | ||
} | ||
|
||
static inline unsigned long get_asid(void) | ||
{ | ||
unsigned long asid; | ||
|
||
__asm__ __volatile__ ("mov.l %1, %0" | ||
: "=r" (asid) | ||
: "m" (__m(MMU_PTEH))); | ||
asid &= MMU_CONTEXT_ASID_MASK; | ||
return asid; | ||
} | ||
|
||
/* MMU_TTB is used for optimizing the fault handling. */ | ||
static inline void set_TTB(pgd_t *pgd) | ||
{ | ||
ctrl_outl((unsigned long)pgd, MMU_TTB); | ||
} | ||
|
||
static inline pgd_t *get_TTB(void) | ||
{ | ||
return (pgd_t *)ctrl_inl(MMU_TTB); | ||
} | ||
#endif /* __ASM_SH_MMU_CONTEXT_32_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
#ifndef __ASM_SH_MMU_CONTEXT_64_H | ||
#define __ASM_SH_MMU_CONTEXT_64_H | ||
|
||
/* | ||
* sh64-specific mmu_context interface. | ||
* | ||
* Copyright (C) 2000, 2001 Paolo Alberelli | ||
* Copyright (C) 2003 - 2007 Paul Mundt | ||
* | ||
* This file is subject to the terms and conditions of the GNU General Public | ||
* License. See the file "COPYING" in the main directory of this archive | ||
* for more details. | ||
*/ | ||
#include <asm/cpu/registers.h> | ||
#include <asm/cacheflush.h> | ||
|
||
#define SR_ASID_MASK 0xffffffffff00ffffULL | ||
#define SR_ASID_SHIFT 16 | ||
|
||
/* | ||
* Destroy context related info for an mm_struct that is about | ||
* to be put to rest. | ||
*/ | ||
static inline void destroy_context(struct mm_struct *mm) | ||
{ | ||
/* Well, at least free TLB entries */ | ||
flush_tlb_mm(mm); | ||
} | ||
|
||
static inline unsigned long get_asid(void) | ||
{ | ||
unsigned long long sr; | ||
|
||
asm volatile ("getcon " __SR ", %0\n\t" | ||
: "=r" (sr)); | ||
|
||
sr = (sr >> SR_ASID_SHIFT) & MMU_CONTEXT_ASID_MASK; | ||
return (unsigned long) sr; | ||
} | ||
|
||
/* Set ASID into SR */ | ||
static inline void set_asid(unsigned long asid) | ||
{ | ||
unsigned long long sr, pc; | ||
|
||
asm volatile ("getcon " __SR ", %0" : "=r" (sr)); | ||
|
||
sr = (sr & SR_ASID_MASK) | (asid << SR_ASID_SHIFT); | ||
|
||
/* | ||
* It is possible that this function may be inlined and so to avoid | ||
* the assembler reporting duplicate symbols we make use of the | ||
* gas trick of generating symbols using numerics and forward | ||
* reference. | ||
*/ | ||
asm volatile ("movi 1, %1\n\t" | ||
"shlli %1, 28, %1\n\t" | ||
"or %0, %1, %1\n\t" | ||
"putcon %1, " __SR "\n\t" | ||
"putcon %0, " __SSR "\n\t" | ||
"movi 1f, %1\n\t" | ||
"ori %1, 1 , %1\n\t" | ||
"putcon %1, " __SPC "\n\t" | ||
"rte\n" | ||
"1:\n\t" | ||
: "=r" (sr), "=r" (pc) : "0" (sr)); | ||
} | ||
|
||
/* No spare register to twiddle, so use a software cache */ | ||
extern pgd_t *mmu_pdtp_cache; | ||
|
||
#define set_TTB(pgd) (mmu_pdtp_cache = (pgd)) | ||
#define get_TTB() (mmu_pdtp_cache) | ||
|
||
#endif /* __ASM_SH_MMU_CONTEXT_64_H */ |
Oops, something went wrong.