This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Error: unknown mnemonic `mcr' for aarch64?

Former Member
Former Member

Here is the kernel module source code which works OK on Raspberry Pi 3, armv7 architecture: 

void enable_ccr(void *info) {
   asm volatile ("MCR p15, 0, %0, c9, c14, 0" :: "r" (1));
   asm volatile ("MCR p15, 0, %0, c9, c12, 0\t\n" :: "r"(1));
   asm volatile ("MCR p15, 0, %0, c9, c12, 1\t\n" :: "r"(0x80000000));
}

I have now switched my Raspberry Pi to 64-bit Linux Ubuntu OS, so the architecture is aarch64.

When I try to compile the source, I get error: 

Error: unknown mnemonic `mcr' -- `mcr p15,0,x0,c9,c14,0'

How do I fix this?