diff options
author | David S. Miller <davem@davemloft.net> | 2012-05-20 00:15:37 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-05-20 00:15:37 -0400 |
commit | d0be6b16c34e87cccadc55ac21bb88d46db75493 (patch) | |
tree | e12a041b83dcf8390fb90b64b10e71b2dcbafa3c /arch/sparc/include | |
parent | 74c7b28953d4eaa6a479c187aeafcfc0280da5e8 (diff) |
sparc32: Remove completely unused code from asm/cache.h
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/include')
-rw-r--r-- | arch/sparc/include/asm/cache.h | 114 |
1 files changed, 0 insertions, 114 deletions
diff --git a/arch/sparc/include/asm/cache.h b/arch/sparc/include/asm/cache.h index 69358b590c91..5bb6991b4857 100644 --- a/arch/sparc/include/asm/cache.h +++ b/arch/sparc/include/asm/cache.h | |||
@@ -22,118 +22,4 @@ | |||
22 | 22 | ||
23 | #define __read_mostly __attribute__((__section__(".data..read_mostly"))) | 23 | #define __read_mostly __attribute__((__section__(".data..read_mostly"))) |
24 | 24 | ||
25 | #ifdef CONFIG_SPARC32 | ||
26 | #include <asm/asi.h> | ||
27 | |||
28 | /* Direct access to the instruction cache is provided through and | ||
29 | * alternate address space. The IDC bit must be off in the ICCR on | ||
30 | * HyperSparcs for these accesses to work. The code below does not do | ||
31 | * any checking, the caller must do so. These routines are for | ||
32 | * diagnostics only, but could end up being useful. Use with care. | ||
33 | * Also, you are asking for trouble if you execute these in one of the | ||
34 | * three instructions following a %asr/%psr access or modification. | ||
35 | */ | ||
36 | |||
37 | /* First, cache-tag access. */ | ||
38 | static inline unsigned int get_icache_tag(int setnum, int tagnum) | ||
39 | { | ||
40 | unsigned int vaddr, retval; | ||
41 | |||
42 | vaddr = ((setnum&1) << 12) | ((tagnum&0x7f) << 5); | ||
43 | __asm__ __volatile__("lda [%1] %2, %0\n\t" : | ||
44 | "=r" (retval) : | ||
45 | "r" (vaddr), "i" (ASI_M_TXTC_TAG)); | ||
46 | return retval; | ||
47 | } | ||
48 | |||
49 | static inline void put_icache_tag(int setnum, int tagnum, unsigned int entry) | ||
50 | { | ||
51 | unsigned int vaddr; | ||
52 | |||
53 | vaddr = ((setnum&1) << 12) | ((tagnum&0x7f) << 5); | ||
54 | __asm__ __volatile__("sta %0, [%1] %2\n\t" : : | ||
55 | "r" (entry), "r" (vaddr), "i" (ASI_M_TXTC_TAG) : | ||
56 | "memory"); | ||
57 | } | ||
58 | |||
59 | /* Second cache-data access. The data is returned two-32bit quantities | ||
60 | * at a time. | ||
61 | */ | ||
62 | static inline void get_icache_data(int setnum, int tagnum, int subblock, | ||
63 | unsigned int *data) | ||
64 | { | ||
65 | unsigned int value1, value2, vaddr; | ||
66 | |||
67 | vaddr = ((setnum&0x1) << 12) | ((tagnum&0x7f) << 5) | | ||
68 | ((subblock&0x3) << 3); | ||
69 | __asm__ __volatile__("ldda [%2] %3, %%g2\n\t" | ||
70 | "or %%g0, %%g2, %0\n\t" | ||
71 | "or %%g0, %%g3, %1\n\t" : | ||
72 | "=r" (value1), "=r" (value2) : | ||
73 | "r" (vaddr), "i" (ASI_M_TXTC_DATA) : | ||
74 | "g2", "g3"); | ||
75 | data[0] = value1; data[1] = value2; | ||
76 | } | ||
77 | |||
78 | static inline void put_icache_data(int setnum, int tagnum, int subblock, | ||
79 | unsigned int *data) | ||
80 | { | ||
81 | unsigned int value1, value2, vaddr; | ||
82 | |||
83 | vaddr = ((setnum&0x1) << 12) | ((tagnum&0x7f) << 5) | | ||
84 | ((subblock&0x3) << 3); | ||
85 | value1 = data[0]; value2 = data[1]; | ||
86 | __asm__ __volatile__("or %%g0, %0, %%g2\n\t" | ||
87 | "or %%g0, %1, %%g3\n\t" | ||
88 | "stda %%g2, [%2] %3\n\t" : : | ||
89 | "r" (value1), "r" (value2), | ||
90 | "r" (vaddr), "i" (ASI_M_TXTC_DATA) : | ||
91 | "g2", "g3", "memory" /* no joke */); | ||
92 | } | ||
93 | |||
94 | /* Different types of flushes with the ICACHE. Some of the flushes | ||
95 | * affect both the ICACHE and the external cache. Others only clear | ||
96 | * the ICACHE entries on the cpu itself. V8's (most) allow | ||
97 | * granularity of flushes on the packet (element in line), whole line, | ||
98 | * and entire cache (ie. all lines) level. The ICACHE only flushes are | ||
99 | * ROSS HyperSparc specific and are in ross.h | ||
100 | */ | ||
101 | |||
102 | /* Flushes which clear out both the on-chip and external caches */ | ||
103 | static inline void flush_ei_page(unsigned int addr) | ||
104 | { | ||
105 | __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : | ||
106 | "r" (addr), "i" (ASI_M_FLUSH_PAGE) : | ||
107 | "memory"); | ||
108 | } | ||
109 | |||
110 | static inline void flush_ei_seg(unsigned int addr) | ||
111 | { | ||
112 | __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : | ||
113 | "r" (addr), "i" (ASI_M_FLUSH_SEG) : | ||
114 | "memory"); | ||
115 | } | ||
116 | |||
117 | static inline void flush_ei_region(unsigned int addr) | ||
118 | { | ||
119 | __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : | ||
120 | "r" (addr), "i" (ASI_M_FLUSH_REGION) : | ||
121 | "memory"); | ||
122 | } | ||
123 | |||
124 | static inline void flush_ei_ctx(unsigned int addr) | ||
125 | { | ||
126 | __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : | ||
127 | "r" (addr), "i" (ASI_M_FLUSH_CTX) : | ||
128 | "memory"); | ||
129 | } | ||
130 | |||
131 | static inline void flush_ei_user(unsigned int addr) | ||
132 | { | ||
133 | __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : | ||
134 | "r" (addr), "i" (ASI_M_FLUSH_USER) : | ||
135 | "memory"); | ||
136 | } | ||
137 | #endif /* CONFIG_SPARC32 */ | ||
138 | |||
139 | #endif /* !(_SPARC_CACHE_H) */ | 25 | #endif /* !(_SPARC_CACHE_H) */ |