How to enable ARMv6 unaligned access on WinMobile6?

By : zxcat
Source: Stackoverflow.com
Question!

ARMv6 introduce a great feature - unaligned memory access, which make some things in code much more simplier and faster. But microsoft gives API for it only in winCE6. And most PDAs now based on WinMobile6 (which is on 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.

Is it possible to enable unaligned access on 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.

By : zxcat


Answers

There is an unaligned access flag (the U bit in CP15 control register) and also an alignment fault checker (the A bit). 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. Check out the ARM docs on that - all available at http://www.arm.com.

In particular, you want Section A2.8.2 "Unaligned data access in ARMv6 systems" in the ARM Architecture Reference Manual. Document number ARM DDI 0100I. It's titled "ARMv5 Architecture Reference Manual", but contains the initial ARMv6 information. I hope this link works: http://infocenter.arm.com/help/topic/com.arm.doc.ddi0100i/index.html



This video can help you solving your question :)
By: admin