1 /*
2  * Arm SCP/MCP Software
3  * Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  */
7 
8 #include <stdlib.h>
9 
10 #ifdef __ARMCC_VERSION
aligned_alloc(size_t alignment,size_t size)11 void *aligned_alloc(size_t alignment, size_t size)
12 {
13     int error;
14     void *memptr;
15 
16     error = posix_memalign(&memptr, alignment, size);
17 
18     return (error == 0 ? memptr : NULL);
19 }
20 #endif
21