e09f7ef00a
GNU CC coverage needs free() and it's highly desirable to leave the code as genuine as possible. Change-Id: I4c821b9d211ef7a8e7168dc5e3116730693999c6 Signed-off-by: Stefan Reinauer <reinauer@google.com> Reviewed-on: http://review.coreboot.org/2051 Tested-by: build bot (Jenkins) Reviewed-by: David Hendricks <dhendrix@chromium.org>
21 lines
508 B
C
21 lines
508 B
C
#ifndef STDLIB_H
|
|
#define STDLIB_H
|
|
|
|
#include <stddef.h>
|
|
|
|
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
|
|
|
|
#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1UL)
|
|
#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
|
|
|
|
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
|
#define MAX(a,b) ((a) > (b) ? (a) : (b))
|
|
|
|
#if !defined(__PRE_RAM__)
|
|
void *memalign(size_t boundary, size_t size);
|
|
void *malloc(size_t size);
|
|
/* We never free memory */
|
|
static inline void free(void *ptr) {}
|
|
#endif
|
|
|
|
#endif /* STDLIB_H */
|