diff options
author | Jordan Niethe <jniethe5@gmail.com> | 2019-04-02 10:43:24 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.ibm.com> | 2019-05-20 14:21:57 +1000 |
commit | 6c74b8e4dda1d37ba18c2efe5caf789dcce5776b (patch) | |
tree | dda41392ba40b92a2fe3154163e884154d611e48 /include | |
parent | 085dbf049050ef6f4e2a0ced06b084dcb1e4ce23 (diff) | |
download | skiboot-6c74b8e4dda1d37ba18c2efe5caf789dcce5776b.zip skiboot-6c74b8e4dda1d37ba18c2efe5caf789dcce5776b.tar.gz skiboot-6c74b8e4dda1d37ba18c2efe5caf789dcce5776b.tar.bz2 |
include/mem_region-malloc: Define calloc for CCAN Heap
We would like to be able to use dump_trace to dump multiple trace
buffers at a time. The entries should be displayed in timestamp order.
As each buffer is already ordered on timestamp, a k-way merge is an
efficient method to sort the buffers together by timestamp. A heap can
be used to implement a k-way merge. As CCAN is already included in
Skiboot, use the CCAN heap. The heap uses the calloc function which is
currently not defined in skiboot. Prepare for adding this heap by
defining calloc. Remove local calloc definition from libffs.c.
Signed-off-by: Jordan Niethe <jniethe5@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/mem_region-malloc.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/mem_region-malloc.h b/include/mem_region-malloc.h index 58027ae..41e19de 100644 --- a/include/mem_region-malloc.h +++ b/include/mem_region-malloc.h @@ -31,6 +31,7 @@ void *__memalign(size_t boundary, size_t size, const char *location) __warn_unus #define malloc(size) __malloc(size, __location__) #define zalloc(size) __zalloc(size, __location__) +#define calloc(nmemb, size) __zalloc(((nmemb) * (size)), __location__) #define realloc(ptr, size) __realloc(ptr, size, __location__) #define free(ptr) __free(ptr, __location__) #define memalign(boundary, size) __memalign(boundary, size, __location__) |