Commit eaab417f authored by Gao Chen's avatar Gao Chen Committed by guzitao
Browse files

sw64: add the missed clear_flush()

Sunway inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/IB73UR



--------------------------------

This patch adds clear_flush() back, which was deleted by mistake.

Signed-off-by: default avatarGao Chen <gaochen@wxiat.com>
Reviewed-by: default avatarHe Sheng <hesheng@wxiat.com>
Signed-off-by: default avatarGu Zitao <guzitao@wxiat.com>
parent 7e923d1a
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -88,6 +88,19 @@ static pte_t get_and_clear(struct mm_struct *mm,
	return orig_pte;
}

static void clear_flush(struct mm_struct *mm, unsigned long addr,
			pte_t *ptep, unsigned long pgsize,
			unsigned long ncontig)
{
	struct vm_area_struct vma = TLB_FLUSH_VMA(mm, 0);
	unsigned long i, saddr = addr;

	for (i = 0; i < ncontig; i++, addr += pgsize, ptep++)
		pte_clear(mm, addr, ptep);

	flush_tlb_range(&vma, saddr, addr);
}

static pte_t get_clear_contig_flush(struct mm_struct *mm, unsigned long addr,
			pte_t *ptep, unsigned long pgsize,
			unsigned long ncontig)