1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 #ifndef _ASM_MIPS_UNALIGNED_EMUL_H
3 #define _ASM_MIPS_UNALIGNED_EMUL_H
8 #define _LoadHW(addr, value, res, type) \
10 __asm__ __volatile__ (".set\tnoat\n" \
11 "1:\t"type##_lb("%0", "0(%2)")"\n" \
12 "2:\t"type##_lbu("$1", "1(%2)")"\n\t"\
18 ".section\t.fixup,\"ax\"\n\t" \
19 "4:\tli\t%1, %3\n\t" \
22 ".section\t__ex_table,\"a\"\n\t" \
23 STR(PTR_WD)"\t1b, 4b\n\t" \
24 STR(PTR_WD)"\t2b, 4b\n\t" \
26 : "=&r" (value), "=r" (res) \
27 : "r" (addr), "i" (-EFAULT)); \
30 #ifndef CONFIG_CPU_NO_LOAD_STORE_LR
31 #define _LoadW(addr, value, res, type) \
33 __asm__ __volatile__ ( \
34 "1:\t"type##_lwl("%0", "(%2)")"\n" \
35 "2:\t"type##_lwr("%0", "3(%2)")"\n\t"\
39 ".section\t.fixup,\"ax\"\n\t" \
40 "4:\tli\t%1, %3\n\t" \
43 ".section\t__ex_table,\"a\"\n\t" \
44 STR(PTR_WD)"\t1b, 4b\n\t" \
45 STR(PTR_WD)"\t2b, 4b\n\t" \
47 : "=&r" (value), "=r" (res) \
48 : "r" (addr), "i" (-EFAULT)); \
51 #else /* CONFIG_CPU_NO_LOAD_STORE_LR */
52 /* For CPUs without lwl instruction */
53 #define _LoadW(addr, value, res, type) \
55 __asm__ __volatile__ ( \
58 "1:"type##_lb("%0", "0(%2)")"\n\t" \
59 "2:"type##_lbu("$1", "1(%2)")"\n\t" \
62 "3:"type##_lbu("$1", "2(%2)")"\n\t" \
65 "4:"type##_lbu("$1", "3(%2)")"\n\t" \
72 ".section\t.fixup,\"ax\"\n\t" \
73 "11:\tli\t%1, %3\n\t" \
76 ".section\t__ex_table,\"a\"\n\t" \
77 STR(PTR_WD)"\t1b, 11b\n\t" \
78 STR(PTR_WD)"\t2b, 11b\n\t" \
79 STR(PTR_WD)"\t3b, 11b\n\t" \
80 STR(PTR_WD)"\t4b, 11b\n\t" \
82 : "=&r" (value), "=r" (res) \
83 : "r" (addr), "i" (-EFAULT)); \
86 #endif /* CONFIG_CPU_NO_LOAD_STORE_LR */
88 #define _LoadHWU(addr, value, res, type) \
90 __asm__ __volatile__ ( \
92 "1:\t"type##_lbu("%0", "0(%2)")"\n" \
93 "2:\t"type##_lbu("$1", "1(%2)")"\n\t"\
100 ".section\t.fixup,\"ax\"\n\t" \
101 "4:\tli\t%1, %3\n\t" \
104 ".section\t__ex_table,\"a\"\n\t" \
105 STR(PTR_WD)"\t1b, 4b\n\t" \
106 STR(PTR_WD)"\t2b, 4b\n\t" \
108 : "=&r" (value), "=r" (res) \
109 : "r" (addr), "i" (-EFAULT)); \
112 #ifndef CONFIG_CPU_NO_LOAD_STORE_LR
113 #define _LoadWU(addr, value, res, type) \
115 __asm__ __volatile__ ( \
116 "1:\t"type##_lwl("%0", "(%2)")"\n" \
117 "2:\t"type##_lwr("%0", "3(%2)")"\n\t"\
118 "dsll\t%0, %0, 32\n\t" \
119 "dsrl\t%0, %0, 32\n\t" \
123 "\t.section\t.fixup,\"ax\"\n\t" \
124 "4:\tli\t%1, %3\n\t" \
127 ".section\t__ex_table,\"a\"\n\t" \
128 STR(PTR_WD)"\t1b, 4b\n\t" \
129 STR(PTR_WD)"\t2b, 4b\n\t" \
131 : "=&r" (value), "=r" (res) \
132 : "r" (addr), "i" (-EFAULT)); \
135 #define _LoadDW(addr, value, res) \
137 __asm__ __volatile__ ( \
138 "1:\tldl\t%0, (%2)\n" \
139 "2:\tldr\t%0, 7(%2)\n\t" \
143 "\t.section\t.fixup,\"ax\"\n\t" \
144 "4:\tli\t%1, %3\n\t" \
147 ".section\t__ex_table,\"a\"\n\t" \
148 STR(PTR_WD)"\t1b, 4b\n\t" \
149 STR(PTR_WD)"\t2b, 4b\n\t" \
151 : "=&r" (value), "=r" (res) \
152 : "r" (addr), "i" (-EFAULT)); \
155 #else /* CONFIG_CPU_NO_LOAD_STORE_LR */
156 /* For CPUs without lwl and ldl instructions */
157 #define _LoadWU(addr, value, res, type) \
159 __asm__ __volatile__ ( \
162 "1:"type##_lbu("%0", "0(%2)")"\n\t" \
163 "2:"type##_lbu("$1", "1(%2)")"\n\t" \
166 "3:"type##_lbu("$1", "2(%2)")"\n\t" \
169 "4:"type##_lbu("$1", "3(%2)")"\n\t" \
176 ".section\t.fixup,\"ax\"\n\t" \
177 "11:\tli\t%1, %3\n\t" \
180 ".section\t__ex_table,\"a\"\n\t" \
181 STR(PTR_WD)"\t1b, 11b\n\t" \
182 STR(PTR_WD)"\t2b, 11b\n\t" \
183 STR(PTR_WD)"\t3b, 11b\n\t" \
184 STR(PTR_WD)"\t4b, 11b\n\t" \
186 : "=&r" (value), "=r" (res) \
187 : "r" (addr), "i" (-EFAULT)); \
190 #define _LoadDW(addr, value, res) \
192 __asm__ __volatile__ ( \
195 "1:lb\t%0, 0(%2)\n\t" \
196 "2:lbu\t $1, 1(%2)\n\t" \
197 "dsll\t%0, 0x8\n\t" \
199 "3:lbu\t$1, 2(%2)\n\t" \
200 "dsll\t%0, 0x8\n\t" \
202 "4:lbu\t$1, 3(%2)\n\t" \
203 "dsll\t%0, 0x8\n\t" \
205 "5:lbu\t$1, 4(%2)\n\t" \
206 "dsll\t%0, 0x8\n\t" \
208 "6:lbu\t$1, 5(%2)\n\t" \
209 "dsll\t%0, 0x8\n\t" \
211 "7:lbu\t$1, 6(%2)\n\t" \
212 "dsll\t%0, 0x8\n\t" \
214 "8:lbu\t$1, 7(%2)\n\t" \
215 "dsll\t%0, 0x8\n\t" \
221 ".section\t.fixup,\"ax\"\n\t" \
222 "11:\tli\t%1, %3\n\t" \
225 ".section\t__ex_table,\"a\"\n\t" \
226 STR(PTR_WD)"\t1b, 11b\n\t" \
227 STR(PTR_WD)"\t2b, 11b\n\t" \
228 STR(PTR_WD)"\t3b, 11b\n\t" \
229 STR(PTR_WD)"\t4b, 11b\n\t" \
230 STR(PTR_WD)"\t5b, 11b\n\t" \
231 STR(PTR_WD)"\t6b, 11b\n\t" \
232 STR(PTR_WD)"\t7b, 11b\n\t" \
233 STR(PTR_WD)"\t8b, 11b\n\t" \
235 : "=&r" (value), "=r" (res) \
236 : "r" (addr), "i" (-EFAULT)); \
239 #endif /* CONFIG_CPU_NO_LOAD_STORE_LR */
242 #define _StoreHW(addr, value, res, type) \
244 __asm__ __volatile__ ( \
246 "1:\t"type##_sb("%1", "1(%2)")"\n" \
247 "srl\t$1, %1, 0x8\n" \
248 "2:\t"type##_sb("$1", "0(%2)")"\n" \
253 ".section\t.fixup,\"ax\"\n\t" \
254 "4:\tli\t%0, %3\n\t" \
257 ".section\t__ex_table,\"a\"\n\t" \
258 STR(PTR_WD)"\t1b, 4b\n\t" \
259 STR(PTR_WD)"\t2b, 4b\n\t" \
262 : "r" (value), "r" (addr), "i" (-EFAULT));\
265 #ifndef CONFIG_CPU_NO_LOAD_STORE_LR
266 #define _StoreW(addr, value, res, type) \
268 __asm__ __volatile__ ( \
269 "1:\t"type##_swl("%1", "(%2)")"\n" \
270 "2:\t"type##_swr("%1", "3(%2)")"\n\t"\
274 ".section\t.fixup,\"ax\"\n\t" \
275 "4:\tli\t%0, %3\n\t" \
278 ".section\t__ex_table,\"a\"\n\t" \
279 STR(PTR_WD)"\t1b, 4b\n\t" \
280 STR(PTR_WD)"\t2b, 4b\n\t" \
283 : "r" (value), "r" (addr), "i" (-EFAULT)); \
286 #define _StoreDW(addr, value, res) \
288 __asm__ __volatile__ ( \
289 "1:\tsdl\t%1,(%2)\n" \
290 "2:\tsdr\t%1, 7(%2)\n\t" \
294 ".section\t.fixup,\"ax\"\n\t" \
295 "4:\tli\t%0, %3\n\t" \
298 ".section\t__ex_table,\"a\"\n\t" \
299 STR(PTR_WD)"\t1b, 4b\n\t" \
300 STR(PTR_WD)"\t2b, 4b\n\t" \
303 : "r" (value), "r" (addr), "i" (-EFAULT)); \
306 #else /* CONFIG_CPU_NO_LOAD_STORE_LR */
307 #define _StoreW(addr, value, res, type) \
309 __asm__ __volatile__ ( \
312 "1:"type##_sb("%1", "3(%2)")"\n\t" \
313 "srl\t$1, %1, 0x8\n\t" \
314 "2:"type##_sb("$1", "2(%2)")"\n\t" \
315 "srl\t$1, $1, 0x8\n\t" \
316 "3:"type##_sb("$1", "1(%2)")"\n\t" \
317 "srl\t$1, $1, 0x8\n\t" \
318 "4:"type##_sb("$1", "0(%2)")"\n\t" \
323 ".section\t.fixup,\"ax\"\n\t" \
324 "11:\tli\t%0, %3\n\t" \
327 ".section\t__ex_table,\"a\"\n\t" \
328 STR(PTR_WD)"\t1b, 11b\n\t" \
329 STR(PTR_WD)"\t2b, 11b\n\t" \
330 STR(PTR_WD)"\t3b, 11b\n\t" \
331 STR(PTR_WD)"\t4b, 11b\n\t" \
334 : "r" (value), "r" (addr), "i" (-EFAULT) \
338 #define _StoreDW(addr, value, res) \
340 __asm__ __volatile__ ( \
343 "1:sb\t%1, 7(%2)\n\t" \
344 "dsrl\t$1, %1, 0x8\n\t" \
345 "2:sb\t$1, 6(%2)\n\t" \
346 "dsrl\t$1, $1, 0x8\n\t" \
347 "3:sb\t$1, 5(%2)\n\t" \
348 "dsrl\t$1, $1, 0x8\n\t" \
349 "4:sb\t$1, 4(%2)\n\t" \
350 "dsrl\t$1, $1, 0x8\n\t" \
351 "5:sb\t$1, 3(%2)\n\t" \
352 "dsrl\t$1, $1, 0x8\n\t" \
353 "6:sb\t$1, 2(%2)\n\t" \
354 "dsrl\t$1, $1, 0x8\n\t" \
355 "7:sb\t$1, 1(%2)\n\t" \
356 "dsrl\t$1, $1, 0x8\n\t" \
357 "8:sb\t$1, 0(%2)\n\t" \
358 "dsrl\t$1, $1, 0x8\n\t" \
363 ".section\t.fixup,\"ax\"\n\t" \
364 "11:\tli\t%0, %3\n\t" \
367 ".section\t__ex_table,\"a\"\n\t" \
368 STR(PTR_WD)"\t1b, 11b\n\t" \
369 STR(PTR_WD)"\t2b, 11b\n\t" \
370 STR(PTR_WD)"\t3b, 11b\n\t" \
371 STR(PTR_WD)"\t4b, 11b\n\t" \
372 STR(PTR_WD)"\t5b, 11b\n\t" \
373 STR(PTR_WD)"\t6b, 11b\n\t" \
374 STR(PTR_WD)"\t7b, 11b\n\t" \
375 STR(PTR_WD)"\t8b, 11b\n\t" \
378 : "r" (value), "r" (addr), "i" (-EFAULT) \
382 #endif /* CONFIG_CPU_NO_LOAD_STORE_LR */
384 #else /* __BIG_ENDIAN */
386 #define _LoadHW(addr, value, res, type) \
388 __asm__ __volatile__ (".set\tnoat\n" \
389 "1:\t"type##_lb("%0", "1(%2)")"\n" \
390 "2:\t"type##_lbu("$1", "0(%2)")"\n\t"\
396 ".section\t.fixup,\"ax\"\n\t" \
397 "4:\tli\t%1, %3\n\t" \
400 ".section\t__ex_table,\"a\"\n\t" \
401 STR(PTR_WD)"\t1b, 4b\n\t" \
402 STR(PTR_WD)"\t2b, 4b\n\t" \
404 : "=&r" (value), "=r" (res) \
405 : "r" (addr), "i" (-EFAULT)); \
408 #ifndef CONFIG_CPU_NO_LOAD_STORE_LR
409 #define _LoadW(addr, value, res, type) \
411 __asm__ __volatile__ ( \
412 "1:\t"type##_lwl("%0", "3(%2)")"\n" \
413 "2:\t"type##_lwr("%0", "(%2)")"\n\t"\
417 ".section\t.fixup,\"ax\"\n\t" \
418 "4:\tli\t%1, %3\n\t" \
421 ".section\t__ex_table,\"a\"\n\t" \
422 STR(PTR_WD)"\t1b, 4b\n\t" \
423 STR(PTR_WD)"\t2b, 4b\n\t" \
425 : "=&r" (value), "=r" (res) \
426 : "r" (addr), "i" (-EFAULT)); \
429 #else /* CONFIG_CPU_NO_LOAD_STORE_LR */
430 /* For CPUs without lwl instruction */
431 #define _LoadW(addr, value, res, type) \
433 __asm__ __volatile__ ( \
436 "1:"type##_lb("%0", "3(%2)")"\n\t" \
437 "2:"type##_lbu("$1", "2(%2)")"\n\t" \
440 "3:"type##_lbu("$1", "1(%2)")"\n\t" \
443 "4:"type##_lbu("$1", "0(%2)")"\n\t" \
450 ".section\t.fixup,\"ax\"\n\t" \
451 "11:\tli\t%1, %3\n\t" \
454 ".section\t__ex_table,\"a\"\n\t" \
455 STR(PTR_WD)"\t1b, 11b\n\t" \
456 STR(PTR_WD)"\t2b, 11b\n\t" \
457 STR(PTR_WD)"\t3b, 11b\n\t" \
458 STR(PTR_WD)"\t4b, 11b\n\t" \
460 : "=&r" (value), "=r" (res) \
461 : "r" (addr), "i" (-EFAULT)); \
464 #endif /* CONFIG_CPU_NO_LOAD_STORE_LR */
467 #define _LoadHWU(addr, value, res, type) \
469 __asm__ __volatile__ ( \
471 "1:\t"type##_lbu("%0", "1(%2)")"\n" \
472 "2:\t"type##_lbu("$1", "0(%2)")"\n\t"\
479 ".section\t.fixup,\"ax\"\n\t" \
480 "4:\tli\t%1, %3\n\t" \
483 ".section\t__ex_table,\"a\"\n\t" \
484 STR(PTR_WD)"\t1b, 4b\n\t" \
485 STR(PTR_WD)"\t2b, 4b\n\t" \
487 : "=&r" (value), "=r" (res) \
488 : "r" (addr), "i" (-EFAULT)); \
491 #ifndef CONFIG_CPU_NO_LOAD_STORE_LR
492 #define _LoadWU(addr, value, res, type) \
494 __asm__ __volatile__ ( \
495 "1:\t"type##_lwl("%0", "3(%2)")"\n" \
496 "2:\t"type##_lwr("%0", "(%2)")"\n\t"\
497 "dsll\t%0, %0, 32\n\t" \
498 "dsrl\t%0, %0, 32\n\t" \
502 "\t.section\t.fixup,\"ax\"\n\t" \
503 "4:\tli\t%1, %3\n\t" \
506 ".section\t__ex_table,\"a\"\n\t" \
507 STR(PTR_WD)"\t1b, 4b\n\t" \
508 STR(PTR_WD)"\t2b, 4b\n\t" \
510 : "=&r" (value), "=r" (res) \
511 : "r" (addr), "i" (-EFAULT)); \
514 #define _LoadDW(addr, value, res) \
516 __asm__ __volatile__ ( \
517 "1:\tldl\t%0, 7(%2)\n" \
518 "2:\tldr\t%0, (%2)\n\t" \
522 "\t.section\t.fixup,\"ax\"\n\t" \
523 "4:\tli\t%1, %3\n\t" \
526 ".section\t__ex_table,\"a\"\n\t" \
527 STR(PTR_WD)"\t1b, 4b\n\t" \
528 STR(PTR_WD)"\t2b, 4b\n\t" \
530 : "=&r" (value), "=r" (res) \
531 : "r" (addr), "i" (-EFAULT)); \
534 #else /* CONFIG_CPU_NO_LOAD_STORE_LR */
535 /* For CPUs without lwl and ldl instructions */
536 #define _LoadWU(addr, value, res, type) \
538 __asm__ __volatile__ ( \
541 "1:"type##_lbu("%0", "3(%2)")"\n\t" \
542 "2:"type##_lbu("$1", "2(%2)")"\n\t" \
545 "3:"type##_lbu("$1", "1(%2)")"\n\t" \
548 "4:"type##_lbu("$1", "0(%2)")"\n\t" \
555 ".section\t.fixup,\"ax\"\n\t" \
556 "11:\tli\t%1, %3\n\t" \
559 ".section\t__ex_table,\"a\"\n\t" \
560 STR(PTR_WD)"\t1b, 11b\n\t" \
561 STR(PTR_WD)"\t2b, 11b\n\t" \
562 STR(PTR_WD)"\t3b, 11b\n\t" \
563 STR(PTR_WD)"\t4b, 11b\n\t" \
565 : "=&r" (value), "=r" (res) \
566 : "r" (addr), "i" (-EFAULT)); \
569 #define _LoadDW(addr, value, res) \
571 __asm__ __volatile__ ( \
574 "1:lb\t%0, 7(%2)\n\t" \
575 "2:lbu\t$1, 6(%2)\n\t" \
576 "dsll\t%0, 0x8\n\t" \
578 "3:lbu\t$1, 5(%2)\n\t" \
579 "dsll\t%0, 0x8\n\t" \
581 "4:lbu\t$1, 4(%2)\n\t" \
582 "dsll\t%0, 0x8\n\t" \
584 "5:lbu\t$1, 3(%2)\n\t" \
585 "dsll\t%0, 0x8\n\t" \
587 "6:lbu\t$1, 2(%2)\n\t" \
588 "dsll\t%0, 0x8\n\t" \
590 "7:lbu\t$1, 1(%2)\n\t" \
591 "dsll\t%0, 0x8\n\t" \
593 "8:lbu\t$1, 0(%2)\n\t" \
594 "dsll\t%0, 0x8\n\t" \
600 ".section\t.fixup,\"ax\"\n\t" \
601 "11:\tli\t%1, %3\n\t" \
604 ".section\t__ex_table,\"a\"\n\t" \
605 STR(PTR_WD)"\t1b, 11b\n\t" \
606 STR(PTR_WD)"\t2b, 11b\n\t" \
607 STR(PTR_WD)"\t3b, 11b\n\t" \
608 STR(PTR_WD)"\t4b, 11b\n\t" \
609 STR(PTR_WD)"\t5b, 11b\n\t" \
610 STR(PTR_WD)"\t6b, 11b\n\t" \
611 STR(PTR_WD)"\t7b, 11b\n\t" \
612 STR(PTR_WD)"\t8b, 11b\n\t" \
614 : "=&r" (value), "=r" (res) \
615 : "r" (addr), "i" (-EFAULT)); \
617 #endif /* CONFIG_CPU_NO_LOAD_STORE_LR */
619 #define _StoreHW(addr, value, res, type) \
621 __asm__ __volatile__ ( \
623 "1:\t"type##_sb("%1", "0(%2)")"\n" \
624 "srl\t$1,%1, 0x8\n" \
625 "2:\t"type##_sb("$1", "1(%2)")"\n" \
630 ".section\t.fixup,\"ax\"\n\t" \
631 "4:\tli\t%0, %3\n\t" \
634 ".section\t__ex_table,\"a\"\n\t" \
635 STR(PTR_WD)"\t1b, 4b\n\t" \
636 STR(PTR_WD)"\t2b, 4b\n\t" \
639 : "r" (value), "r" (addr), "i" (-EFAULT));\
642 #ifndef CONFIG_CPU_NO_LOAD_STORE_LR
643 #define _StoreW(addr, value, res, type) \
645 __asm__ __volatile__ ( \
646 "1:\t"type##_swl("%1", "3(%2)")"\n" \
647 "2:\t"type##_swr("%1", "(%2)")"\n\t"\
651 ".section\t.fixup,\"ax\"\n\t" \
652 "4:\tli\t%0, %3\n\t" \
655 ".section\t__ex_table,\"a\"\n\t" \
656 STR(PTR_WD)"\t1b, 4b\n\t" \
657 STR(PTR_WD)"\t2b, 4b\n\t" \
660 : "r" (value), "r" (addr), "i" (-EFAULT)); \
663 #define _StoreDW(addr, value, res) \
665 __asm__ __volatile__ ( \
666 "1:\tsdl\t%1, 7(%2)\n" \
667 "2:\tsdr\t%1, (%2)\n\t" \
671 ".section\t.fixup,\"ax\"\n\t" \
672 "4:\tli\t%0, %3\n\t" \
675 ".section\t__ex_table,\"a\"\n\t" \
676 STR(PTR_WD)"\t1b, 4b\n\t" \
677 STR(PTR_WD)"\t2b, 4b\n\t" \
680 : "r" (value), "r" (addr), "i" (-EFAULT)); \
683 #else /* CONFIG_CPU_NO_LOAD_STORE_LR */
684 /* For CPUs without swl and sdl instructions */
685 #define _StoreW(addr, value, res, type) \
687 __asm__ __volatile__ ( \
690 "1:"type##_sb("%1", "0(%2)")"\n\t" \
691 "srl\t$1, %1, 0x8\n\t" \
692 "2:"type##_sb("$1", "1(%2)")"\n\t" \
693 "srl\t$1, $1, 0x8\n\t" \
694 "3:"type##_sb("$1", "2(%2)")"\n\t" \
695 "srl\t$1, $1, 0x8\n\t" \
696 "4:"type##_sb("$1", "3(%2)")"\n\t" \
701 ".section\t.fixup,\"ax\"\n\t" \
702 "11:\tli\t%0, %3\n\t" \
705 ".section\t__ex_table,\"a\"\n\t" \
706 STR(PTR_WD)"\t1b, 11b\n\t" \
707 STR(PTR_WD)"\t2b, 11b\n\t" \
708 STR(PTR_WD)"\t3b, 11b\n\t" \
709 STR(PTR_WD)"\t4b, 11b\n\t" \
712 : "r" (value), "r" (addr), "i" (-EFAULT) \
716 #define _StoreDW(addr, value, res) \
718 __asm__ __volatile__ ( \
721 "1:sb\t%1, 0(%2)\n\t" \
722 "dsrl\t$1, %1, 0x8\n\t" \
723 "2:sb\t$1, 1(%2)\n\t" \
724 "dsrl\t$1, $1, 0x8\n\t" \
725 "3:sb\t$1, 2(%2)\n\t" \
726 "dsrl\t$1, $1, 0x8\n\t" \
727 "4:sb\t$1, 3(%2)\n\t" \
728 "dsrl\t$1, $1, 0x8\n\t" \
729 "5:sb\t$1, 4(%2)\n\t" \
730 "dsrl\t$1, $1, 0x8\n\t" \
731 "6:sb\t$1, 5(%2)\n\t" \
732 "dsrl\t$1, $1, 0x8\n\t" \
733 "7:sb\t$1, 6(%2)\n\t" \
734 "dsrl\t$1, $1, 0x8\n\t" \
735 "8:sb\t$1, 7(%2)\n\t" \
736 "dsrl\t$1, $1, 0x8\n\t" \
741 ".section\t.fixup,\"ax\"\n\t" \
742 "11:\tli\t%0, %3\n\t" \
745 ".section\t__ex_table,\"a\"\n\t" \
746 STR(PTR_WD)"\t1b, 11b\n\t" \
747 STR(PTR_WD)"\t2b, 11b\n\t" \
748 STR(PTR_WD)"\t3b, 11b\n\t" \
749 STR(PTR_WD)"\t4b, 11b\n\t" \
750 STR(PTR_WD)"\t5b, 11b\n\t" \
751 STR(PTR_WD)"\t6b, 11b\n\t" \
752 STR(PTR_WD)"\t7b, 11b\n\t" \
753 STR(PTR_WD)"\t8b, 11b\n\t" \
756 : "r" (value), "r" (addr), "i" (-EFAULT) \
760 #endif /* CONFIG_CPU_NO_LOAD_STORE_LR */
763 #define LoadHWU(addr, value, res) _LoadHWU(addr, value, res, kernel)
764 #define LoadHWUE(addr, value, res) _LoadHWU(addr, value, res, user)
765 #define LoadWU(addr, value, res) _LoadWU(addr, value, res, kernel)
766 #define LoadWUE(addr, value, res) _LoadWU(addr, value, res, user)
767 #define LoadHW(addr, value, res) _LoadHW(addr, value, res, kernel)
768 #define LoadHWE(addr, value, res) _LoadHW(addr, value, res, user)
769 #define LoadW(addr, value, res) _LoadW(addr, value, res, kernel)
770 #define LoadWE(addr, value, res) _LoadW(addr, value, res, user)
771 #define LoadDW(addr, value, res) _LoadDW(addr, value, res)
773 #define StoreHW(addr, value, res) _StoreHW(addr, value, res, kernel)
774 #define StoreHWE(addr, value, res) _StoreHW(addr, value, res, user)
775 #define StoreW(addr, value, res) _StoreW(addr, value, res, kernel)
776 #define StoreWE(addr, value, res) _StoreW(addr, value, res, user)
777 #define StoreDW(addr, value, res) _StoreDW(addr, value, res)
779 #endif /* _ASM_MIPS_UNALIGNED_EMUL_H */