ISIX-RTOS - small operating system for ARM microcontrollers 1.2
|
#include <isix/types.h>
#include <isix/config.h>
#include <isix/memory.h>
#include <prv/scheduler.h>
#include <isix/semaphore.h>
#include <prv/semaphore.h>
#include <string.h>
#include <prv/multiple_objects.h>
#include <isix/printk.h>
Go to the source code of this file.
Defines | |
#define | ISIX_DEBUG_SEMAPHORE ISIX_DBG_OFF |
Functions | |
sem_t * | isix_sem_create_limited (sem_t *sem, int val, int limit_val) |
int | isix_sem_wait (sem_t *sem, tick_t timeout) |
static int | isixp_wakeup_multiple (task_t *task_wake) |
int | isixp_sem_signal (sem_t *sem, bool isr) |
int | isix_sem_get_isr (sem_t *sem) |
int | isix_sem_setval (sem_t *sem, int val) |
int | isix_sem_getval (sem_t *sem) |
int | isix_sem_destroy (sem_t *sem) |
tick_t | isix_ms2tick (unsigned long ms) |
Convert ms to ticks. | |
int | isix_wait (tick_t timeout) |
Isix wait selected amount of time. |
#define ISIX_DEBUG_SEMAPHORE ISIX_DBG_OFF |
Definition at line 11 of file semaphore.c.
tick_t isix_ms2tick | ( | unsigned long | ms | ) |
Convert ms to ticks.
Convert ms value to the system tick value
[in] | ms | Time value in the millisecond |
Definition at line 285 of file semaphore.c.
References ISIX_CONFIG_HZ.
Referenced by isix::isix_vtimer_start_ms(), and isix::isix_wait_ms().
sem_t* isix_sem_create_limited | ( | sem_t * | sem, |
int | val, | ||
int | limit_val | ||
) |
Definition at line 24 of file semaphore.c.
References IHANDLE_T_SEM, isix_alloc(), isix_printk, list_init(), NULL, and task_struct::sem.
int isix_sem_destroy | ( | sem_t * | sem | ) |
Definition at line 268 of file semaphore.c.
References isix::ISIX_EBUSY, isix::ISIX_EINVARG, isix::ISIX_EOK, isix_free(), isixp_enter_critical(), isixp_exit_critical(), and list_isempty.
Referenced by isix_fifo_destroy().
int isix_sem_get_isr | ( | sem_t * | sem | ) |
Definition at line 216 of file semaphore.c.
References isix::ISIX_EBUSY, isix::ISIX_EINVARG, isix::ISIX_EOK, isixp_enter_critical(), and isixp_exit_critical().
Referenced by isix_fifo_read_isr(), and isix_fifo_write_isr().
int isix_sem_getval | ( | sem_t * | sem | ) |
Definition at line 257 of file semaphore.c.
References isix::ISIX_EINVARG, isixp_enter_critical(), and isixp_exit_critical().
Referenced by isix_fifo_count().
int isix_sem_setval | ( | sem_t * | sem, |
int | val | ||
) |
Definition at line 232 of file semaphore.c.
References isix::ISIX_EBUSY, isix::ISIX_EINVARG, isix::ISIX_EOK, isix_printk, isix::ISIX_SEM_ULIMITED, isixp_enter_critical(), isixp_exit_critical(), and list_isempty.
int isix_sem_wait | ( | sem_t * | sem, |
tick_t | timeout | ||
) |
Definition at line 49 of file semaphore.c.
References isix_bug(), isix_current_task, isix::ISIX_EINVARG, isix::ISIX_EOK, isix::ISIX_ETIMEOUT, isix_printk, isix::isix_yield(), isixp_add_task_to_sem_list(), isixp_add_task_to_waiting_list(), isixp_delete_task_from_ready_list(), isixp_enter_critical(), isixp_exit_critical(), task_struct::jiffies, NULL, task_struct::sem, task_struct::state, TASK_READY, TASK_RUNNING, TASK_SEM_WKUP, TASK_SLEEPING, and TASK_WAITING.
Referenced by isix_fifo_read(), isix_fifo_write(), isix_wait(), and mem_lock().
int isix_wait | ( | tick_t | timeout | ) |
Isix wait selected amount of time.
Definition at line 294 of file semaphore.c.
References isix::ISIX_EOK, isix_get_jiffies(), isix_scheduler_running, isix_sem_wait(), NULL, and isix::port_idle_cpu().
int isixp_sem_signal | ( | sem_t * | sem, |
bool | isr | ||
) |
Definition at line 128 of file semaphore.c.
References task_struct::inode_sem, isix_bug(), isix_current_task, isix::ISIX_EINVARG, isix::ISIX_ENOMEM, isix::ISIX_EOK, isix_printk, isix::ISIX_SEM_ULIMITED, isix::isix_yield(), isixp_add_task_to_ready_list(), isixp_enter_critical(), isixp_exit_critical(), isixp_wakeup_multiple(), isixp_wakeup_multiple_waiting_tasks(), list_delete(), list_get_first, list_isempty, NULL, task_struct::prio, TASK_READY, TASK_SEM_WKUP, TASK_SLEEPING, and TASK_WAITING.
static int isixp_wakeup_multiple | ( | task_t * | task_wake | ) | [static] |
Definition at line 107 of file semaphore.c.
References isix::ISIX_ENOMEM, isix::ISIX_EOK, isix_printk, isixp_add_task_to_ready_list(), list_delete(), TASK_MULTIPLE_WKUP, TASK_READY, TASK_SLEEPING, and TASK_WAITING_MULTIPLE.
Referenced by isixp_sem_signal().