MityDSP architecture-specific routines for lwIP. More...
#include <stdio.h>
#include <std.h>
#include <c62.h>
#include <clk.h>
#include <sem.h>
#include "lwip/def.h"
#include "lwip/sys.h"
#include "lwip/mem.h"
#include "arch/sys_arch.h"
Macros | |
#define | LOG_DEBUG 0 |
Functions | |
void | sys_set_max_lwip_threads (int anMaxTasks) |
int | sys_get_max_lwip_threads (void) |
void | sys_set_mbx_queue_entries (int anMbxEntries) |
int | sys_get_mbx_queue_entries (void) |
void | sys_init (void) |
sys_sem_t | sys_sem_new (u8_t anInitCount) |
void | sys_sem_free (sys_sem_t ahSem) |
void | sys_sem_signal (sys_sem_t ahSem) |
u32_t | sys_arch_sem_wait (sys_sem_t ahSem, u32_t anTimeout) |
sys_mbox_t | sys_mbox_new (int anSize) |
void | sys_mbox_free (sys_mbox_t ahMbox) |
void | sys_mbox_post (sys_mbox_t ahMbox, void *apMsg) |
err_t | sys_mbox_trypost (sys_mbox_t ahMbox, void *apMsg) |
u32_t | sys_arch_mbox_fetch (sys_mbox_t ahMbox, void **apMsg, u32_t anTimeout) |
u32_t | sys_arch_mbox_tryfetch (sys_mbox_t ahMbox, void **apMsg) |
struct sys_timeouts * | sys_arch_timeouts (void) |
int | sys_thread_register (sys_thread_t ahThread) |
int | sys_thread_unregister (sys_thread_t ahThread) |
int | sys_thread_priority (sys_thread_t ahThread, int anPrio) |
sys_thread_t | sys_thread_new (char *apName, void(*ahThread)(void *), void *apArg, int anStacksize, int anPrio) |
void | sys_arch_assert (const char *apMsg, int anLine, const char *apFile) |
Variables | |
NetAssertCB | DSPNet_nacb_func |
int | DSPNet_tcpip_priority |
static int | fnLwipTaskMax = 5 |
Set default for the number of concurrent lwIP threads. | |
static int | fnMbxQueueEntries = PBUF_POOL_SIZE / 2 |
Set default lwIP mailbox depths. | |
static struct sys_timeouts * | fpLwipTimeouts = NULL |
This structure contains a linked list of timeouts managed on a per thread basis. | |
static TSK_Handle * | fpLwipTasks = NULL |
Task handles associated with the fpLwipTimeouts structure. | |
static LCK_Handle | fhMutex = NULL |
Local lock for thread creation/modification functions. | |
static unsigned int | fnTicksPerMsec = 1 |
MityDSP clock ticks per millisecond. | |
tsSysArchStats | fsSysArchStats |
Statistic storage. | |
LCK_Handle | ghLwipLock = NULL |
Define the lwIP Critical Section lock. | |
void(* | lwip_printf )(const char *fmt,...) = NULL |
Define default lwip_printf function. |
MityDSP architecture-specific routines for lwIP.
o 0 | / Copyright (c) 2005-2007 (CL)—o Critical Link, LLC \ O
#define LOG_DEBUG 0 |
void sys_set_max_lwip_threads | ( | int | anMaxTasks | ) |
Set number of threads allowed to use lwIP concurrently.
[in] | anMaxTasks | Maximum lwIP threads allowed. |
int sys_get_max_lwip_threads | ( | void | ) |
Get number of threads allowed to use lwIP concurrently.
void sys_set_mbx_queue_entries | ( | int | anMbxEntries | ) |
Set number of queue entries created in lwIP mailboxes.
[in] | anMbxEntries | Number of entries to create. |
int sys_get_mbx_queue_entries | ( | void | ) |
Get number of queue entries used in lwIP mailboxes.
void sys_init | ( | void | ) |
Initialize internal lwIP data structures.
Create and initialize a semaphore.
[in] | anInitCount | Initial semaphore count. |
void sys_sem_free | ( | sys_sem_t | ahSem | ) |
Delete a previously created semaphore.
[in] | ahSem | Semaphore handle. |
void sys_sem_signal | ( | sys_sem_t | ahSem | ) |
Signal a previously created semaphore.
[in] | ahSem | Semaphore handle. |
Pend on a previously created semaphore.
[in] | ahSem | Semaphore handle. |
[in] | anTimeout | Timeout (msec). |
sys_mbox_t sys_mbox_new | ( | int | anSize | ) |
Create a mailbox to hold generic pointer values, with a queue length of fnMbxQueueEntries.
[in] | anSize | Mailbox depth (0=use default) |
void sys_mbox_free | ( | sys_mbox_t | ahMbox | ) |
Delete a previously created mailbox.
[in] | ahMbox | Mailbox handle. |
void sys_mbox_post | ( | sys_mbox_t | ahMbox, |
void * | apMsg | ||
) |
Post a message to a previously created mailbox, waiting indefinitely for space to become available.
[in] | ahMbox | Mailbox handle. |
[in] | apMsg | Message to post. |
err_t sys_mbox_trypost | ( | sys_mbox_t | ahMbox, |
void * | apMsg | ||
) |
Attempt to post a message to a previously created mailbox, without blocking.
[in] | ahMbox | Mailbox handle. |
[in] | apMsg | Message to post. |
u32_t sys_arch_mbox_fetch | ( | sys_mbox_t | ahMbox, |
void ** | apMsg, | ||
u32_t | anTimeout | ||
) |
Wait for a message from a previously created mailbox.
[in] | ahMbox | Mailbox handle. |
[in] | apMsg | Storage for returned message. |
[in] | anTimeout | Timeout (msec). |
u32_t sys_arch_mbox_tryfetch | ( | sys_mbox_t | ahMbox, |
void ** | apMsg | ||
) |
Attempt to get a message IFF a mailbox is not empty.
[in] | ahMbox | Mailbox handle. |
[in] | apMsg | Storage for returned message. |
|
read |
Attempt to find the timeout structure for the current thread.
int sys_thread_register | ( | sys_thread_t | ahThread | ) |
Attempt to register a specified thread with lwIP.
[in] | ahThread | Handle of thread to register. |
int sys_thread_unregister | ( | sys_thread_t | ahThread | ) |
Attempt to un-register a specified thread with lwIP.
[in] | ahThread | Handle of thread to register. |
int sys_thread_priority | ( | sys_thread_t | ahThread, |
int | anPrio | ||
) |
Attempt to change the priority of a previously created thread.
[in] | ahThread | Handle of thread to register. |
[in] | anPrio | New thread priority. |
sys_thread_t sys_thread_new | ( | char * | apName, |
void(*)(void *) | ahThread, | ||
void * | apArg, | ||
int | anStacksize, | ||
int | anPrio | ||
) |
Attempt to create a new thread and register it with lwIP.
[in] | apName | Pointer to static thread name string |
[in] | ahThread | Function to start as a thread. |
[in] | apArg | Argument to provided function. |
[in] | anStacksize | Stack size to allocate (bytes). |
[in] | anPrio | Thread priority. |
void sys_arch_assert | ( | const char * | apMsg, |
int | anLine, | ||
const char * | apFile | ||
) |
Upon failure of an assertion this routine creates an error string, passes it to any registered assertion handlers, and then aborts the current thread.
[in] | apMsg | Text message associate with assertion. |
[in] | anLine | Line number assertion occurred on. |
[in] | apFile | File that assertion occurred in. |
NetAssertCB DSPNet_nacb_func |
int DSPNet_tcpip_priority |
|
static |
Set default for the number of concurrent lwIP threads.
|
static |
Set default lwIP mailbox depths.
|
static |
This structure contains a linked list of timeouts managed on a per thread basis.
|
static |
Task handles associated with the fpLwipTimeouts structure.
|
static |
Local lock for thread creation/modification functions.
|
static |
MityDSP clock ticks per millisecond.
tsSysArchStats fsSysArchStats |
Statistic storage.
LCK_Handle ghLwipLock = NULL |
Define the lwIP Critical Section lock.
void(* lwip_printf)(const char *fmt,...) = NULL |
Define default lwip_printf function.