include/asm-generic/tlb.h
author Florian Westphal <fw@strlen.de>
Sun, 11 Jan 2009 20:20:11 +0100
changeset 0 aa628870c1d3
permissions -rw-r--r--
Port of Linux 2.6.28 for use with network simulation cradle.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
     1
/* include/asm-generic/tlb.h
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
     2
 *
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
     3
 *	Generic TLB shootdown code
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
     4
 *
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
     5
 * Copyright 2001 Red Hat, Inc.
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
     6
 * Based on code from mm/memory.c Copyright Linus Torvalds and others.
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
     7
 *
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
     8
 * This program is free software; you can redistribute it and/or
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
     9
 * modify it under the terms of the GNU General Public License
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    10
 * as published by the Free Software Foundation; either version
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    11
 * 2 of the License, or (at your option) any later version.
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    12
 */
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    13
#ifndef _ASM_GENERIC__TLB_H
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    14
#define _ASM_GENERIC__TLB_H
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    15
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    16
#include <linux/swap.h>
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    17
#include <asm/pgalloc.h>
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    18
#include <asm/tlbflush.h>
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    19
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    20
/*
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    21
 * For UP we don't need to worry about TLB flush
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    22
 * and page free order so much..
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    23
 */
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    24
#ifdef CONFIG_SMP
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    25
  #ifdef ARCH_FREE_PTR_NR
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    26
    #define FREE_PTR_NR   ARCH_FREE_PTR_NR
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    27
  #else
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    28
    #define FREE_PTE_NR	506
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    29
  #endif
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    30
  #define tlb_fast_mode(tlb) ((tlb)->nr == ~0U)
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    31
#else
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    32
  #define FREE_PTE_NR	1
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    33
  #define tlb_fast_mode(tlb) 1
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    34
#endif
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    35
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    36
/* struct mmu_gather is an opaque type used by the mm code for passing around
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    37
 * any data needed by arch specific code for tlb_remove_page.
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    38
 */
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    39
struct mmu_gather {
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    40
	struct mm_struct	*mm;
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    41
	unsigned int		nr;	/* set to ~0U means fast mode */
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    42
	unsigned int		need_flush;/* Really unmapped some ptes? */
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    43
	unsigned int		fullmm; /* non-zero means full mm flush */
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    44
	struct page *		pages[FREE_PTE_NR];
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    45
};
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    46
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    47
/* Users of the generic TLB shootdown code must declare this storage space. */
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    48
DECLARE_PER_CPU(struct mmu_gather, mmu_gathers);
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    49
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    50
/* tlb_gather_mmu
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    51
 *	Return a pointer to an initialized struct mmu_gather.
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    52
 */
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    53
static inline struct mmu_gather *
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    54
tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush)
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    55
{
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    56
	struct mmu_gather *tlb = &get_cpu_var(mmu_gathers);
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    57
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    58
	tlb->mm = mm;
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    59
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    60
	/* Use fast mode if only one CPU is online */
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    61
	tlb->nr = num_online_cpus() > 1 ? 0U : ~0U;
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    62
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    63
	tlb->fullmm = full_mm_flush;
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    64
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    65
	return tlb;
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    66
}
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    67
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    68
static inline void
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    69
tlb_flush_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end)
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    70
{
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    71
	if (!tlb->need_flush)
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    72
		return;
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    73
	tlb->need_flush = 0;
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    74
	tlb_flush(tlb);
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    75
	if (!tlb_fast_mode(tlb)) {
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    76
		free_pages_and_swap_cache(tlb->pages, tlb->nr);
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    77
		tlb->nr = 0;
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    78
	}
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    79
}
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    80
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    81
/* tlb_finish_mmu
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    82
 *	Called at the end of the shootdown operation to free up any resources
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    83
 *	that were required.
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    84
 */
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    85
static inline void
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    86
tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end)
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    87
{
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    88
	tlb_flush_mmu(tlb, start, end);
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    89
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    90
	/* keep the page table cache within bounds */
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    91
	check_pgt_cache();
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    92
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    93
	put_cpu_var(mmu_gathers);
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    94
}
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    95
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    96
/* tlb_remove_page
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    97
 *	Must perform the equivalent to __free_pte(pte_get_and_clear(ptep)), while
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    98
 *	handling the additional races in SMP caused by other CPUs caching valid
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
    99
 *	mappings in their TLBs.
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   100
 */
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   101
static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page)
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   102
{
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   103
	tlb->need_flush = 1;
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   104
	if (tlb_fast_mode(tlb)) {
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   105
		free_page_and_swap_cache(page);
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   106
		return;
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   107
	}
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   108
	tlb->pages[tlb->nr++] = page;
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   109
	if (tlb->nr >= FREE_PTE_NR)
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   110
		tlb_flush_mmu(tlb, 0, 0);
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   111
}
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   112
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   113
/**
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   114
 * tlb_remove_tlb_entry - remember a pte unmapping for later tlb invalidation.
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   115
 *
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   116
 * Record the fact that pte's were really umapped in ->need_flush, so we can
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   117
 * later optimise away the tlb invalidate.   This helps when userspace is
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   118
 * unmapping already-unmapped pages, which happens quite a lot.
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   119
 */
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   120
#define tlb_remove_tlb_entry(tlb, ptep, address)		\
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   121
	do {							\
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   122
		tlb->need_flush = 1;				\
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   123
		__tlb_remove_tlb_entry(tlb, ptep, address);	\
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   124
	} while (0)
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   125
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   126
#define pte_free_tlb(tlb, ptep)					\
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   127
	do {							\
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   128
		tlb->need_flush = 1;				\
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   129
		__pte_free_tlb(tlb, ptep);			\
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   130
	} while (0)
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   131
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   132
#ifndef __ARCH_HAS_4LEVEL_HACK
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   133
#define pud_free_tlb(tlb, pudp)					\
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   134
	do {							\
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   135
		tlb->need_flush = 1;				\
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   136
		__pud_free_tlb(tlb, pudp);			\
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   137
	} while (0)
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   138
#endif
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   139
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   140
#define pmd_free_tlb(tlb, pmdp)					\
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   141
	do {							\
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   142
		tlb->need_flush = 1;				\
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   143
		__pmd_free_tlb(tlb, pmdp);			\
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   144
	} while (0)
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   145
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   146
#define tlb_migrate_finish(mm) do {} while (0)
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   147
aa628870c1d3 Port of Linux 2.6.28 for use with network simulation cradle.
Florian Westphal <fw@strlen.de>
parents:
diff changeset
   148
#endif /* _ASM_GENERIC__TLB_H */