On Mon, 2015-03-16 at 16:30 +0530, Anshuman Khandual wrote: > On 03/16/2015 12:27 PM, Michael Ellerman wrote: > > This adds a test of the switch_endian() syscall we added in the previous > > commit. > > > > We test it by calling the endian switch syscall, and then executing some > > code in the other endian to check everything went as expected. That code > > checks registers we expect to be maintained are, and then writes to > > stdout. If the endian switch failed to happen that code sequence will be > > illegal and cause the test to abort. > > > > We then switch back to the original endian, do the same checks and > > finally write a success message and exit(0). > > > > Signed-off-by: Michael Ellerman <m...@ellerman.id.au> > > Hey Michael, > > Did a quick test, passes on LE but seems like failing on BE. > > On LE: > > Hello wrong-endian world > Hello right-endian world > success: switch_endian_test > > on BE: > > Hello wrong-endian world (returns 176) > > The previous version of the test was passing both on LE > and BE (after applying the compiler trick in the assembly)
Hmm, odd. Works for me: $ uname -a Linux bebuntu 4.0.0-rc3-00002-g9dd2601a490a #1 SMP Fri Mar 13 15:52:11 AEDT 2015 ppc64 ppc64 ppc64 GNU/Linux $ make cc -O2 -Wall -g -nostdlib -m64 -c -o check.o check.S objcopy -j .text --reverse-bytes=4 -O binary check.o check-reversed.o hexdump -v -e '/1 ".byte 0x%02X\n"' check-reversed.o > check-reversed.S cc -O2 -Wall -g -nostdlib -m64 switch_endian_test.S check-reversed.S -o switch_endian_test $ ./switch_endian_test Hello wrong-endian world Hello right-endian world success: switch_endian_test What are you seeing exactly? cheers _______________________________________________ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev