tlb.h 1.6 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

struct mmu_gather;
S
Stephen Rothwell 已提交
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45

#define tlb_start_vma(tlb, vma)	do { } while (0)
#define tlb_end_vma(tlb, vma)	do { } while (0)

#if !defined(CONFIG_PPC_STD_MMU)

#define tlb_flush(tlb)			flush_tlb_mm((tlb)->mm)

#elif defined(__powerpc64__)

extern void pte_free_finish(void);

static inline void tlb_flush(struct mmu_gather *tlb)
{
	pte_free_finish();
}

#else

L
Linus Torvalds 已提交
46 47
extern void tlb_flush(struct mmu_gather *tlb);

S
Stephen Rothwell 已提交
48 49
#endif

L
Linus Torvalds 已提交
50 51 52
/* Get the generic bits... */
#include <asm-generic/tlb.h>

S
Stephen Rothwell 已提交
53 54 55
#if !defined(CONFIG_PPC_STD_MMU) || defined(__powerpc64__)

#define __tlb_remove_tlb_entry(tlb, pte, address) do { } while (0)
L
Linus Torvalds 已提交
56

S
Stephen Rothwell 已提交
57
#else
L
Linus Torvalds 已提交
58 59 60 61 62 63 64 65 66 67
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,
					unsigned long address)
{
	if (pte_val(*ptep) & _PAGE_HASHPTE)
		flush_hash_entry(tlb->mm, ptep, address);
}

S
Stephen Rothwell 已提交
68
#endif
69
#endif /* __KERNEL__ */
S
Stephen Rothwell 已提交
70
#endif /* __ASM_POWERPC_TLB_H */