ia64/xen-unstable

view xen/include/asm-ia64/flushtlb.h @ 13479:1faf482f119c

[IA64] Register NEW_TLBFLUSH_CLOCK_PERIOD_SOFTIRQ

NEW_TLBFLUSH_CLOCK_PERIOD_SOFTIRQ is used but not registered.
I've never experienced but system will panic in the very long run.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
author awilliam@xenbuild2.aw
date Fri Jan 26 14:19:37 2007 -0700 (2007-01-26)
parents fd79ca20d91a
children
line source
1 /******************************************************************************
2 * flushtlb.c
3 * based on x86 flushtlb.h
4 *
5 * Copyright (c) 2006 Isaku Yamahata <yamahata at valinux co jp>
6 * VA Linux Systems Japan K.K.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 */
24 #ifndef __ASM_FLUSHTLB_H__
25 #define __ASM_FLUSHTLB_H__
27 #ifdef CONFIG_XEN_IA64_TLBFLUSH_CLOCK
29 #include <xen/percpu.h>
31 extern volatile u32 tlbflush_clock;
32 #define tlbflush_current_time() tlbflush_clock
34 u32 tlbflush_clock_inc_and_return(void);
35 void new_tlbflush_clock_period(void);
37 static inline void
38 tlbflush_update_time(volatile u32* time, u32 timestamp)
39 {
40 /*
41 * this should be ld4.rel + st4.acq. but only have release semantcis.
42 * so this function can't be considered as memory barrier.
43 */
44 *time = timestamp;
45 }
47 /*
48 * taken from x86's NEED_FLUSH()
49 * obj_stamp: mTLB time stamp, per pcpu VHPT stamp, per vcpu VHPT stamp.
50 */
51 static inline int
52 NEED_FLUSH(u32 obj_stamp, u32 lastuse_stamp)
53 {
54 u32 curr_time = tlbflush_current_time();
55 /*
56 * Two cases:
57 * 1. During a wrap, the clock ticks over to 0 while CPUs catch up. For
58 * safety during this period, we force a flush if @curr_time == 0.
59 * 2. Otherwise, we look to see if @cpu_stamp <= @lastuse_stamp.
60 * To detect false positives because @cpu_stamp has wrapped, we
61 * also check @curr_time. If less than @lastuse_stamp we definitely
62 * wrapped, so there's no need for a flush (one is forced every wrap).
63 */
64 return ((curr_time == 0) ||
65 ((obj_stamp <= lastuse_stamp) && (lastuse_stamp <= curr_time)));
66 }
68 DECLARE_PER_CPU(volatile u32, tlbflush_time);
69 DECLARE_PER_CPU(volatile u32, vhpt_tlbflush_timestamp);
71 #else
73 #define tlbflush_current_time() (0)
74 #define tlbflush_clock_inc_and_return() (0)
75 #define tlbflush_update_time(time, timestamp) do {(void)timestamp;} while (0)
76 #define NEED_FLUSH(obj_stamp, lastuse_stamp) (1)
78 #endif /* CONFIG_XEN_IA64_TLBFLUSH_CLOCK */
80 #endif /* __ASM_FLUSHTLB_H__ */
82 /*
83 * Local variables:
84 * mode: C
85 * c-set-style: "BSD"
86 * c-basic-offset: 4
87 * tab-width: 4
88 * indent-tabs-mode: nil
89 * End:
90 */