|
| #define | OS_INLINE extern inline __attribute__((__gnu_inline__)) |
| | Forces one definition of each inline function to be compiled.
|
| |
| #define | container_of(_ptr, _type, _member) |
| | Get a pointer to the parent structure of one of its members.
|
| |
| #define | OS_THREAD_ONCE_INIT PTHREAD_ONCE_INIT |
| | initial value for one time intitialization instance
|
| |
| #define | OS_PRIO_MIN 1 |
| | lowest thread priority supported by abstraction
|
| |
| #define | OS_PRIO_DEFAULT 0 |
| | default thread priority
|
| |
| #define | OS_PRIO_MAX 32 |
| | highest thread priority suported by abstraction
|
| |
| #define | OS_MQ_NONE 0 |
| | error code for no error for message queues
|
| |
| #define | OS_MQ_TIMEDOUT 1 |
| | error code for timedout for message queues
|
| |
| #define | OS_MQ_EMPTY 2 |
| | error code for the queue being empty
|
| |
| #define | OS_MQ_FULL 3 |
| | error code for queue being full
|
| |
| #define | OPENMRN_OS_WAIT_FOREVER __LONG_LONG_MAX__ |
| | maximum timeout period
|
| |
| #define | NSEC_TO_USEC(_nsec) (((long long)_nsec) / 1000LL) |
| | Convert a nanosecond value to a microsecond value.
|
| |
| #define | NSEC_TO_MSEC(_nsec) (((long long)_nsec) / 1000000LL) |
| | Convert a nanosecond value to a millisecond value.
|
| |
| #define | NSEC_TO_SEC(_nsec) (((long long)_nsec) / 1000000000LL) |
| | Convert a nanosecond value to a second value.
|
| |
| #define | NSEC_TO_MIN(_nsec) (((long long)_nsec) / 60000000000LL) |
| | Convert a nanosecond value to minutes.
|
| |
| #define | USEC_TO_NSEC(_usec) (((long long)_usec) * 1000LL) |
| | Convert a microsecond value to a nanosecond value.
|
| |
| #define | USEC_TO_MSEC(_usec) (((long long)_usec) / 1000LL) |
| | Convert a microsecond value to a millisecond value.
|
| |
| #define | USEC_TO_SEC(_usec) (((long long)_usec) / 1000000LL) |
| | Convert a microsecond value to a second value.
|
| |
| #define | MSEC_TO_NSEC(_msec) (((long long)_msec) * 1000000LL) |
| | Convert a millisecond value to a nanosecond value.
|
| |
| #define | MSEC_TO_USEC(_msec) (((long long)_msec) * 1000LL) |
| | Convert a millisecond value to a microsecond value.
|
| |
| #define | MSEC_TO_SEC(_msec) (((long long)_msec) / 1000LL) |
| | Convert a millisecond value to a second value.
|
| |
| #define | SEC_TO_NSEC(_sec) (((long long)_sec) * 1000000000LL) |
| | Convert a second value to a nanosecond value.
|
| |
| #define | SEC_TO_USEC(_sec) (((long long)_sec) * 1000000LL) |
| | Convert a second value to a microsecond value.
|
| |
| #define | SEC_TO_MSEC(_sec) (((long long)_sec) * 1000LL) |
| | Convert a second value to a millisecond value.
|
| |
| #define | NSEC_TO_USEC_ROUNDED(_nsec) ((((long long)_nsec) + 500LL) / 1000LL) |
| | Convert a nanosecond value to a microsecond value.
|
| |
| #define | NSEC_TO_MSEC_ROUNDED(_nsec) ((((long long)_nsec) + 500000LL) / 1000000LL) |
| | Convert a nanosecond value to a millisecond value.
|
| |
| #define | NSEC_TO_SEC_ROUNDED(_nsec) ((((long long)_nsec) + 500000000LL) / 1000000000LL) |
| | Convert a nanosecond value to a second value.
|
| |
| #define | NSEC_TO_MIN_ROUNDED(_nsec) ((((long long)_nsec) + 30000000000LL) / 60000000000LL) |
| | Convert a nanosecond value to minutes.
|
| |
| #define | USEC_TO_MSEC_ROUNDED(_usec) ((((long long)_usec) + 500LL) / 1000LL) |
| | Convert a microsecond value to a millisecond value.
|
| |
| #define | USEC_TO_SEC_ROUNDED(_usec) ((((long long)_usec) +500000LL) / 1000000LL) |
| | Convert a microsecond value to a second value.
|
| |
| #define | MSEC_TO_SEC_ROUNDED(_msec) ((((long long)_msec) + 500LL) / 1000LL) |
| | Convert a millisecond value to a second value.
|
| |
|
| int | appl_main (int argc, char *argv[]) |
| | Entry point to application.
|
| |
| ssize_t | os_get_free_heap (void) |
| |
| long long | os_get_time_monotonic (void) |
| | Get the monotonic time since the system started.
|
| |
| long long | os_get_fake_time (void) |
| | Get the fake time for a unit test.
|
| |
| OS_INLINE int | os_thread_once (os_thread_once_t *once, void(*routine)(void)) |
| | One time intialization routine.
|
| |
| int | os_thread_create (os_thread_t *thread, const char *name, int priority, size_t stack_size, void *(*start_routine)(void *), void *arg) |
| | Creates a thread.
|
| |
| void | os_thread_cancel (os_thread_t thread) |
| | Destroy a thread.
|
| |
| OS_INLINE os_thread_t | os_thread_self (void) |
| | Return a handle to the calling thread.
|
| |
| OS_INLINE int | os_thread_get_priority (os_thread_t thread) |
| | Return the current thread priority.
|
| |
| OS_INLINE int | os_thread_get_priority_min (void) |
| | Get the minimum thread priority.
|
| |
| OS_INLINE int | os_thread_get_priority_max (void) |
| | Get the maximum thread priority.
|
| |
| OS_INLINE int | os_mutex_init (os_mutex_t *mutex) |
| | Initialize mutex.
|
| |
| OS_INLINE int | os_recursive_mutex_init (os_mutex_t *mutex) |
| | Initialize recursive mutex.
|
| |
| OS_INLINE int | os_mutex_destroy (os_mutex_t *mutex) |
| | Destroy a mutex.
|
| |
| OS_INLINE int | os_mutex_lock (os_mutex_t *mutex) |
| | Lock a mutex.
|
| |
| OS_INLINE int | os_mutex_unlock (os_mutex_t *mutex) |
| | Unock a mutex.
|
| |
| OS_INLINE int | os_sem_init (os_sem_t *sem, unsigned int value) |
| | Initialize a semaphore.
|
| |
| OS_INLINE int | os_sem_destroy (os_sem_t *sem) |
| | Destroy a semaphore.
|
| |
| OS_INLINE int | os_sem_post (os_sem_t *sem) |
| | Post a semaphore.
|
| |
| OS_INLINE int | os_sem_wait (os_sem_t *sem) |
| | Wait on a semaphore.
|
| |
| OS_INLINE os_mq_t | os_mq_create (size_t length, size_t item_size) |
| | Create a new message queue.
|
| |
| OS_INLINE void | os_mq_send (os_mq_t queue, const void *data) |
| | Blocking send of a message to a queue.
|
| |
| OS_INLINE int | os_mq_timedsend (os_mq_t queue, const void *data, long long timeout) |
| | Send a message to a queue with a timeout.
|
| |
| OS_INLINE void | os_mq_receive (os_mq_t queue, void *data) |
| | Blocking receive a message from a queue.
|
| |
| OS_INLINE int | os_mq_timedreceive (os_mq_t queue, void *data, long long timeout) |
| | Receive a message from a queue.
|
| |
| OS_INLINE int | os_mq_send_from_isr (os_mq_t queue, const void *data, int *woken) |
| | Send of a message to a queue from ISR context.
|
| |
| OS_INLINE int | os_mq_is_full_from_isr (os_mq_t queue) |
| | Check if a queue is full from ISR context.
|
| |
| OS_INLINE int | os_mq_receive_from_isr (os_mq_t queue, void *data, int *woken) |
| | Receive a message from a queue from ISR context.
|
| |
| OS_INLINE int | os_mq_num_pending (os_mq_t queue) |
| | Return the number of messages pending in the queue.
|
| |
| OS_INLINE int | os_mq_num_pending_from_isr (os_mq_t queue) |
| | Return the number of messages pending in the queue from ISR context.
|
| |
| OS_INLINE int | os_mq_num_spaces (os_mq_t queue) |
| | Return the number of spaces available in the queue.
|
| |
- Copyright
- Copyright (c) 2012, Stuart W Baker All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This file represents a C language abstraction of common operating system calls.
- Author
- Stuart W. Baker
- Date
- 28 May 2012
Definition in file os.h.