ISIX-RTOS - small operating system for ARM microcontrollers 1.2
Defines | Functions

semaphore.c File Reference

#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>
Include dependency graph for semaphore.c:

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 Documentation

#define ISIX_DEBUG_SEMAPHORE   ISIX_DBG_OFF

Definition at line 11 of file semaphore.c.


Function Documentation

tick_t isix_ms2tick ( unsigned long  ms)

Convert ms to ticks.

Convert ms value to the system tick value

Parameters:
[in]msTime value in the millisecond
Returns:
Sys tick time value

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)
int isix_sem_get_isr ( sem_t *  sem)
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 
)
int isix_sem_wait ( sem_t *  sem,
tick_t  timeout 
)
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 
)
static int isixp_wakeup_multiple ( task_t *  task_wake) [static]
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines