[PATCH] I2O: Bugfixes to get I2O working again
[linux/fpc-iii.git] / include / asm-parisc / cache.h
blobc831665473cb79b2b5d132bf7f174b7daa859763
1 /*
2 * include/asm-parisc/cache.h
3 */
5 #ifndef __ARCH_PARISC_CACHE_H
6 #define __ARCH_PARISC_CACHE_H
8 #include <linux/config.h>
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.
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
26 #ifndef __ASSEMBLY__
28 #define L1_CACHE_ALIGN(x) (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1))
30 #define SMP_CACHE_BYTES L1_CACHE_BYTES
32 #define __read_mostly __attribute__((__section__(".data.read_mostly")))
34 extern void flush_data_cache_local(void *); /* flushes local data-cache only */
35 extern void flush_instruction_cache_local(void *); /* flushes local code-cache only */
36 #ifdef CONFIG_SMP
37 extern void flush_data_cache(void); /* flushes data-cache only (all processors) */
38 extern void flush_instruction_cache(void); /* flushes i-cache only (all processors) */
39 #else
40 #define flush_data_cache() flush_data_cache_local(NULL)
41 #define flush_instruction_cache() flush_instruction_cache_local(NULL)
42 #endif
44 extern void parisc_cache_init(void); /* initializes cache-flushing */
45 extern void flush_all_caches(void); /* flush everything (tlb & cache) */
46 extern int get_cache_info(char *);
47 extern void flush_user_icache_range_asm(unsigned long, unsigned long);
48 extern void flush_kernel_icache_range_asm(unsigned long, unsigned long);
49 extern void flush_user_dcache_range_asm(unsigned long, unsigned long);
50 extern void flush_kernel_dcache_range_asm(unsigned long, unsigned long);
51 extern void flush_kernel_dcache_page_asm(void *);
52 extern void flush_kernel_icache_page(void *);
53 extern void disable_sr_hashing(void); /* turns off space register hashing */
54 extern void disable_sr_hashing_asm(int); /* low level support for above */
55 extern void free_sid(unsigned long);
56 unsigned long alloc_sid(void);
57 extern void flush_user_dcache_page(unsigned long);
58 extern void flush_user_icache_page(unsigned long);
60 struct seq_file;
61 extern void show_cache_info(struct seq_file *m);
63 extern int split_tlb;
64 extern int dcache_stride;
65 extern int icache_stride;
66 extern struct pdc_cache_info cache_info;
68 #define pdtlb(addr) asm volatile("pdtlb 0(%%sr1,%0)" : : "r" (addr));
69 #define pitlb(addr) asm volatile("pitlb 0(%%sr1,%0)" : : "r" (addr));
70 #define pdtlb_kernel(addr) asm volatile("pdtlb 0(%0)" : : "r" (addr));
72 #endif /* ! __ASSEMBLY__ */
74 /* Classes of processor wrt: disabling space register hashing */
76 #define SRHASH_PCXST 0 /* pcxs, pcxt, pcxt_ */
77 #define SRHASH_PCXL 1 /* pcxl */
78 #define SRHASH_PA20 2 /* pcxu, pcxu_, pcxw, pcxw_ */
80 #endif