Mistake on this page?
Report an issue in GitHub or email us
tfm_utils.h
1 /*
2  * Copyright (c) 2018-2019, Arm Limited. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 #ifndef __TFM_UTILS_H__
8 #define __TFM_UTILS_H__
9 
10 /* CPU spin here */
11 void tfm_panic(void);
12 
13 /* Assert and spin */
14 #define TFM_ASSERT(cond) \
15  do { \
16  if (!(cond)) { \
17  printf("Assert:%s:%d", __FUNCTION__, __LINE__); \
18  while (1) \
19  ; \
20  } \
21  } while (0)
22 
23 /* Get container structure start address from member */
24 #define TFM_GET_CONTAINER_PTR(ptr, type, member) \
25  (type *)((unsigned long)(ptr) - offsetof(type, member))
26 
27 int32_t tfm_bitcount(uint32_t n);
28 
29 #endif
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.