There is some kernel code that is playing with uncached memory in an unaligned fashion and halting the system, and hardware-supported unaligned access only works for cached memory. I want changes to existing code to be minimal. Is there a way to tell the compiler to access the memory a byte at a time, equivalent to the __unaligned keyword in MS C++?
Code:
unsigned char* uncachedMemory = (unsigned char*)GetUncachedMemory(); // returns 8 bytes of uncached memory, with an address that is 4-byte aligned unsigned int* somePointer = (unsigned int*)(uncachedMemory+1); *somePointer = 0xFFFFFFFFu; // whoops! - halts system
Comment