ia64/xen-unstable

view xen/include/xen/prefetch.h @ 19800:78962f85c562

IOMMU: Add two generic functions to vendor neutral interface

Add 2 generic functions into the vendor neutral iommu interface, The
reason is that from changeset 19732, there is only one global flag
"iommu_enabled" that controls iommu enablement for both vtd and amd
systems, so we need different code paths for vtd and amd iommu systems
if this flag has been turned on. Also, the early checking of
"iommu_enabled" in iommu_setup() is removed to prevent iommu
functionalities from been disabled on amd systems.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Jun 19 08:41:50 2009 +0100 (2009-06-19)
parents 9f85adafc1e1
children
line source
1 /*
2 * Generic cache management functions. Everything is arch-specific,
3 * but this header exists to make sure the defines/functions can be
4 * used in a generic way.
5 *
6 * 2000-11-13 Arjan van de Ven <arjan@fenrus.demon.nl>
7 *
8 */
10 #ifndef _LINUX_PREFETCH_H
11 #define _LINUX_PREFETCH_H
13 #include <asm/processor.h>
14 #include <asm/cache.h>
16 /*
17 prefetch(x) attempts to pre-emptively get the memory pointed to
18 by address "x" into the CPU L1 cache.
19 prefetch(x) should not cause any kind of exception, prefetch(0) is
20 specifically ok.
22 prefetch() should be defined by the architecture, if not, the
23 #define below provides a no-op define.
25 There are 3 prefetch() macros:
27 prefetch(x) - prefetches the cacheline at "x" for read
28 prefetchw(x) - prefetches the cacheline at "x" for write
29 spin_lock_prefetch(x) - prefectches the spinlock *x for taking
31 there is also PREFETCH_STRIDE which is the architecure-prefered
32 "lookahead" size for prefetching streamed operations.
34 */
36 /*
37 * These cannot be do{}while(0) macros. See the mental gymnastics in
38 * the loop macro.
39 */
41 #ifndef ARCH_HAS_PREFETCH
42 #define ARCH_HAS_PREFETCH
43 static inline void prefetch(const void *x) {;}
44 #endif
46 #ifndef ARCH_HAS_PREFETCHW
47 #define ARCH_HAS_PREFETCHW
48 static inline void prefetchw(const void *x) {;}
49 #endif
51 #ifndef ARCH_HAS_SPINLOCK_PREFETCH
52 #define ARCH_HAS_SPINLOCK_PREFETCH
53 #define spin_lock_prefetch(x) prefetchw(x)
54 #endif
56 #ifndef PREFETCH_STRIDE
57 #define PREFETCH_STRIDE (4*L1_CACHE_BYTES)
58 #endif
60 #endif