简体   繁体   English

如何在 WinMobile6 上启用 ARMv6 未对齐访问?

[英]How to enable ARMv6 unaligned access on WinMobile6?

ARMv6 introduce a great feature - unaligned memory access , which make some things in code much more simplier and faster. ARMv6 引入了一个很棒的特性——未对齐的内存访问,这使得代码中的一些东西更加简单和快速。 But microsoft gives API for it only in winCE6.但是微软只在winCE6中为其提供了API。 And most PDAs now based on WinMobile6 (which is on CE 5.x).并且大多数 PDA 现在基于 WinMobile6(基于 CE 5.x)。 And unaligned access is disabled by default :(默认情况下禁用未对齐的访问:(

I've try to set unaligned flag in CP15 register, but this doesn't work - I have a crash on read unaligned data.我尝试在 CP15 寄存器中设置未对齐标志,但这不起作用 - 我在读取未对齐数据时崩溃。

Is it possible to enable unaligned access on WinMobile6?是否可以在 WinMobile6 上启用非对齐访问?


Edit: I've found the tool, which can enable unaligned access, but I want to on/off it from my code.编辑:我找到了可以启用未对齐访问的工具,但我想从我的代码中打开/关闭它。 It's nueAdvancedProcessor .它是nueAdvancedProcessor

There is an unaligned access flag (the U bit in CP15 control register) and also an alignment fault checker (the A bit).有一个未对齐的访问标志(CP15 控制寄存器中的 U 位)和一个对齐错误检查器(A 位)。 Make sure you have the right combination for what you want to do.确保您拥有适合您想要做的事情的正确组合。 In particular, if the A bit is set, all of your unaligned accesses will cause a data abort exception, even if you have the U bit on.特别是,如果设置了 A 位,即使您打开了 U 位,所有未对齐的访问都会导致数据中止异常。 Check out the ARM docs on that - all available at http://www.arm.com .查看 ARM 文档——所有这些都可以在http://www.arm.com 上找到

In particular, you want Section A2.8.2 "Unaligned data access in ARMv6 systems" in the ARM Architecture Reference Manual.特别是,您需要 ARM 体系结构参考手册中的第 A2.8.2 节“ARMv6 系统中的未对齐数据访问”。 Document number ARM DDI 0100I.文档编号 ARM DDI 0100I。 It's titled "ARMv5 Architecture Reference Manual", but contains the initial ARMv6 information.它的标题是“ARMv5 架构参考手册”,但包含初始 ARMv6 信息。 I hope this link works: http://infocenter.arm.com/help/topic/com.arm.doc.ddi0100i/index.html我希望这个链接有效: http : //infocenter.arm.com/help/topic/com.arm.doc.ddi0100i/index.html

If you are getting Hardfault due to unaligned memory access on STM32F7 or Cortex-ARMv6, ARMv7 or ARVv8 then please refer the following link for an application note form IAR for this.如果您由于 STM32F7 或 Cortex-ARMv6、ARMv7 或 ARVv8 上的未对齐内存访问而遇到硬故障,请参阅以下链接以获取 IAR 的应用笔记表格。 https://www.iar.com/support/tech-notes/general/unexpected-usagefault-or-hardfault-exceptions/ https://www.iar.com/support/tech-notes/general/unexpected-usagefault-or-hardfault-exceptions/

Please refer this for details.详情请参考这里。 https://stackoverflow.com/a/63000125/13735764 https://stackoverflow.com/a/63000125/13735764

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM