获取ILL_ILLOPC(非法操作code)试图执行在Android MRC或MCR指令时 [英] Getting ILL_ILLOPC (illegal opcode) when trying to execute MRC or MCR instructions on Android

查看:9941
本文介绍了获取ILL_ILLOPC(非法操作code)试图执行在Android MRC或MCR指令时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是ARM汇编试图访问几个协处理器寄存器。每当我有类似

I'm using ARM Assembly trying to access several coprocessor registers. Whenever I have something like

mcr p15, #1, r1, c1, c0

mrc p15, #0, r0, c1, c0

我得到信号4(SIGILL),code 1(ILL_ILLOPC),故障地址80400d00 错误,这意味着有些事情是得到一个非法的(不存在的,我假设)操作code(指令)。有几种可能性。在 MRC MCR 指令本身可能是非法的,但code,无投诉编译。如果这是一个特权模式的问题,我希望看到一个 ILL_PRVOPC SIGILL来代替。

I get signal 4 (SIGILL), code 1 (ILL_ILLOPC), fault addr 80400d00 error, which means that something is getting an illegal (non-existent, I assume) operation code (instruction). There are several possibilities. The mrc and mcr instructions themselves might be illegal, but the code compiles with no complaints. If this were a privileged mode issue, I'd expect to see a ILL_PRVOPC SIGILL instead.

另一种可能是运code,它是的MRC MCR (语法的一部分 MRC {2} c为C>< q><协处理器>中#< OPC1&GT中,<保留时间&GT中,< CR n的&GT中,< CRM和GT; )可能属于违法行为。我试过可以运codeS,但我仍然得到同样的错误,相同的堆栈转储。

Another possibility is that the opcode that is a part of mrc and mcr (syntax is MRC{2}<c><q> <coproc>, #<opc1>, <Rt>, <CRn>, <CRm>) might be illegal. I've tried possible opcodes, but I'm still getting the same error and the same stack dump.

Android版是否允许一般有说明或有什么事情,我这样做是错的?别的我应该看调试?

Does Android generally allow there instructions or is it something I'm doing that's wrong? Anything else I should be looking at to debug?

推荐答案

这的确是由于provileges不足。你不能这样做,从用户模式,它会导致被转换为SIGILL / ILL_ILLOPC未定义的指令异常。 的grep -HR PRVOPC&LT;路径到Linux内核&GT; /弓/手臂得到什么,而做同样的ILLOPC会降落在你的 do_undefinstr()

It is indeed due to insufficient provileges. You cannot do that from user-mode, it causes an Undefined Instruction exception that gets translated into SIGILL/ILL_ILLOPC. grep -Hr PRVOPC <path-to-linux-kernel>/arch/arm yields nothing, while doing the same for ILLOPC will land you at do_undefinstr().

这篇关于获取ILL_ILLOPC(非法操作code)试图执行在Android MRC或MCR指令时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆