blob: a1467b5eaddf1c75b131b803b2a3954fe4aa7e17 [file] [log] [blame]
Simon Glass3ff6fe52020-02-03 07:36:05 -07001/* 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
9
10void *malloc(size_t size);
11void free(void *ptr);
12void *calloc(size_t nmemb, size_t size);
13void *realloc(void *ptr, size_t size);
14void *reallocarray(void *ptr, size_t nmemb, size_t size);
15
16/*
17 * This header allows calling the system allocation routines. It makes no
18 * sense to also include U-Boot's malloc.h since that redfines malloc to
19 * have a 'dl' prefix. These two implementations cannot be mixed and matched
20 * in the same file.
21 */
22#ifdef __MALLOC_H__
23#error "This sandbox header file cannot be included with malloc.h"
24#endif
25
26#endif