util: move ARRAY_SIZE/CONTAINER_OF to non-ASM part of file

These macros have C language-isms and cannot be used from assembly code.

Change-Id: I07ffc27411300339e08ae7ef9c19249903be4774
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
This commit is contained in:
Benjamin Walsh 2015-08-12 10:48:18 -04:00 committed by Anas Nashif
commit 0304cbc36d

View file

@ -42,12 +42,12 @@ Misc utilities usable by nanokernel, microkernel, and application code.
extern "C" {
#endif
#ifndef _ASMLANGUAGE
#define ARRAY_SIZE(array) ((unsigned long)(sizeof(array) / sizeof((array)[0])))
#define CONTAINER_OF(ptr, type, field) \
((type *)(((char *)(ptr)) - offsetof(type, field)))
#ifndef _ASMLANGUAGE
/* round "x" up/down to next multiple of "align" (which must be a power of 2) */
#define ROUND_UP(x, align) \
(((unsigned long)(x) + ((unsigned long)align - 1)) & \