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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
|
@subheading chx_fatal
@anchor{chx_fatal}
@deftypefun {void} {chx_fatal} (uint32_t @var{err_code})
@var{err_code}: Error code
When it detects a coding error, this function will be called to
stop further execution of code. It never returns.
@end deftypefun
@subheading chopstx_create
@anchor{chopstx_create}
@deftypefun {chopstx_t} {chopstx_create} (uint32_t @var{flags_and_prio}, uint32_t @var{stack_addr}, size_t @var{stack_size}, voidfunc @var{thread_entry}, void * @var{arg})
@var{flags_and_prio}: Flags and priority
@var{stack_addr}: Stack address
@var{stack_size}: Size of stack
@var{thread_entry}: Entry function of new thread
@var{arg}: Argument to the thread entry function
Create a thread.
@end deftypefun
@subheading chopstx_usec_wait_var
@anchor{chopstx_usec_wait_var}
@deftypefun {void} {chopstx_usec_wait_var} (uint32_t * @var{var})
@var{var}: Pointer to usec
Sleep for micro second specified by @var{var}.
Another thread can clear @var{var} on condition (to avoid this thread going into sleep).
@end deftypefun
@subheading chopstx_usec_wait
@anchor{chopstx_usec_wait}
@deftypefun {void} {chopstx_usec_wait} (uint32_t @var{usec})
@var{usec}: number of micro seconds
Sleep for @var{usec}.
@end deftypefun
@subheading chopstx_mutex_init
@anchor{chopstx_mutex_init}
@deftypefun {void} {chopstx_mutex_init} (chopstx_mutex_t * @var{mutex})
@var{mutex}: Mutex
Initialize @var{mutex}.
@end deftypefun
@subheading chopstx_mutex_lock
@anchor{chopstx_mutex_lock}
@deftypefun {void} {chopstx_mutex_lock} (chopstx_mutex_t * @var{mutex})
@var{mutex}: Mutex
Lock @var{mutex}.
@end deftypefun
@subheading chopstx_mutex_unlock
@anchor{chopstx_mutex_unlock}
@deftypefun {void} {chopstx_mutex_unlock} (chopstx_mutex_t * @var{mutex})
@var{mutex}: Mutex
Unlock @var{mutex}.
@end deftypefun
@subheading chopstx_cond_init
@anchor{chopstx_cond_init}
@deftypefun {void} {chopstx_cond_init} (chopstx_cond_t * @var{cond})
@var{cond}: Condition variable
Initialize @var{cond}.
@end deftypefun
@subheading chopstx_cond_wait
@anchor{chopstx_cond_wait}
@deftypefun {void} {chopstx_cond_wait} (chopstx_cond_t * @var{cond}, chopstx_mutex_t * @var{mutex})
@var{cond}: Condition variable
@var{mutex}: Associated mutex
Wait for @var{cond} with @var{mutex}.
@end deftypefun
@subheading chopstx_cond_signal
@anchor{chopstx_cond_signal}
@deftypefun {void} {chopstx_cond_signal} (chopstx_cond_t * @var{cond})
@var{cond}: Condition variable
Wake up a thread waiting on @var{cond}.
@end deftypefun
@subheading chopstx_cond_broadcast
@anchor{chopstx_cond_broadcast}
@deftypefun {void} {chopstx_cond_broadcast} (chopstx_cond_t * @var{cond})
@var{cond}: Condition Variable
Wake up all thread winting on @var{cond}.
@end deftypefun
@subheading chopstx_claim_irq
@anchor{chopstx_claim_irq}
@deftypefun {void} {chopstx_claim_irq} (chopstx_intr_t * @var{intr}, uint8_t @var{irq_num})
@var{intr}: Pointer to INTR structure
@var{irq_num}: IRQ Number (hardware specific)
Claim interrupt @var{intr} with @var{irq_num} for this thread.
@end deftypefun
@subheading chopstx_release_irq
@anchor{chopstx_release_irq}
@deftypefun {void} {chopstx_release_irq} (chopstx_intr_t * @var{intr0})
@var{intr0}: Interrupt request to be unregistered
Release the interrupt request specified by @var{intr0}.
@end deftypefun
@subheading chopstx_intr_wait
@anchor{chopstx_intr_wait}
@deftypefun {void} {chopstx_intr_wait} (chopstx_intr_t * @var{intr})
@var{intr}: Pointer to INTR structure
Wait for the interrupt @var{intr} to be occured.
@end deftypefun
@subheading chopstx_cleanup_push
@anchor{chopstx_cleanup_push}
@deftypefun {void} {chopstx_cleanup_push} (struct chx_cleanup * @var{clp})
@var{clp}: Pointer to clean-up structure
Register a clean-up structure.
@end deftypefun
@subheading chopstx_cleanup_pop
@anchor{chopstx_cleanup_pop}
@deftypefun {void} {chopstx_cleanup_pop} (int @var{execute})
@var{execute}: Execute the clen-up function on release
Unregister a clean-up structure. When @var{execute} is non-zero, the
clean-up will be executed.
@end deftypefun
@subheading chopstx_exit
@anchor{chopstx_exit}
@deftypefun {void} {chopstx_exit} (void * @var{retval})
@var{retval}: Return value (to be caught by a joining thread)
Calling this function terminates the execution of thread, after
calling clean up functions. If the calling thread still holds
mutexes, they will be released. If the calling thread claiming
IRQ, it will be released, too. This function never returns.
@end deftypefun
@subheading chopstx_join
@anchor{chopstx_join}
@deftypefun {void} {chopstx_join} (chopstx_t @var{thd}, void ** @var{ret})
@var{thd}: Thread to wait
@var{ret}: Pointer to void * to store return value
Waits for the thread of @var{thd} to terminate.
@end deftypefun
@subheading chopstx_wakeup_usec_wait
@anchor{chopstx_wakeup_usec_wait}
@deftypefun {void} {chopstx_wakeup_usec_wait} (chopstx_t @var{thd})
@var{thd}: Thread to be awakened
Canceling the timer, wakup the sleeping thread for it.
No return value.
@end deftypefun
@subheading chopstx_cancel
@anchor{chopstx_cancel}
@deftypefun {void} {chopstx_cancel} (chopstx_t @var{thd})
@var{thd}: Thread to be canceled
This function requests a cancellation th the thread @var{thd}.
No return value.
@end deftypefun
@subheading chopstx_testcancel
@anchor{chopstx_testcancel}
@deftypefun {void} {chopstx_testcancel} ( @var{void})
Calling chopstx_testcancel creates a cancellation point.
No return value. If the thread is canceled, this function
does not return.
@end deftypefun
|