summaryrefslogtreecommitdiffstats
path: root/firmware/include/dbgcheck.h
blob: 0b38627d11cdeb810e3ee9c1fc1d2ab66131bfc1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef __DBGCHECK_H__
#define __DBGCHECK_H__

#include <stdbool.h>

#ifdef DEBUG
 #if (CONFIG_PLATFORM & PLATFORM_NATIVE)
  /* check whether a function is inside the valid memory location */
  #define IS_FUNCPTR(fp) ({/
     extern char _text[];/
     extern char _etext[];/
     ((((char *)(fp)) >= _text) && (((char *)(fp)) < _etext)/
  })
 #else
  /* check whether a function is inside the valid memory location */
  #define IS_FUNCPTR(fp) (((char*)(fp)) != NULL)
 #endif
#else
 /* check whether a function is inside the valid memory location */
 #define IS_FUNCPRT (fp) true
#endif


#endif // #ifndef __DBGCHECK_H__