MCUX CLNS
MCUX Crypto Library Normal Secure
mcuxClOscca_Memory.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------*/
2 /* Copyright 2016, 2021 NXP */
3 /* */
4 /* NXP Confidential. This software is owned or controlled by NXP and may */
5 /* only be used strictly in accordance with the applicable license terms. */
6 /* By expressly accepting such terms or by downloading, installing, */
7 /* activating and/or otherwise using the software, you are agreeing that */
8 /* you have read, and that you agree to comply with and are bound by, such */
9 /* license terms. If you do not agree to be bound by the applicable license */
10 /* terms, then you may not retain, install, activate or otherwise use the */
11 /* software. */
12 /*--------------------------------------------------------------------------*/
13 /* Security Classification: Company Confidential */
14 /*--------------------------------------------------------------------------*/
15 
23 #ifndef MCUXCLOSCCA_MEMORY_H_
24 #define MCUXCLOSCCA_MEMORY_H_
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 #define mcuxClOscca_alignAddress(address) \
31  ((void*)( (((size_t)(address)) + (sizeof(size_t) - 1U)) \
32  & ((size_t)(~(sizeof(size_t) - 1U))) ))
33 
34 #define mcuxClOscca_alignSize(size) \
35  ((size_t)(((size_t)(size)) + (sizeof(size_t) - 1U)) \
36  & ((size_t)(~(sizeof(size_t) - 1U))) )
37 
38 #define mcuxClOscca_alignAddressWithOffset(address, offset) \
39  ((void*)( (((size_t)(address) + (size_t)(offset)) + (sizeof(size_t) - 1U)) \
40  & ((size_t)(~(sizeof(size_t) - 1U))) ))
41 
42 #define mcuxClOscca_alignAddressToBoundary(address, boundary) \
43  ((void*)( (((size_t)(address)) + (boundary - 1U)) \
44  & ((size_t)(~(boundary - 1U))) ))
45 
46 #ifdef __cplusplus
47 } /* extern "C" */
48 #endif
49 
50 #endif /* MCUXCLOSCCA_MEMORY_H_ */