aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-mips/prefetch.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/asm-mips/prefetch.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'include/asm-mips/prefetch.h')
-rw-r--r--include/asm-mips/prefetch.h88
1 files changed, 88 insertions, 0 deletions
diff --git a/include/asm-mips/prefetch.h b/include/asm-mips/prefetch.h
new file mode 100644
index 000000000000..71293ec1657c
--- /dev/null
+++ b/include/asm-mips/prefetch.h
@@ -0,0 +1,88 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2003 by Ralf Baechle
7 */
8#ifndef __ASM_PREFETCH_H
9#define __ASM_PREFETCH_H
10
11#include <linux/config.h>
12
13/*
14 * R5000 and RM5200 implements pref and prefx instructions but they're nops, so
15 * rather than wasting time we pretend these processors don't support
16 * prefetching at all.
17 *
18 * R5432 implements Load, Store, LoadStreamed, StoreStreamed, LoadRetained,
19 * StoreRetained and WriteBackInvalidate but not Pref_PrepareForStore.
20 *
21 * Hell (and the book on my shelf I can't open ...) know what the R8000 does.
22 *
23 * RM7000 version 1.0 interprets all hints as Pref_Load; version 2.0 implements
24 * Pref_PrepareForStore also.
25 *
26 * RM9000 is MIPS IV but implements prefetching like MIPS32/MIPS64; it's
27 * Pref_WriteBackInvalidate is a nop and Pref_PrepareForStore is broken in
28 * current versions due to erratum G105.
29 *
30 * VR7701 only implements the Load prefetch.
31 *
32 * Finally MIPS32 and MIPS64 implement all of the following hints.
33 */
34
35#define Pref_Load 0
36#define Pref_Store 1
37 /* 2 and 3 are reserved */
38#define Pref_LoadStreamed 4
39#define Pref_StoreStreamed 5
40#define Pref_LoadRetained 6
41#define Pref_StoreRetained 7
42 /* 8 ... 24 are reserved */
43#define Pref_WriteBackInvalidate 25
44#define Pref_PrepareForStore 30
45
46#ifdef __ASSEMBLY__
47
48 .macro __pref hint addr
49#ifdef CONFIG_CPU_HAS_PREFETCH
50 pref \hint, \addr
51#endif
52 .endm
53
54 .macro pref_load addr
55 __pref Pref_Load, \addr
56 .endm
57
58 .macro pref_store addr
59 __pref Pref_Store, \addr
60 .endm
61
62 .macro pref_load_streamed addr
63 __pref Pref_LoadStreamed, \addr
64 .endm
65
66 .macro pref_store_streamed addr
67 __pref Pref_StoreStreamed, \addr
68 .endm
69
70 .macro pref_load_retained addr
71 __pref Pref_LoadRetained, \addr
72 .endm
73
74 .macro pref_store_retained addr
75 __pref Pref_StoreRetained, \addr
76 .endm
77
78 .macro pref_wback_inv addr
79 __pref Pref_WriteBackInvalidate, \addr
80 .endm
81
82 .macro pref_prepare_for_store addr
83 __pref Pref_PrepareForStore, \addr
84 .endm
85
86#endif
87
88#endif /* __ASM_PREFETCH_H */