tlb.h 1.5 KB
Newer Older
L
Linus Torvalds 已提交
1
/*
S
Stephen Rothwell 已提交
2
 *	TLB shootdown specifics for powerpc
L
Linus Torvalds 已提交
3
 *
S
Stephen Rothwell 已提交
4
 * Copyright (C) 2002 Anton Blanchard, IBM Corp.
L
Linus Torvalds 已提交
5 6 7 8 9 10 11
 * Copyright (C) 2002 Paul Mackerras, IBM Corp.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version
 * 2 of the License, or (at your option) any later version.
 */
S
Stephen Rothwell 已提交
12 13
#ifndef _ASM_POWERPC_TLB_H
#define _ASM_POWERPC_TLB_H
14
#ifdef __KERNEL__
L
Linus Torvalds 已提交
15

S
Stephen Rothwell 已提交
16
#ifndef __powerpc64__
L
Linus Torvalds 已提交
17
#include <asm/pgtable.h>
S
Stephen Rothwell 已提交
18
#endif
L
Linus Torvalds 已提交
19 20
#include <asm/pgalloc.h>
#include <asm/tlbflush.h>
S
Stephen Rothwell 已提交
21
#ifndef __powerpc64__
L
Linus Torvalds 已提交
22 23
#include <asm/page.h>
#include <asm/mmu.h>
S
Stephen Rothwell 已提交
24
#endif
L
Linus Torvalds 已提交
25

26 27
#include <linux/pagemap.h>

S
Stephen Rothwell 已提交
28 29
#define tlb_start_vma(tlb, vma)	do { } while (0)
#define tlb_end_vma(tlb, vma)	do { } while (0)
30
#define __tlb_remove_tlb_entry	__tlb_remove_tlb_entry
S
Stephen Rothwell 已提交
31

L
Linus Torvalds 已提交
32 33 34 35 36 37 38 39 40
extern void tlb_flush(struct mmu_gather *tlb);

/* Get the generic bits... */
#include <asm-generic/tlb.h>

extern void flush_hash_entry(struct mm_struct *mm, pte_t *ptep,
			     unsigned long address);

static inline void __tlb_remove_tlb_entry(struct mmu_gather *tlb, pte_t *ptep,
41
					  unsigned long address)
L
Linus Torvalds 已提交
42
{
43
#ifdef CONFIG_PPC_STD_MMU_32
L
Linus Torvalds 已提交
44 45
	if (pte_val(*ptep) & _PAGE_HASHPTE)
		flush_hash_entry(tlb->mm, ptep, address);
46
#endif
L
Linus Torvalds 已提交
47 48
}

49 50 51 52 53 54 55 56 57 58 59 60 61
#ifdef CONFIG_SMP
static inline int mm_is_core_local(struct mm_struct *mm)
{
	return cpumask_subset(mm_cpumask(mm),
			      topology_sibling_cpumask(smp_processor_id()));
}
#else
static inline int mm_is_core_local(struct mm_struct *mm)
{
	return 1;
}
#endif

62
#endif /* __KERNEL__ */
S
Stephen Rothwell 已提交
63
#endif /* __ASM_POWERPC_TLB_H */