diff --git a/nand.c b/nand.c index 93eb173..b030a70 100644 --- a/nand.c +++ b/nand.c @@ -44,14 +44,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # define NAND_debug(f, arg...) #endif -#define STACK_ALIGN(type, name, cnt, alignment) \ -u8 _al__##name[((sizeof(type)*(cnt)) + (alignment) + \ -(((sizeof(type)*(cnt))%(alignment)) > 0 ? ((alignment) - \ -((sizeof(type)*(cnt))%(alignment))) : 0))]; \ -type *name = (type*)(((u32)(_al__##name)) + ((alignment) - (( \ -(u32)(_al__##name))&((alignment)-1)))) - - #define NAND_RESET 0xff #define NAND_CHIPID 0x90 #define NAND_GETSTATUS 0x70 diff --git a/utils.h b/utils.h index cf517e2..e52954a 100644 --- a/utils.h +++ b/utils.h @@ -204,4 +204,11 @@ static inline u32 get_cpsr(void) return data; } +#define STACK_ALIGN(type, name, cnt, alignment) \ +u8 _al__##name[((sizeof(type)*(cnt)) + (alignment) + \ +(((sizeof(type)*(cnt))%(alignment)) > 0 ? ((alignment) - \ +((sizeof(type)*(cnt))%(alignment))) : 0))]; \ +type *name = (type*)(((u32)(_al__##name)) + ((alignment) - (( \ +(u32)(_al__##name))&((alignment)-1)))) + #endif