Please advise on dealing with compiler issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am adding code to the sparc64 kernel that would require reading/writing one of the new registers on M7 processor, namely MCDPER. There are three ways I know of to do this:

1. __asm__ __volatile__("rd %%mcdper, %0\n\t": "=r" (tmp)) - This is the best way to do it but the support for %%mcdper is available in binutils 2.26 and newer only. Compiling the kernel with older binutils will cause build failure.

2. __asm__ __volatile__("rd %%asr14, %0\n\t": "=r" (tmp)) - This should work independent of binutils version but it does not due to two bugs in assembler that have been fixed recently but not in a released version yet - <https://sourceware.org/ml/binutils/2016-03/msg00302.html>, <https://sourceware.org/ml/binutils/2016-03/msg00303.html>.

3. .byte 0x83,0x43,0x80,0x00 - This is byte coded equivalent of "rd %asr14, %g1". This works independent of binutils version but is ugly and requires pre-assigning a register to read MCDPER into, which does not help compiler with optimization.

Of the three options, only option 3 can work without requiring everyone compiling kernel to update to latest binutils.

Please advise on best way to proceed.

Thanks,
Khalid
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [DCCP]     [Linux ARM Development]     [Linux]     [Photo]     [Yosemite Help]     [Linux ARM Kernel]     [Linux SCSI]     [Linux x86_64]     [Linux Hams]

  Powered by Linux