"Illegal instruction" appear when try to get PRID by mfc0 instruction on Loongson-3A R4 (MIPS64)?

50 Views Asked by At

I want to get PRID in MIPS64 platform with below C code, the make phase passes and the binary is generated successfully, but illegal instruction appear when run the binary. What should do to solve this problem?

 uint32_t prid = 0;
  __asm__ __volatile__ ("mfc0 %0, $15" : "=r" (prid));

I expect that the PRID in the MIPS64 platform should be read successfully with the asm instruction in C programming language.

0

There are 0 best solutions below