Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MCR and MRC does not exist on AARCH64?

I am trying to compile "mrc" and "mcr" instruction on AARCH64 based on Board but I am seeing below error message

   tmp/ccqOHmrK.s: Assembler messages:
  /tmp/ccqOHmrK.s:43: Error: unknown mnemonic `mrc' -- `mrc p15,0,x0,c14,c3,1'
  /tmp/ccqOHmrK.s:53: Error: unknown mnemonic `mrc' -- `mrc p15,0,x2,c14,c3,0'

I tried looking into the kernel source /arch/arm64 but no where mcr&&mrc has been used without emulation.

Is it some syntax issue?

like image 684
Amit Singh Tomar Avatar asked Sep 03 '15 11:09

Amit Singh Tomar


1 Answers

You should replace these with the appropriate msr instructions. For example, arch/arm/include/asm/arch_timer.h has:

case ARCH_TIMER_REG_CTRL:
    asm volatile("mcr p15, 0, %0, c14, c3, 1" : : "r" (val));

The counterpart in arch/arm64/include/asm/arch_timer.h has:

case ARCH_TIMER_REG_CTRL:
    asm volatile("msr cntv_ctl_el0,  %0" : : "r" (val));
like image 146
Jester Avatar answered Nov 16 '22 05:11

Jester