blob: 94502b937f6d9da03491a09f5cf37499dda5b092 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
/**
* @file rtems/gxx_wrappers.h
*
* RTEMS threads compatibility routines for libgcc2.
*/
/*
* by: Rosimildo da Silva (rdasilva@connecttel.com)
*
* Used ideas from:
* W. Eric Norum
* Canadian Light Source
* University of Saskatchewan
* Saskatoon, Saskatchewan, CANADA
* eric@cls.usask.ca
*
* Eric sent some e-mail in the rtems-list as a start point for this
* module implementation.
*/
#ifndef __GCC_WRAPPERS_h
#define __GCC_WRAPPERS_h
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/**
* @defgroup GxxWrappersSupport Gxx Wrappers Support
*
* @ingroup libcsupport
*
* @brief RTEMS Threads Compatibility Routines for Libgcc2
*/
/*
* These typedefs should match with the ones defined in the file
* gcc/gthr-rtems.h in the gcc distribution.
*/
typedef void *__gthread_key_t;
typedef int __gthread_once_t;
typedef void *__gthread_mutex_t;
typedef void *__gthread_recursive_mutex_t;
int rtems_gxx_once(__gthread_once_t *once, void (*func) (void));
int rtems_gxx_key_create (__gthread_key_t *key, void (*dtor) (void *));
int rtems_gxx_key_delete (__gthread_key_t key);
void *rtems_gxx_getspecific(__gthread_key_t key);
int rtems_gxx_setspecific(__gthread_key_t key, const void *ptr);
/*
* MUTEX support
*/
void rtems_gxx_mutex_init (__gthread_mutex_t *mutex);
int rtems_gxx_mutex_lock (__gthread_mutex_t *mutex);
int rtems_gxx_mutex_destroy (__gthread_mutex_t *mutex);
int rtems_gxx_mutex_trylock (__gthread_mutex_t *mutex);
int rtems_gxx_mutex_unlock (__gthread_mutex_t *mutex);
void rtems_gxx_recursive_mutex_init(__gthread_recursive_mutex_t *mutex);
int rtems_gxx_recursive_mutex_lock(__gthread_recursive_mutex_t *mutex);
int rtems_gxx_recursive_mutex_trylock(__gthread_recursive_mutex_t *mutex);
int rtems_gxx_recursive_mutex_unlock(__gthread_recursive_mutex_t *mutex);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GCC_WRAPPERS_h */
|