|
Open Model Railroad Network (OpenMRN)
|
#include <stdint.h>#include <stdio.h>#include <fcntl.h>#include <unistd.h>#include <sys/select.h>#include <sched.h>#include <time.h>#include <signal.h>#include "nmranet_config.h"#include "utils/macros.h"#include "os/os.h"#include "os/os_private.h"Go to the source code of this file.
Macros | |
| #define | _DEFAULT_SOURCE |
| #define | OS_INLINE extern |
| Forces one definition of each inline function to be compiled. | |
| #define | DELETED_TASK_MAGIC 0xb5c5d5e5 |
| This magic value is written to a task's taskList entry in order to signal the idle task to pick it out of the taskList structure. | |
Functions | |
| int | os_thread_create (os_thread_t *thread, const char *name, int priority, size_t stack_size, void *(*start_routine)(void *), void *arg) |
| Create a thread. | |
| long long | hw_get_partial_tick_time_nsec (void) |
| Implement this function to read timing more accurately than 1 msec in FreeRTOS. | |
| long long | os_get_time_monotonic (void) |
| Get the monotonic time since the system started. | |
| ssize_t | os_get_free_heap () |
| int | ignore_fn (void) |
| This function does nothing. | |
| int | main (int argc, char *argv[]) |
| Entry point to program. | |
Variables | |
| const char * | STDIN_DEVICE |
| default stdin | |
| const char * | STDOUT_DEVICE |
| default stdout | |
| const char * | STDERR_DEVICE |
| default stderr | |
| int | g_death_lineno |
| Captures point of death (line). | |
| const char * | g_death_file |
| Captures point of death (file). | |
| long long | rtcOffset = 0 |
| clock management | |
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
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.
Definition in file os.c.
| #define DELETED_TASK_MAGIC 0xb5c5d5e5 |
| #define OS_INLINE extern |
|
extern |
| int ignore_fn | ( | void | ) |
| int main | ( | int | argc, |
| char * | argv[] | ||
| ) |
| ssize_t os_get_free_heap | ( | void | ) |
| long long os_get_time_monotonic | ( | void | ) |
| int os_thread_create | ( | os_thread_t * | thread, |
| const char * | name, | ||
| int | priority, | ||
| size_t | stack_size, | ||
| void *(*)(void *) | start_routine, | ||
| void * | arg | ||
| ) |
Create a thread.
Creates a thread.
| thread | handle to the created thread |
| name | name of thread, NULL for an auto generated name |
| priority | priority of created thread, 0 means default, lower numbers means lower priority, higher numbers mean higher priority |
| stack_size | size in bytes of the created thread's stack |
| start_routine | entry point of the thread |
| arg | entry parameter to the thread |
| long long rtcOffset = 0 |