sys.c File Reference


Data Structures

struct  sswt_cb

Functions

void sys_mbox_fetch (sys_mbox_t mbox, void **msg)
void sys_sem_wait (sys_sem_t sem)
void sys_timeout (u32_t msecs, sys_timeout_handler h, void *arg)
void sys_untimeout (sys_timeout_handler h, void *arg)
int sys_sem_wait_timeout (sys_sem_t sem, u32_t timeout)
void sys_msleep (u32_t ms)

Detailed Description

lwIP Operating System abstraction

Function Documentation

void sys_mbox_fetch ( sys_mbox_t  mbox,
void **  msg 
)

Wait (forever) for a message to arrive in an mbox. While waiting, timeouts (for this thread) are processed.

Parameters:
mbox the mbox to fetch the message from
msg the place to store the message

void sys_msleep ( u32_t  ms  ) 

Sleep for some ms. Timeouts are processed while sleeping.

Parameters:
ms number of milliseconds to sleep

void sys_sem_wait ( sys_sem_t  sem  ) 

Wait (forever) for a semaphore to become available. While waiting, timeouts (for this thread) are processed.

Parameters:
sem semaphore to wait for

int sys_sem_wait_timeout ( sys_sem_t  sem,
u32_t  timeout 
)

Wait for a semaphore with timeout (specified in ms)

Parameters:
sem semaphore to wait
timeout timeout in ms (0: wait forever)
Returns:
0 on timeout, 1 otherwise

void sys_timeout ( u32_t  msecs,
sys_timeout_handler  h,
void *  arg 
)

Create a one-shot timer (aka timeout). Timeouts are processed in the following cases:

Parameters:
msecs time in milliseconds after that the timer should expire
h callback function to call when msecs have elapsed
arg argument to pass to the callback function

void sys_untimeout ( sys_timeout_handler  h,
void *  arg 
)

Go through timeout list (for this task only) and remove the first matching entry, even though the timeout has not triggered yet.

Note:
This function only works as expected if there is only one timeout calling 'h' in the list of timeouts.
Parameters:
h callback function that would be called by the timeout
arg callback argument that would be passed to h


Generated on Sun Mar 23 19:22:46 2008 for lwIP 1.3.0 by  doxygen 1.5.4