ARM v7中未对齐的内存访问 [英] Unaligned memory access in ARM v7
本文介绍了ARM v7中未对齐的内存访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您能帮我用代码("C"或ARM汇编)将内存区域标记为正常",从而允许未对齐的内存访问吗?我了解我们需要先启用MMU,然后再执行此操作.我是ARM体系结构的新手.
Can you help me with code ('C' or ARM assembly) for marking a memory region as "Normal", thereby allowing unaligned memory access? I understand we need to enable MMU before doing this. I'm new to ARM architecture.
谢谢!
推荐答案
如果您需要的只是非对齐访问,请尝试将cp15 sctlr [1](对齐位)设置为0.
If all you need is unaligned access, try setting the cp15 sctlr[1] (alignment bit) to 0.
mrc p15, 0, r0, c1, c0, 0
bic r0, r0, #2
mcr p15, 0, r0, c1, c0, 0
我不知道是否需要为此启用MMU.
I don't know whether MMU needs to be enabled for this or not.
这篇关于ARM v7中未对齐的内存访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文