This source file includes following definitions.
- swift_inv_insn_tag
- swift_inv_data_tag
- swift_flush_dcache
- swift_flush_icache
- swift_idflash_clear
- swift_flush_page
- swift_flush_segment
- swift_flush_region
- swift_flush_context
1
2
3
4
5
6
7
8 #ifndef _SPARC_SWIFT_H
9 #define _SPARC_SWIFT_H
10
11
12 #define SWIFT_ST 0x00800000
13 #define SWIFT_WP 0x00400000
14
15
16 #define SWIFT_BF 0x00200000
17 #define SWIFT_PMC 0x00180000
18 #define SWIFT_PE 0x00040000
19 #define SWIFT_PC 0x00020000
20 #define SWIFT_AP 0x00010000
21 #define SWIFT_AC 0x00008000
22 #define SWIFT_BM 0x00004000
23 #define SWIFT_RC 0x00003c00
24 #define SWIFT_IE 0x00000200
25 #define SWIFT_DE 0x00000100
26 #define SWIFT_SA 0x00000080
27 #define SWIFT_NF 0x00000002
28 #define SWIFT_EN 0x00000001
29
30
31 static inline void swift_inv_insn_tag(unsigned long addr)
32 {
33 __asm__ __volatile__("sta %%g0, [%0] %1\n\t"
34 :
35 : "r" (addr), "i" (ASI_M_TXTC_TAG)
36 : "memory");
37 }
38
39
40 static inline void swift_inv_data_tag(unsigned long addr)
41 {
42 __asm__ __volatile__("sta %%g0, [%0] %1\n\t"
43 :
44 : "r" (addr), "i" (ASI_M_DATAC_TAG)
45 : "memory");
46 }
47
48 static inline void swift_flush_dcache(void)
49 {
50 unsigned long addr;
51
52 for (addr = 0; addr < 0x2000; addr += 0x10)
53 swift_inv_data_tag(addr);
54 }
55
56 static inline void swift_flush_icache(void)
57 {
58 unsigned long addr;
59
60 for (addr = 0; addr < 0x4000; addr += 0x20)
61 swift_inv_insn_tag(addr);
62 }
63
64 static inline void swift_idflash_clear(void)
65 {
66 unsigned long addr;
67
68 for (addr = 0; addr < 0x2000; addr += 0x10) {
69 swift_inv_insn_tag(addr<<1);
70 swift_inv_data_tag(addr);
71 }
72 }
73
74
75 static inline void swift_flush_page(unsigned long page)
76 {
77 __asm__ __volatile__("sta %%g0, [%0] %1\n\t"
78 :
79 : "r" (page), "i" (ASI_M_FLUSH_PAGE)
80 : "memory");
81 }
82
83 static inline void swift_flush_segment(unsigned long addr)
84 {
85 __asm__ __volatile__("sta %%g0, [%0] %1\n\t"
86 :
87 : "r" (addr), "i" (ASI_M_FLUSH_SEG)
88 : "memory");
89 }
90
91 static inline void swift_flush_region(unsigned long addr)
92 {
93 __asm__ __volatile__("sta %%g0, [%0] %1\n\t"
94 :
95 : "r" (addr), "i" (ASI_M_FLUSH_REGION)
96 : "memory");
97 }
98
99 static inline void swift_flush_context(void)
100 {
101 __asm__ __volatile__("sta %%g0, [%%g0] %0\n\t"
102 :
103 : "i" (ASI_M_FLUSH_CTX)
104 : "memory");
105 }
106
107 #endif