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