mirror of
https://github.com/fail0verflow/mini.git
synced 2024-11-24 20:26:55 +01:00
move STACK_ALIGN to utils.h
This commit is contained in:
parent
8412316c81
commit
382518d42a
8
nand.c
8
nand.c
@ -44,14 +44,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
# define NAND_debug(f, arg...)
|
# define NAND_debug(f, arg...)
|
||||||
#endif
|
#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_RESET 0xff
|
||||||
#define NAND_CHIPID 0x90
|
#define NAND_CHIPID 0x90
|
||||||
#define NAND_GETSTATUS 0x70
|
#define NAND_GETSTATUS 0x70
|
||||||
|
7
utils.h
7
utils.h
@ -204,4 +204,11 @@ static inline u32 get_cpsr(void)
|
|||||||
return data;
|
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
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user