1 /* SPDX-License-Identifier: GPL-2.0 */
7 .ascii "success: switch_endian_test\n\0"
11 .ascii "failure: switch_endian_test\n\0"
16 .8byte 0x5555AAAA5555AAAA
20 /* Load the pattern */
21 ld r15, pattern@TOC(%r2)
23 /* Setup CR, only CR2-CR4 are maintained */
28 /* Load the pattern slightly modified into the registers */
40 /* r9 - r12 are clobbered */
45 /* Skip r15 we're using it */
65 * Call the syscall to switch endian.
66 * It clobbers r9-r12, XER, CTR and CR0-1,5-7.
68 li r0, __NR_switch_endian
71 tdi 0, 0, 0x48 // b +8 if the endian was switched
72 b .Lfail // exit if endian didn't switch
74 #include "check-reversed.S"
76 /* Flip back, r0 already has the switch syscall number */
77 .long 0x02000044 /* sc */
81 ld r4, success_message@got(%r2)
82 li r5, 28 // strlen(success_message)
83 li r14, 0 // exit status
94 ld r4, failure_message@got(%r2)
95 li r5, 28 // strlen(failure_message)