From 382518d42a2b79bfee2330d29f681b64b085d68a Mon Sep 17 00:00:00 2001 From: bushing Date: Sat, 2 May 2009 03:56:32 -0700 Subject: [PATCH] move STACK_ALIGN to utils.h --- nand.c | 8 -------- utils.h | 7 +++++++ 2 files changed, 7 insertions(+), 8 deletions(-) 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