Geeks With Blogs
Kate Moss' Open Space

ARM supports unaligned access and CE provides a kernel IOCTL_KLIB_UNALIGNENABLE (refer to http://msdn.microsoft.com/en-us/library/ee482755(WinEmbedded.60).aspx for details).
Application can use this IOCTL or its helper function, KLibUnalignedAccessEnable, to enable/disable unaligned access.
But for some reason, this IOCTL does not work in CE7 under user mode, a workaround is to delegate to a kernel mode library/driver to issue the IOCTL.
Or you can use following code to enable it on startup

#include <armintr.h>

OEMInit() {
...

ULONG SCTLR;

...

SCTLR = (ULONG)_MoveFromCoprocessor (15, 0, 1, 0, 0);
SCTLR &= ~0x2;  // disable the A bit
_MoveToCoprocessor (SCTLR, 15, 0, 1, 0, 0);

...

}

Posted on Saturday, July 2, 2011 5:31 PM | Back to top


Comments on this post: Unaligned Access on ARM

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Kate Moss' Open Space | Powered by: GeeksWithBlogs.net