Simon Glass | 30f9205 | 2020-02-03 07:36:05 -0700 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
| 2 | /* |
| 3 | * Sandbox access to system malloc (i.e. not U-Boot's) |
| 4 | * |
| 5 | * Copyright 2020 Google LLC |
| 6 | */ |
| 7 | |
| 8 | #ifndef __ASM_MALLOC_H |
Simon Glass | 1a3e39b | 2022-09-06 20:27:00 -0600 | [diff] [blame] | 9 | #define __ASM_MALLOC_H |
Simon Glass | 30f9205 | 2020-02-03 07:36:05 -0700 | [diff] [blame] | 10 | |
| 11 | void *malloc(size_t size); |
| 12 | void free(void *ptr); |
| 13 | void *calloc(size_t nmemb, size_t size); |
| 14 | void *realloc(void *ptr, size_t size); |
| 15 | void *reallocarray(void *ptr, size_t nmemb, size_t size); |
| 16 | |
| 17 | /* |
| 18 | * This header allows calling the system allocation routines. It makes no |
| 19 | * sense to also include U-Boot's malloc.h since that redfines malloc to |
| 20 | * have a 'dl' prefix. These two implementations cannot be mixed and matched |
| 21 | * in the same file. |
| 22 | */ |
| 23 | #ifdef __MALLOC_H__ |
| 24 | #error "This sandbox header file cannot be included with malloc.h" |
| 25 | #endif |
| 26 | |
| 27 | #endif |