__attribute__((aligned(x))); isn't supported by old compilers #86
Labels
Bug
Something isn't working
Implemented
This has been fixed but not yet published/pushed
USB Library
This is related to the USB library (usb.c)
This is not relevant for gcc and family, only applies when using a very very old compiler.
Lines such as
cause compiler error. Simply removing the attribute it not sufficient, as the alignment is required by
osPiStartDma
(from docs: "The RDRAM virtual address (vAddr) must be 8-byte aligned"), and mis-aligned address will introduce errors (as I have learned).I considered a solution like
but unfortunately the options for "something else" do not really work as a single declaration. Here is how I modified
usb_findcart
(and other methods). My solution is to declare an array on the stack large enough to get an aligned memory address, then declare a pointer to find the first aligned address (usingOS_DCACHE_ROUNDUP_ADDR
). So this will change the existing value previously declared from a value type to a pointer, which alters subsequent method calls.The text was updated successfully, but these errors were encountered: