ps2sdk
1.1
A collection of Open Source libraries used for developing applications on Sony's PlayStation 2® (PS2).
|
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <kernel.h>
#include <time.h>
#include <limits.h>
#include "lwip/sys.h"
#include "lwip/opt.h"
#include "lwip/stats.h"
#include "lwip/debug.h"
#include "lwip/pbuf.h"
#include "arch/sys_arch.h"
#include "ps2ip_internal.h"
Go to the source code of this file.
Functions | |
static arch_message * | alloc_msg (void) |
static void | free_msg (arch_message *msg) |
static int | WaitSemaTimeout (int sema, unsigned int msec) |
static arch_message * | try_alloc_msg (void) |
static void | TimeoutHandler (s32 alarm_id, u16 time, void *pvArg) |
static u32_t | ComputeTimeDiff (u32 start, u32 end) |
sys_thread_t | sys_thread_new (const char *name, lwip_thread_fn thread, void *arg, int stacksize, int prio) |
err_t | sys_mbox_new (sys_mbox_t *mbox, int size) |
void | sys_mbox_free (sys_mbox_t *pMBox) |
int | sys_mbox_valid (sys_mbox_t *mbox) |
void | sys_mbox_set_invalid (sys_mbox_t *mbox) |
static unsigned int | mSec2HSyncTicks (unsigned int msec) |
static void | RetrieveMbxInternal (sys_mbox_t mBox, arch_message **message) |
static int | ReceiveMbx (arch_message **message, sys_mbox_t mBox, u32_t timeout) |
static int | PollMbx (arch_message **message, sys_mbox_t mBox) |
static u32_t | sys_arch_mbox_fetch_internal (sys_mbox_t pMBox, void **ppvMSG, u32_t u32Timeout, char block) |
u32_t | sys_arch_mbox_fetch (sys_mbox_t *pMBox, void **ppvMSG, u32_t u32Timeout) |
u32_t | sys_arch_mbox_tryfetch (sys_mbox_t *pMBox, void **ppvMSG) |
static void | SendMbx (sys_mbox_t *mbox, arch_message *msg, void *sys_msg) |
err_t | sys_mbox_trypost (sys_mbox_t *mbox, void *sys_msg) |
void | sys_mbox_post (sys_mbox_t *mbox, void *sys_msg) |
err_t | sys_sem_new (sys_sem_t *sem, u8_t count) |
u32_t | sys_arch_sem_wait (sys_sem_t *sema, u32_t timeout) |
void | sys_sem_signal (sys_sem_t *Sema) |
void | sys_sem_free (sys_sem_t *Sema) |
int | sys_sem_valid (sys_sem_t *sem) |
void | sys_sem_set_invalid (sys_sem_t *sem) |
void | sys_init (void) |
u32_t | sys_now (void) |
sys_prot_t | sys_arch_protect (void) |
void | sys_arch_unprotect (sys_prot_t level) |
void * | ps2ip_calloc64 (size_t n, size_t size) |
Variables | |
static arch_message | msg_pool [SYS_MAX_MESSAGES] |
static arch_message * | free_head |
static int | MsgCountSema |
void * | _gp |
unsigned short int | hsyncTicksPerMSec |
|
inlinestatic |
Definition at line 56 of file sys_arch.c.
References DI, EI, free_head, MsgCountSema, arch_message::next, and WaitSema().
Referenced by sys_mbox_post().
Definition at line 87 of file sys_arch.c.
Referenced by sys_arch_mbox_fetch_internal(), and sys_arch_sem_wait().
|
static |
Definition at line 71 of file sys_arch.c.
References DI, EI, free_head, MsgCountSema, arch_message::next, and SignalSema().
Referenced by sys_arch_mbox_fetch_internal(), and sys_mbox_free().
|
inlinestatic |
Definition at line 193 of file sys_arch.c.
References hsyncTicksPerMSec.
Referenced by WaitSemaTimeout().
|
static |
Definition at line 263 of file sys_arch.c.
References PollSema(), result, and RetrieveMbxInternal().
Referenced by sys_arch_mbox_fetch_internal().
void* ps2ip_calloc64 | ( | size_t | n, |
size_t | size | ||
) |
|
static |
Definition at line 243 of file sys_arch.c.
References result, RetrieveMbxInternal(), WaitSema(), and WaitSemaTimeout().
Referenced by sys_arch_mbox_fetch_internal().
|
static |
Definition at line 198 of file sys_arch.c.
References DI, EI, arch_message::next, and NULL.
Referenced by PollMbx(), and ReceiveMbx().
|
static |
Definition at line 317 of file sys_arch.c.
References DI, EI, arch_message::next, NULL, SignalSema(), and arch_message::sys_msg.
Referenced by sys_mbox_post(), and sys_mbox_trypost().
Definition at line 307 of file sys_arch.c.
References sys_arch_mbox_fetch_internal().
|
static |
Definition at line 277 of file sys_arch.c.
References ComputeTimeDiff(), free_msg(), NULL, PollMbx(), ReceiveMbx(), result, and arch_message::sys_msg.
Referenced by sys_arch_mbox_fetch(), and sys_arch_mbox_tryfetch().
u32_t sys_arch_mbox_tryfetch | ( | sys_mbox_t * | pMBox, |
void ** | ppvMSG | ||
) |
Definition at line 312 of file sys_arch.c.
References sys_arch_mbox_fetch_internal().
sys_prot_t sys_arch_protect | ( | void | ) |
Definition at line 455 of file sys_arch.c.
References DIntr().
Definition at line 373 of file sys_arch.c.
References ComputeTimeDiff(), PollSema(), result, WaitSema(), and WaitSemaTimeout().
Referenced by InitializeLWIP().
void sys_arch_unprotect | ( | sys_prot_t | level | ) |
Definition at line 460 of file sys_arch.c.
References EIntr().
void sys_init | ( | void | ) |
Definition at line 424 of file sys_arch.c.
References ee_sema_t::attr, CreateSema(), dbgprintf, free_head, ee_sema_t::init_count, ee_sema_t::max_count, msg_pool, MsgCountSema, arch_message::next, NULL, ee_sema_t::option, and SYS_MAX_MESSAGES.
void sys_mbox_free | ( | sys_mbox_t * | pMBox | ) |
Definition at line 162 of file sys_arch.c.
References DeleteSema(), free_msg(), arch_message::next, NULL, and SYS_MBOX_NULL.
err_t sys_mbox_new | ( | sys_mbox_t * | mbox, |
int | size | ||
) |
Definition at line 126 of file sys_arch.c.
References ee_sema_t::attr, CreateSema(), dbgprintf, sys_mbox_t::FirstMessage, ee_sema_t::init_count, sys_mbox_t::LastMessage, ee_sema_t::max_count, sys_mbox_t::MessageCountSema, NULL, ee_sema_t::option, SYS_MAX_MESSAGES, and SYS_MBOX_NULL.
void sys_mbox_post | ( | sys_mbox_t * | mbox, |
void * | sys_msg | ||
) |
Definition at line 347 of file sys_arch.c.
References alloc_msg(), and SendMbx().
void sys_mbox_set_invalid | ( | sys_mbox_t * | mbox | ) |
Definition at line 186 of file sys_arch.c.
References SYS_MBOX_NULL.
err_t sys_mbox_trypost | ( | sys_mbox_t * | mbox, |
void * | sys_msg | ||
) |
int sys_mbox_valid | ( | sys_mbox_t * | mbox | ) |
Definition at line 181 of file sys_arch.c.
References SYS_MBOX_NULL.
u32_t sys_now | ( | void | ) |
Definition at line 450 of file sys_arch.c.
void sys_sem_free | ( | sys_sem_t * | Sema | ) |
Definition at line 352 of file sys_arch.c.
References ee_sema_t::attr, CreateSema(), dbgprintf, ee_sema_t::init_count, ee_sema_t::max_count, ee_sema_t::option, and sem.
Referenced by InitializeLWIP().
void sys_sem_set_invalid | ( | sys_sem_t * | sem | ) |
Definition at line 420 of file sys_arch.c.
References sem, and SYS_SEM_NULL.
void sys_sem_signal | ( | sys_sem_t * | Sema | ) |
int sys_sem_valid | ( | sys_sem_t * | sem | ) |
sys_thread_t sys_thread_new | ( | const char * | name, |
lwip_thread_fn | thread, | ||
void * | arg, | ||
int | stacksize, | ||
int | prio | ||
) |
Definition at line 95 of file sys_arch.c.
References _gp, ee_thread_t::attr, CreateThread(), dbgprintf, DeleteThread(), ee_thread_t::func, ee_thread_t::gp_reg, ee_thread_t::initial_priority, ee_thread_t::option, ee_thread_t::stack, ee_thread_t::stack_size, and StartThread().
Definition at line 82 of file sys_arch.c.
References ExitHandler, and iReleaseWaitThread().
Referenced by WaitSemaTimeout().
|
inlinestatic |
Definition at line 39 of file sys_arch.c.
References DI, EI, free_head, MsgCountSema, arch_message::next, NULL, and PollSema().
Referenced by sys_mbox_trypost().
|
static |
Definition at line 218 of file sys_arch.c.
References GetThreadId(), mSec2HSyncTicks(), ReleaseAlarm(), SetAlarm(), TimeoutHandler(), and WaitSema().
Referenced by ReceiveMbx(), and sys_arch_sem_wait().
|
extern |
Referenced by sys_thread_new().
|
static |
Definition at line 28 of file sys_arch.c.
Referenced by alloc_msg(), free_msg(), sys_init(), and try_alloc_msg().
|
extern |
Definition at line 39 of file ps2ip.c.
Referenced by mSec2HSyncTicks(), and ps2ipSetHsyncTicksPerMSec().
|
static |
Definition at line 27 of file sys_arch.c.
Referenced by sys_init().
|
static |
Definition at line 35 of file sys_arch.c.
Referenced by alloc_msg(), free_msg(), sys_init(), and try_alloc_msg().