source: soft/giet_vm/applications/rosenfeld/nrc2/include/nrc_os_config.h

Last change on this file was 826, checked in by meunier, 7 years ago
  • Mise à jour NR2 et Rosenfeld
File size: 1.3 KB
Line 
1
2
3#define GIETVM 1
4#define LINUX 2
5
6#if TARGET_OS == GIETVM
7    #define tokenize(x) #x
8    #define printf(...)  giet_tty_printf(__VA_ARGS__)
9    #define assert(x)    giet_pthread_assert(x, "Assert failed.")
10
11    #define open(x, y)         giet_fat_open(x, y)
12    #define close(x)           giet_fat_close(x)
13    #define read(x, y, z)      giet_fat_read(x, y, z)
14    #define write(x, y, z)     giet_fat_write(x, y, z)
15    #define fprintf(x, ...)    giet_fat_fprintf(x, __VA_ARGS__)
16    //#define fscanf(x, ...)  ;
17    #define exit(x)            giet_pthread_exit(NULL)
18
19    #define pthread_barrier_t           giet_barrier_t
20    #define pthread_spinlock_t          user_lock_t
21    #define pthread_spin_lock(x)        lock_acquire(x)
22    #define pthread_spin_unlock(x)      lock_release(x)
23    #define pthread_spin_init(x, y)     lock_init(x)
24    #define pthread_mutex_t             user_lock_t
25    #define pthread_mutex_lock(x)       lock_acquire(x)
26    #define pthread_mutex_unlock(x)     lock_release(x)
27    #define pthread_mutex_init(x, y)    lock_init(x)
28    #define pthread_barrier_init(x,y,z) barrier_init(x, z)
29    #define pthread_barrier_wait(x)     barrier_wait(x)
30    #define pthread_barrier_destroy(x)
31    #define pthread_create(x,y,z,t)     giet_pthread_create(x,y,z,t)
32    #define pthread_join(x,y)           giet_pthread_join(x,y)
33#endif
34
35
Note: See TracBrowser for help on using the repository browser.