aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-parisc/cache.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-parisc/cache.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-parisc/cache.h')
-rw-r--r--include/asm-parisc/cache.h79
1 files changed, 79 insertions, 0 deletions
diff --git a/include/asm-parisc/cache.h b/include/asm-parisc/cache.h
new file mode 100644
index 000000000000..5da72e38bdde
--- /dev/null
+++ b/include/asm-parisc/cache.h
@@ -0,0 +1,79 @@
1/*
2 * include/asm-parisc/cache.h
3 */
4
5#ifndef __ARCH_PARISC_CACHE_H
6#define __ARCH_PARISC_CACHE_H
7
8#include <linux/config.h>
9
10/*
11 * PA 2.0 processors have 64-byte cachelines; PA 1.1 processors have
12 * 32-byte cachelines. The default configuration is not for SMP anyway,
13 * so if you're building for SMP, you should select the appropriate
14 * processor type. There is a potential livelock danger when running
15 * a machine with this value set too small, but it's more probable you'll
16 * just ruin performance.
17 */
18#ifdef CONFIG_PA20
19#define L1_CACHE_BYTES 64
20#define L1_CACHE_SHIFT 6
21#else
22#define L1_CACHE_BYTES 32
23#define L1_CACHE_SHIFT 5
24#endif
25
26#ifndef __ASSEMBLY__
27
28#define L1_CACHE_ALIGN(x) (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1))
29
30#define SMP_CACHE_BYTES L1_CACHE_BYTES
31#define L1_CACHE_SHIFT_MAX 5 /* largest L1 which this arch supports */
32
33extern void flush_data_cache_local(void); /* flushes local data-cache only */
34extern void flush_instruction_cache_local(void); /* flushes local code-cache only */
35#ifdef CONFIG_SMP
36extern void flush_data_cache(void); /* flushes data-cache only (all processors) */
37extern void flush_instruction_cache(void); /* flushes i-cache only (all processors) */
38#else
39#define flush_data_cache flush_data_cache_local
40#define flush_instruction_cache flush_instruction_cache_local
41#endif
42
43extern void parisc_cache_init(void); /* initializes cache-flushing */
44extern void flush_all_caches(void); /* flush everything (tlb & cache) */
45extern int get_cache_info(char *);
46extern void flush_user_icache_range_asm(unsigned long, unsigned long);
47extern void flush_kernel_icache_range_asm(unsigned long, unsigned long);
48extern void flush_user_dcache_range_asm(unsigned long, unsigned long);
49extern void flush_kernel_dcache_range_asm(unsigned long, unsigned long);
50extern void flush_kernel_dcache_page(void *);
51extern void flush_kernel_icache_page(void *);
52extern void disable_sr_hashing(void); /* turns off space register hashing */
53extern void disable_sr_hashing_asm(int); /* low level support for above */
54extern void free_sid(unsigned long);
55unsigned long alloc_sid(void);
56extern void flush_user_dcache_page(unsigned long);
57extern void flush_user_icache_page(unsigned long);
58
59struct seq_file;
60extern void show_cache_info(struct seq_file *m);
61
62extern int split_tlb;
63extern int dcache_stride;
64extern int icache_stride;
65extern struct pdc_cache_info cache_info;
66
67#define pdtlb(addr) asm volatile("pdtlb 0(%%sr1,%0)" : : "r" (addr));
68#define pitlb(addr) asm volatile("pitlb 0(%%sr1,%0)" : : "r" (addr));
69#define pdtlb_kernel(addr) asm volatile("pdtlb 0(%0)" : : "r" (addr));
70
71#endif /* ! __ASSEMBLY__ */
72
73/* Classes of processor wrt: disabling space register hashing */
74
75#define SRHASH_PCXST 0 /* pcxs, pcxt, pcxt_ */
76#define SRHASH_PCXL 1 /* pcxl */
77#define SRHASH_PA20 2 /* pcxu, pcxu_, pcxw, pcxw_ */
78
79#endif