Release 4.14 arch/mn10300/include/asm/tlbflush.h
/* MN10300 TLB flushing functions
*
* Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
* Written by David Howells (dhowells@redhat.com)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public Licence
* as published by the Free Software Foundation; either version
* 2 of the Licence, or (at your option) any later version.
*/
#ifndef _ASM_TLBFLUSH_H
#define _ASM_TLBFLUSH_H
#include <linux/mm.h>
#include <asm/processor.h>
struct tlb_state {
struct mm_struct *active_mm;
int state;
};
DECLARE_PER_CPU_SHARED_ALIGNED(struct tlb_state, cpu_tlbstate);
/**
* local_flush_tlb - Flush the current MM's entries from the local CPU's TLBs
*/
static inline void local_flush_tlb(void)
{
int w;
asm volatile(
" mov %1,%0 \n"
" or %2,%0 \n"
" mov %0,%1 \n"
: "=d"(w)
: "m"(MMUCTR), "i"(MMUCTR_IIV|MMUCTR_DIV)
: "cc", "memory");
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
David Howells | 15 | 100.00% | 1 | 100.00% |
Total | 15 | 100.00% | 1 | 100.00% |
/**
* local_flush_tlb_all - Flush all entries from the local CPU's TLBs
*/
static inline void local_flush_tlb_all(void)
{
local_flush_tlb();
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Akira Takeuchi | 11 | 91.67% | 1 | 50.00% |
David Howells | 1 | 8.33% | 1 | 50.00% |
Total | 12 | 100.00% | 2 | 100.00% |
/**
* local_flush_tlb_one - Flush one entry from the local CPU's TLBs
*/
static inline void local_flush_tlb_one(unsigned long addr)
{
local_flush_tlb();
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Akira Takeuchi | 10 | 71.43% | 1 | 33.33% |
David Howells | 4 | 28.57% | 2 | 66.67% |
Total | 14 | 100.00% | 3 | 100.00% |
/**
* local_flush_tlb_page - Flush a page's entry from the local CPU's TLBs
* @mm: The MM to flush for
* @addr: The address of the target page in RAM (not its page struct)
*/
static inline
void local_flush_tlb_page(struct mm_struct *mm, unsigned long addr)
{
unsigned long pteu, flags, cnx;
addr &= PAGE_MASK;
local_irq_save(flags);
cnx = 1;
#ifdef CONFIG_MN10300_TLB_USE_PIDR
cnx = mm->context.tlbpid[smp_processor_id()];
#endif
if (cnx) {
pteu = addr;
#ifdef CONFIG_MN10300_TLB_USE_PIDR
pteu |= cnx & xPTEU_PID;
#endif
IPTEU = pteu;
DPTEU = pteu;
if (IPTEL & xPTEL_V)
IPTEL = 0;
if (DPTEL & xPTEL_V)
DPTEL = 0;
}
local_irq_restore(flags);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Akira Takeuchi | 96 | 88.89% | 1 | 50.00% |
David Howells | 12 | 11.11% | 1 | 50.00% |
Total | 108 | 100.00% | 2 | 100.00% |
/*
* TLB flushing:
*
* - flush_tlb() flushes the current mm struct TLBs
* - flush_tlb_all() flushes all processes TLBs
* - flush_tlb_mm(mm) flushes the specified mm context TLB's
* - flush_tlb_page(vma, vmaddr) flushes one page
* - flush_tlb_range(mm, start, end) flushes a range of pages
* - flush_tlb_pgtables(mm, start, end) flushes a range of page tables
*/
#ifdef CONFIG_SMP
#include <asm/smp.h>
extern void flush_tlb_all(void);
extern void flush_tlb_current_task(void);
extern void flush_tlb_mm(struct mm_struct *);
extern void flush_tlb_page(struct vm_area_struct *, unsigned long);
#define flush_tlb() flush_tlb_current_task()
static inline void flush_tlb_range(struct vm_area_struct *vma,
unsigned long start, unsigned long end)
{
flush_tlb_mm(vma->vm_mm);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Akira Takeuchi | 26 | 96.30% | 1 | 50.00% |
David Howells | 1 | 3.70% | 1 | 50.00% |
Total | 27 | 100.00% | 2 | 100.00% |
#else /* CONFIG_SMP */
static inline void flush_tlb_all(void)
{
preempt_disable();
local_flush_tlb_all();
preempt_enable();
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Akira Takeuchi | 17 | 94.44% | 1 | 50.00% |
David Howells | 1 | 5.56% | 1 | 50.00% |
Total | 18 | 100.00% | 2 | 100.00% |
static inline void flush_tlb_mm(struct mm_struct *mm)
{
preempt_disable();
local_flush_tlb_all();
preempt_enable();
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Akira Takeuchi | 19 | 90.48% | 1 | 50.00% |
David Howells | 2 | 9.52% | 1 | 50.00% |
Total | 21 | 100.00% | 2 | 100.00% |
static inline void flush_tlb_range(struct vm_area_struct *vma,
unsigned long start, unsigned long end)
{
preempt_disable();
local_flush_tlb_all();
preempt_enable();
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Akira Takeuchi | 21 | 72.41% | 1 | 50.00% |
David Howells | 8 | 27.59% | 1 | 50.00% |
Total | 29 | 100.00% | 2 | 100.00% |
#define flush_tlb_page(vma, addr) local_flush_tlb_page((vma)->vm_mm, addr)
#define flush_tlb() flush_tlb_all()
#endif /* CONFIG_SMP */
static inline void flush_tlb_kernel_range(unsigned long start,
unsigned long end)
{
flush_tlb_all();
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Akira Takeuchi | 12 | 66.67% | 1 | 50.00% |
David Howells | 6 | 33.33% | 1 | 50.00% |
Total | 18 | 100.00% | 2 | 100.00% |
static inline void flush_tlb_pgtables(struct mm_struct *mm,
unsigned long start, unsigned long end)
{
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Akira Takeuchi | 11 | 57.89% | 1 | 50.00% |
David Howells | 8 | 42.11% | 1 | 50.00% |
Total | 19 | 100.00% | 2 | 100.00% |
#endif /* _ASM_TLBFLUSH_H */
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Akira Takeuchi | 296 | 76.09% | 2 | 50.00% |
David Howells | 93 | 23.91% | 2 | 50.00% |
Total | 389 | 100.00% | 4 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.