diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2013-08-21 11:18:27 +0900 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2013-08-21 11:18:27 +0900 |
commit | cbbd81ce47d78a19cead7d88707c705773165825 (patch) | |
tree | ab69672f5ae5fd46aaef11b16c6ed7678df200f4 /doc/chopstx-api.texi | |
parent | 46f1558dedbca3d0c62c91b08334ff66cf6cf03a (diff) |
Add doc
Diffstat (limited to 'doc/chopstx-api.texi')
-rw-r--r-- | doc/chopstx-api.texi | 191 |
1 files changed, 191 insertions, 0 deletions
diff --git a/doc/chopstx-api.texi b/doc/chopstx-api.texi new file mode 100644 index 0000000..d4915ac --- /dev/null +++ b/doc/chopstx-api.texi @@ -0,0 +1,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 + |