diff options
Diffstat (limited to 'arch/mips/include/asm/msa.h')
-rw-r--r-- | arch/mips/include/asm/msa.h | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/arch/mips/include/asm/msa.h b/arch/mips/include/asm/msa.h index 538f6d482db8..af5638b12c75 100644 --- a/arch/mips/include/asm/msa.h +++ b/arch/mips/include/asm/msa.h | |||
@@ -12,8 +12,11 @@ | |||
12 | 12 | ||
13 | #include <asm/mipsregs.h> | 13 | #include <asm/mipsregs.h> |
14 | 14 | ||
15 | #ifndef __ASSEMBLY__ | ||
16 | |||
15 | extern void _save_msa(struct task_struct *); | 17 | extern void _save_msa(struct task_struct *); |
16 | extern void _restore_msa(struct task_struct *); | 18 | extern void _restore_msa(struct task_struct *); |
19 | extern void _init_msa_upper(void); | ||
17 | 20 | ||
18 | static inline void enable_msa(void) | 21 | static inline void enable_msa(void) |
19 | { | 22 | { |
@@ -112,10 +115,10 @@ static inline unsigned int read_msa_##name(void) \ | |||
112 | " .set push\n" \ | 115 | " .set push\n" \ |
113 | " .set noat\n" \ | 116 | " .set noat\n" \ |
114 | " .insn\n" \ | 117 | " .insn\n" \ |
115 | " .word #CFC_MSA_INSN | (" #cs " << 11)\n" \ | 118 | " .word %1 | (" #cs " << 11)\n" \ |
116 | " move %0, $1\n" \ | 119 | " move %0, $1\n" \ |
117 | " .set pop\n" \ | 120 | " .set pop\n" \ |
118 | : "=r"(reg)); \ | 121 | : "=r"(reg) : "i"(CFC_MSA_INSN)); \ |
119 | return reg; \ | 122 | return reg; \ |
120 | } \ | 123 | } \ |
121 | \ | 124 | \ |
@@ -126,22 +129,13 @@ static inline void write_msa_##name(unsigned int val) \ | |||
126 | " .set noat\n" \ | 129 | " .set noat\n" \ |
127 | " move $1, %0\n" \ | 130 | " move $1, %0\n" \ |
128 | " .insn\n" \ | 131 | " .insn\n" \ |
129 | " .word #CTC_MSA_INSN | (" #cs " << 6)\n" \ | 132 | " .word %1 | (" #cs " << 6)\n" \ |
130 | " .set pop\n" \ | 133 | " .set pop\n" \ |
131 | : : "r"(val)); \ | 134 | : : "r"(val), "i"(CTC_MSA_INSN)); \ |
132 | } | 135 | } |
133 | 136 | ||
134 | #endif /* !TOOLCHAIN_SUPPORTS_MSA */ | 137 | #endif /* !TOOLCHAIN_SUPPORTS_MSA */ |
135 | 138 | ||
136 | #define MSA_IR 0 | ||
137 | #define MSA_CSR 1 | ||
138 | #define MSA_ACCESS 2 | ||
139 | #define MSA_SAVE 3 | ||
140 | #define MSA_MODIFY 4 | ||
141 | #define MSA_REQUEST 5 | ||
142 | #define MSA_MAP 6 | ||
143 | #define MSA_UNMAP 7 | ||
144 | |||
145 | __BUILD_MSA_CTL_REG(ir, 0) | 139 | __BUILD_MSA_CTL_REG(ir, 0) |
146 | __BUILD_MSA_CTL_REG(csr, 1) | 140 | __BUILD_MSA_CTL_REG(csr, 1) |
147 | __BUILD_MSA_CTL_REG(access, 2) | 141 | __BUILD_MSA_CTL_REG(access, 2) |
@@ -151,6 +145,17 @@ __BUILD_MSA_CTL_REG(request, 5) | |||
151 | __BUILD_MSA_CTL_REG(map, 6) | 145 | __BUILD_MSA_CTL_REG(map, 6) |
152 | __BUILD_MSA_CTL_REG(unmap, 7) | 146 | __BUILD_MSA_CTL_REG(unmap, 7) |
153 | 147 | ||
148 | #endif /* !__ASSEMBLY__ */ | ||
149 | |||
150 | #define MSA_IR 0 | ||
151 | #define MSA_CSR 1 | ||
152 | #define MSA_ACCESS 2 | ||
153 | #define MSA_SAVE 3 | ||
154 | #define MSA_MODIFY 4 | ||
155 | #define MSA_REQUEST 5 | ||
156 | #define MSA_MAP 6 | ||
157 | #define MSA_UNMAP 7 | ||
158 | |||
154 | /* MSA Implementation Register (MSAIR) */ | 159 | /* MSA Implementation Register (MSAIR) */ |
155 | #define MSA_IR_REVB 0 | 160 | #define MSA_IR_REVB 0 |
156 | #define MSA_IR_REVF (_ULCAST_(0xff) << MSA_IR_REVB) | 161 | #define MSA_IR_REVF (_ULCAST_(0xff) << MSA_IR_REVB) |