mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-15 09:36:42 +07:00
f15cbe6f1a
This follows the sparc changes a439fe51a1
.
Most of the moving about was done with Sam's directions at:
http://marc.info/?l=linux-sh&m=121724823706062&w=2
with subsequent hacking and fixups entirely my fault.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
48 lines
1003 B
C
48 lines
1003 B
C
#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 */
|