blob: 8aaaa9cb87bd1196a97061dbbd2d854b01795f20 [file] [log] [blame]
Simon Glass30f92052020-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
Simon Glass1a3e39b2022-09-06 20:27:00 -06009#define __ASM_MALLOC_H
Simon Glass30f92052020-02-03 07:36:05 -070010
11void *malloc(size_t size);
12void free(void *ptr);
13void *calloc(size_t nmemb, size_t size);
14void *realloc(void *ptr, size_t size);
15void *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