Macros | |
#define | SYS_ARCH_DEC(var, val) |
#define | SYS_ARCH_DECL_PROTECT(lev) |
SYS_LIGHTWEIGHT_PROT define SYS_LIGHTWEIGHT_PROT in lwipopts.h if you want inter-task protection for certain critical regions during buffer allocation, deallocation and memory allocation and deallocation. More... | |
#define | SYS_ARCH_GET(var, ret) |
#define | SYS_ARCH_INC(var, val) |
#define | SYS_ARCH_PROTECT(lev) |
#define | SYS_ARCH_SET(var, val) |
#define | SYS_ARCH_TIMEOUT 0xffffffffUL |
Return code for timeouts from sys_arch_mbox_fetch and sys_arch_sem_wait. More... | |
#define | SYS_ARCH_UNPROTECT(lev) |
#define | SYS_MBOX_EMPTY SYS_ARCH_TIMEOUT |
sys_mbox_tryfetch() returns SYS_MBOX_EMPTY if appropriate. More... | |
#define | sys_mbox_fetch(mbox, msg) sys_arch_mbox_fetch(mbox, msg, 0) |
#define | sys_mbox_tryfetch(mbox, msg) sys_arch_mbox_tryfetch(mbox, msg) |
For now, we map straight to sys_arch implementation. More... | |
#define | sys_sem_wait(sem) sys_arch_sem_wait(sem, 0) |
Wait for a semaphore - forever/no timeout. More... | |
Typedefs | |
typedef void(* | lwip_thread_fn )(void *arg) |
Function prototype for thread functions. More... | |
Functions | |
u32_t | sys_arch_mbox_fetch (sys_mbox_t *mbox, void **msg, u32_t timeout) |
Wait for a new message to arrive in the mbox. More... | |
u32_t | sys_arch_mbox_tryfetch (sys_mbox_t *mbox, void **msg) |
Wait for a new message to arrive in the mbox. More... | |
u32_t | sys_arch_sem_wait (sys_sem_t *sem, u32_t timeout) |
Wait for a semaphore for the specified timeout. More... | |
void | sys_init (void) |
u32_t | sys_jiffies (void) |
Ticks/jiffies since power up. More... | |
void | sys_mbox_free (sys_mbox_t *mbox) |
Delete an mbox. More... | |
err_t | sys_mbox_new (sys_mbox_t *mbox, int size) |
Create a new mbox of specified size. More... | |
void | sys_mbox_post (sys_mbox_t *mbox, void *msg) |
Post a message to an mbox - may not fail -> blocks if full, only used from tasks not from ISR. More... | |
void | sys_mbox_set_invalid (sys_mbox_t *mbox) |
Set an mbox invalid so that sys_mbox_valid returns 0. More... | |
err_t | sys_mbox_trypost (sys_mbox_t *mbox, void *msg) |
Try to post a message to an mbox - may fail if full or ISR. More... | |
int | sys_mbox_valid (sys_mbox_t *mbox) |
Check if an mbox is valid/allocated: return 1 for valid, 0 for invalid. More... | |
void | sys_msleep (u32_t ms) |
Sleep for some ms. More... | |
void | sys_mutex_free (sys_mutex_t *mutex) |
Delete a semaphore. More... | |
void | sys_mutex_lock (sys_mutex_t *mutex) |
Lock a mutex. More... | |
err_t | sys_mutex_new (sys_mutex_t *mutex) |
Define LWIP_COMPAT_MUTEX if the port has no mutexes and binary semaphores should be used instead. More... | |
void | sys_mutex_set_invalid (sys_mutex_t *mutex) |
Set a mutex invalid so that sys_mutex_valid returns 0. More... | |
void | sys_mutex_unlock (sys_mutex_t *mutex) |
Unlock a mutex. More... | |
int | sys_mutex_valid (sys_mutex_t *mutex) |
Check if a mutex is valid/allocated: return 1 for valid, 0 for invalid. More... | |
u32_t | sys_now (void) |
Returns the current time in milliseconds, may be the same as sys_jiffies or at least based on it. More... | |
void | sys_sem_free (sys_sem_t *sem) |
Delete a semaphore. More... | |
err_t | sys_sem_new (sys_sem_t *sem, u8_t count) |
Create a new semaphore. More... | |
void | sys_sem_set_invalid (sys_sem_t *sem) |
Set a semaphore invalid so that sys_sem_valid returns 0. More... | |
void | sys_sem_signal (sys_sem_t *sem) |
Signals a semaphore. More... | |
int | sys_sem_valid (sys_sem_t *sem) |
Check if a sempahore is valid/allocated: return 1 for valid, 0 for invalid. More... | |
sys_thread_t | sys_thread_new (const char *name, lwip_thread_fn thread, void *arg, int stacksize, int prio) |
The only thread function: Creates a new thread. More... | |
#define SYS_ARCH_DEC | ( | var, | |
val | |||
) |
#define SYS_ARCH_DECL_PROTECT | ( | lev | ) |
SYS_LIGHTWEIGHT_PROT define SYS_LIGHTWEIGHT_PROT in lwipopts.h if you want inter-task protection for certain critical regions during buffer allocation, deallocation and memory allocation and deallocation.
#define SYS_ARCH_GET | ( | var, | |
ret | |||
) |
#define SYS_ARCH_INC | ( | var, | |
val | |||
) |
#define SYS_ARCH_PROTECT | ( | lev | ) |
#define SYS_ARCH_SET | ( | var, | |
val | |||
) |
#define SYS_ARCH_TIMEOUT 0xffffffffUL |
Return code for timeouts from sys_arch_mbox_fetch and sys_arch_sem_wait.
#define SYS_ARCH_UNPROTECT | ( | lev | ) |
#define SYS_MBOX_EMPTY SYS_ARCH_TIMEOUT |
sys_mbox_tryfetch() returns SYS_MBOX_EMPTY if appropriate.
For now we use the same magic value, but we allow this to change in future.
#define sys_mbox_fetch | ( | mbox, | |
msg | |||
) | sys_arch_mbox_fetch(mbox, msg, 0) |
#define sys_mbox_tryfetch | ( | mbox, | |
msg | |||
) | sys_arch_mbox_tryfetch(mbox, msg) |
For now, we map straight to sys_arch implementation.
#define sys_sem_wait | ( | sem | ) | sys_arch_sem_wait(sem, 0) |
Wait for a semaphore - forever/no timeout.
typedef void(* lwip_thread_fn)(void *arg) |
Function prototype for thread functions.
Wait for a new message to arrive in the mbox.
mbox | mbox to get a message from |
msg | pointer where the message is stored |
timeout | maximum time (in milliseconds) to wait for a message |
u32_t sys_arch_mbox_tryfetch | ( | sys_mbox_t * | mbox, |
void ** | msg | ||
) |
Wait for a new message to arrive in the mbox.
mbox | mbox to get a message from |
msg | pointer where the message is stored |
timeout | maximum time (in milliseconds) to wait for a message |
Wait for a semaphore for the specified timeout.
sem | the semaphore to wait for |
timeout | timeout in milliseconds to wait (0 = wait forever) |
Referenced by ksz8851snl_task(), and sys_msleep().
void sys_init | ( | void | ) |
Referenced by lwip_init().
u32_t sys_jiffies | ( | void | ) |
Ticks/jiffies since power up.
void sys_mbox_free | ( | sys_mbox_t * | mbox | ) |
Delete an mbox.
mbox | mbox to delete |
err_t sys_mbox_new | ( | sys_mbox_t * | mbox, |
int | size | ||
) |
Create a new mbox of specified size.
mbox | pointer to the mbox to create |
size | (miminum) number of messages in this mbox |
Referenced by tcpip_init().
void sys_mbox_post | ( | sys_mbox_t * | mbox, |
void * | msg | ||
) |
Post a message to an mbox - may not fail -> blocks if full, only used from tasks not from ISR.
mbox | mbox to posts the message |
msg | message to post (ATTENTION: can be NULL) |
Referenced by tcpip_callback_with_block().
void sys_mbox_set_invalid | ( | sys_mbox_t * | mbox | ) |
Set an mbox invalid so that sys_mbox_valid returns 0.
err_t sys_mbox_trypost | ( | sys_mbox_t * | mbox, |
void * | msg | ||
) |
Try to post a message to an mbox - may fail if full or ISR.
mbox | mbox to posts the message |
msg | message to post (ATTENTION: can be NULL) |
Referenced by tcpip_callback_with_block(), tcpip_input(), and tcpip_trycallback().
int sys_mbox_valid | ( | sys_mbox_t * | mbox | ) |
Check if an mbox is valid/allocated: return 1 for valid, 0 for invalid.
Referenced by tcpip_callback_with_block(), tcpip_input(), and tcpip_trycallback().
void sys_msleep | ( | u32_t | ms | ) |
Sleep for some ms.
Timeouts are NOT processed while sleeping.
ms | number of milliseconds to sleep |
References err, ERR_OK, sys_arch_sem_wait(), sys_sem_free(), and sys_sem_new().
void sys_mutex_free | ( | sys_mutex_t * | mutex | ) |
Delete a semaphore.
mutex | the mutex to delete |
void sys_mutex_lock | ( | sys_mutex_t * | mutex | ) |
err_t sys_mutex_new | ( | sys_mutex_t * | mutex | ) |
Define LWIP_COMPAT_MUTEX if the port has no mutexes and binary semaphores should be used instead.
Create a new mutex
mutex | pointer to the mutex to create |
Referenced by mem_init(), and tcpip_init().
void sys_mutex_set_invalid | ( | sys_mutex_t * | mutex | ) |
Set a mutex invalid so that sys_mutex_valid returns 0.
void sys_mutex_unlock | ( | sys_mutex_t * | mutex | ) |
int sys_mutex_valid | ( | sys_mutex_t * | mutex | ) |
Check if a mutex is valid/allocated: return 1 for valid, 0 for invalid.
u32_t sys_now | ( | void | ) |
Returns the current time in milliseconds, may be the same as sys_jiffies or at least based on it.
References sys_get_ms().
void sys_sem_free | ( | sys_sem_t * | sem | ) |
Create a new semaphore.
sem | pointer to the semaphore to create |
count | initial count of the semaphore |
Referenced by ethernetif_init(), and sys_msleep().
void sys_sem_set_invalid | ( | sys_sem_t * | sem | ) |
Set a semaphore invalid so that sys_sem_valid returns 0.
void sys_sem_signal | ( | sys_sem_t * | sem | ) |
Signals a semaphore.
sem | the semaphore to signal |
int sys_sem_valid | ( | sys_sem_t * | sem | ) |
Check if a sempahore is valid/allocated: return 1 for valid, 0 for invalid.
sys_thread_t sys_thread_new | ( | const char * | name, |
lwip_thread_fn | thread, | ||
void * | arg, | ||
int | stacksize, | ||
int | prio | ||
) |
The only thread function: Creates a new thread.
name | human-readable name for the thread (used for debugging purposes) |
thread | thread-function |
arg | parameter passed to 'thread' |
stacksize | stack size in bytes for the new thread (may be ignored by ports) |
prio | priority of the new thread (may be ignored by ports) |
Referenced by ethernetif_init(), and tcpip_init().