e2b37e6fe9c74c1a832a45463ae1759a538549f0
[coreboot.git] / src / include / stdlib.h
1 #ifndef STDLIB_H
2 #define STDLIB_H
3
4 #include <stddef.h>
5
6 #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
7
8 #define MIN(a,b) ((a) < (b) ? (a) : (b))
9 #define MAX(a,b) ((a) > (b) ? (a) : (b))
10
11 #ifndef __ROMCC__
12 extern void *malloc(size_t size);
13 void free(void *ptr);
14
15 /* Extensions to malloc... */
16 typedef size_t malloc_mark_t;
17 void malloc_mark(malloc_mark_t *place);
18 void malloc_release(malloc_mark_t *place);
19 #endif
20
21 #endif /* STDLIB_H */