ARM v7 中的未对齐内存访问 [英] Unaligned memory access in ARM v7

查看:25
本文介绍了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屋!

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