source: soft/giet_vm/libs/common.h @ 175

Last change on this file since 175 was 175, checked in by karaoui, 12 years ago

+ Adding the init attribute to the mwmr to specify the width of the mwmr channel
+ Fixing bugs in kernels_init

File size: 1.4 KB
Line 
1//////////////////////////////////////////////////////////////////////////////////
2// File     : common.h         
3// Date     : 20/07/2012
4// Author   : mohamed karaoui
5// Copyright (c) UPMC-LIP6
6///////////////////////////////////////////////////////////////////////////////////
7
8#ifndef _COMMON_H_
9#define _COMMON_H_
10
11/**
12   the same as the C assert.
13   Taken from Mutekh(SRL API)
14 */
15#define assert(expr)                                                                                                \
16    do {                                                                                                                                \
17        if ( ! (expr) ) {                                                                                               \
18            giet_tty_printf("assertion (%s) failed on %s:%d !\n",  \
19                                                   #expr, __FILE__, __LINE__ );                                 \
20            __abort();                                                                                          \
21        }                                                                                                                               \
22    } while(0)
23
24/**
25   @this aborts the current execution.
26   Taken from Mutekh(SRL API)
27 */
28
29inline void __abort();
30
31////////////////////////////////////////////////////////////////////////////////////////
32//  mempcy()
33// GCC may requires this function. Taken from MutekH.
34////////////////////////////////////////////////////////////////////////////////////////
35void *memcpy(void *_dst, const void *_src, unsigned int size);
36
37////////////////////////////////////////////////////////////////////////////////////////
38//  memset()
39// GCC may requires this function. Taken from MutekH.
40////////////////////////////////////////////////////////////////////////////////////////
41inline void * memset(void *dst, int s, unsigned int count);
42
43#endif /* _COMMON_H_ */
Note: See TracBrowser for help on using the repository browser.