本文介绍了AARCH64 上不存在 MCR 和 MRC?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试基于 Board 在 AARCH64 上编译mrc"和mcr"指令,但我看到以下错误消息

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'

我尝试查看内核源代码/arch/arm64,但没有在没有仿真的情况下使用 mcr&&mrc.

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

是语法问题吗?

推荐答案

您应该将这些替换为适当的 msr 说明.例如,arch/arm/include/asm/arch_timer.h 有:

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));

arch/arm64/include/asm/arch_timer.h 有:

case ARCH_TIMER_REG_CTRL:
    asm volatile("msr cntv_ctl_el0,  %0" : : "r" (val));

这篇关于AARCH64 上不存在 MCR 和 MRC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-30 23:00