1 | /* |
---|
2 | FUNCTION |
---|
3 | <<__retarget_lock_init>>, <<__retarget_lock_init_recursive>>, <<__retarget_lock_close>>, <<__retarget_lock_close_recursive>>, <<__retarget_lock_acquire>>, <<__retarget_lock_acquire_recursive>>, <<__retarget_lock_try_acquire>>, <<__retarget_lock_try_acquire_recursive>>, <<__retarget_lock_release>>, <<__retarget_lock_release_recursive>>---locking routines |
---|
4 | |
---|
5 | INDEX |
---|
6 | __lock___sinit_recursive_mutex |
---|
7 | INDEX |
---|
8 | __lock___sfp_recursive_mutex |
---|
9 | INDEX |
---|
10 | __lock___atexit_recursive_mutex |
---|
11 | INDEX |
---|
12 | __lock___at_quick_exit_mutex |
---|
13 | INDEX |
---|
14 | __lock___malloc_recursive_mutex |
---|
15 | INDEX |
---|
16 | __lock___env_recursive_mutex |
---|
17 | INDEX |
---|
18 | __lock___tz_mutex |
---|
19 | INDEX |
---|
20 | __lock___dd_hash_mutex |
---|
21 | INDEX |
---|
22 | __lock___arc4random_mutex |
---|
23 | |
---|
24 | INDEX |
---|
25 | __retarget_lock_init |
---|
26 | INDEX |
---|
27 | __retarget_lock_init_recursive |
---|
28 | INDEX |
---|
29 | __retarget_lock_close |
---|
30 | INDEX |
---|
31 | __retarget_lock_close_recursive |
---|
32 | INDEX |
---|
33 | __retarget_lock_acquire |
---|
34 | INDEX |
---|
35 | __retarget_lock_acquire_recursive |
---|
36 | INDEX |
---|
37 | __retarget_lock_try_acquire |
---|
38 | INDEX |
---|
39 | __retarget_lock_try_acquire_recursive |
---|
40 | INDEX |
---|
41 | __retarget_lock_release |
---|
42 | INDEX |
---|
43 | __retarget_lock_release_recursive |
---|
44 | |
---|
45 | SYNOPSIS |
---|
46 | #include <lock.h> |
---|
47 | struct __lock __lock___sinit_recursive_mutex; |
---|
48 | struct __lock __lock___sfp_recursive_mutex; |
---|
49 | struct __lock __lock___atexit_recursive_mutex; |
---|
50 | struct __lock __lock___at_quick_exit_mutex; |
---|
51 | struct __lock __lock___malloc_recursive_mutex; |
---|
52 | struct __lock __lock___env_recursive_mutex; |
---|
53 | struct __lock __lock___tz_mutex; |
---|
54 | struct __lock __lock___dd_hash_mutex; |
---|
55 | struct __lock __lock___arc4random_mutex; |
---|
56 | |
---|
57 | void __retarget_lock_init (_LOCK_T * <[lock_ptr]>); |
---|
58 | void __retarget_lock_init_recursive (_LOCK_T * <[lock_ptr]>); |
---|
59 | void __retarget_lock_close (_LOCK_T <[lock]>); |
---|
60 | void __retarget_lock_close_recursive (_LOCK_T <[lock]>); |
---|
61 | void __retarget_lock_acquire (_LOCK_T <[lock]>); |
---|
62 | void __retarget_lock_acquire_recursive (_LOCK_T <[lock]>); |
---|
63 | int __retarget_lock_try_acquire (_LOCK_T <[lock]>); |
---|
64 | int __retarget_lock_try_acquire_recursive (_LOCK_T <[lock]>); |
---|
65 | void __retarget_lock_release (_LOCK_T <[lock]>); |
---|
66 | void __retarget_lock_release_recursive (_LOCK_T <[lock]>); |
---|
67 | |
---|
68 | DESCRIPTION |
---|
69 | Newlib was configured to allow the target platform to provide the locking |
---|
70 | routines and static locks at link time. As such, a dummy default |
---|
71 | implementation of these routines and static locks is provided for |
---|
72 | single-threaded application to link successfully out of the box on bare-metal |
---|
73 | systems. |
---|
74 | |
---|
75 | For multi-threaded applications the target platform is required to provide |
---|
76 | an implementation for @strong{all} these routines and static locks. If some |
---|
77 | routines or static locks are missing, the link will fail with doubly defined |
---|
78 | symbols. |
---|
79 | |
---|
80 | PORTABILITY |
---|
81 | These locking routines and static lock are newlib-specific. Supporting OS |
---|
82 | subroutines are required for linking multi-threaded applications. |
---|
83 | */ |
---|
84 | |
---|
85 | /* dummy lock routines and static locks for single-threaded apps */ |
---|
86 | |
---|
87 | #ifndef __SINGLE_THREAD__ |
---|
88 | |
---|
89 | #include <sys/lock.h> |
---|
90 | |
---|
91 | struct __lock { |
---|
92 | char unused; |
---|
93 | }; |
---|
94 | |
---|
95 | struct __lock __lock___sinit_recursive_mutex; |
---|
96 | struct __lock __lock___sfp_recursive_mutex; |
---|
97 | struct __lock __lock___atexit_recursive_mutex; |
---|
98 | struct __lock __lock___at_quick_exit_mutex; |
---|
99 | struct __lock __lock___malloc_recursive_mutex; |
---|
100 | struct __lock __lock___env_recursive_mutex; |
---|
101 | struct __lock __lock___tz_mutex; |
---|
102 | struct __lock __lock___dd_hash_mutex; |
---|
103 | struct __lock __lock___arc4random_mutex; |
---|
104 | |
---|
105 | void |
---|
106 | __retarget_lock_init (_LOCK_T *lock) |
---|
107 | { |
---|
108 | } |
---|
109 | |
---|
110 | void |
---|
111 | __retarget_lock_init_recursive(_LOCK_T *lock) |
---|
112 | { |
---|
113 | } |
---|
114 | |
---|
115 | void |
---|
116 | __retarget_lock_close(_LOCK_T lock) |
---|
117 | { |
---|
118 | } |
---|
119 | |
---|
120 | void |
---|
121 | __retarget_lock_close_recursive(_LOCK_T lock) |
---|
122 | { |
---|
123 | } |
---|
124 | |
---|
125 | void |
---|
126 | __retarget_lock_acquire (_LOCK_T lock) |
---|
127 | { |
---|
128 | } |
---|
129 | |
---|
130 | void |
---|
131 | __retarget_lock_acquire_recursive (_LOCK_T lock) |
---|
132 | { |
---|
133 | } |
---|
134 | |
---|
135 | int |
---|
136 | __retarget_lock_try_acquire(_LOCK_T lock) |
---|
137 | { |
---|
138 | return 1; |
---|
139 | } |
---|
140 | |
---|
141 | int |
---|
142 | __retarget_lock_try_acquire_recursive(_LOCK_T lock) |
---|
143 | { |
---|
144 | return 1; |
---|
145 | } |
---|
146 | |
---|
147 | void |
---|
148 | __retarget_lock_release (_LOCK_T lock) |
---|
149 | { |
---|
150 | } |
---|
151 | |
---|
152 | void |
---|
153 | __retarget_lock_release_recursive (_LOCK_T lock) |
---|
154 | { |
---|
155 | } |
---|
156 | |
---|
157 | #endif /* !defined(__SINGLE_THREAD__) */ |
---|