static void _sleep_waker(s32 alarm_id, u16 time, void *arg2) { struct sleep_data *sd = (struct sleep_data *) arg2; if (clock() >= sd->wait) iSignalSema(sd->s); else iSetAlarm(HSYNC_COUNT, _sleep_waker, arg2); }
static void QueueHandler ( void ) { SendRequests (); if ( iSendReq >= 0 ) { iSignalSema ( iSendReq ); iSendReq = 0x80000000; } /* end if */ } /* end QueueHandler */
void sceCdGenericCallbackFunction(void *funcNum) { // set the currently executing function num sceCdCallbackNum = *(s32*) funcNum; iSignalSema(nCmdSemaId); // check if user callback is registered if (callbackThreadId) { if (sceCdCallbackFunc) { iSignalSema(callbackSemaId); return; } } // clear the currently executing function num cbSema = 0; sceCdCallbackNum = 0; }
void _fio_read_intr(struct _fio_read_data *data) { struct _fio_read_data *uncached = UNCACHED_SEG(data); if (uncached->size1 && uncached->dest1) { memcpy(uncached->dest1, uncached->buf1, uncached->size1); } if (uncached->size2 && uncached->dest2) { memcpy(uncached->dest2, uncached->buf2, uncached->size2); } iSignalSema(_fio_completion_sema); }
//The original iRotateThreadReadyQueue will not change the current thread ID. s32 iRotateThreadReadyQueue(s32 priority) { int index; if(priority < 128 && topId != 0) { index = topArg.requestIn & 0x1FF; topArg.requestIn = index + 1; topArg.request[index].mode = TOP_REQ_ROTATE; topArg.request[index].data = priority; iSignalSema(topSema); return 0; } else return -1; }
/* Command 0x80000008 */ static void _request_end(SifRpcRendPkt_t *request, void *data) { SifRpcClientData_t *client = request->client; if (request->cid == 0x8000000a) { if (client->end_function) client->end_function(client->end_param); } else if (request->cid == 0x80000009) { client->server = request->server; client->buff = request->buff; client->cbuff = request->cbuff; } if (client->hdr.sema_id >= 0) iSignalSema(client->hdr.sema_id); rpc_packet_free(client->hdr.pkt_addr); client->hdr.pkt_addr = NULL; }
//The original iSuspendThread allows a thread to suspend itself, but won't change the current thread ID. s32 iSuspendThread(s32 thread_id) { int index; if(_iGetThreadId() == thread_id) { if(thread_id < 256 && topId != 0) { index = topArg.requestIn & 0x1FF; topArg.requestIn = index + 1; topArg.request[index].mode = TOP_REQ_SUSPEND; topArg.request[index].data = thread_id; iSignalSema(topSema); return 0; } else return -1; } else { return _iSuspendThread(thread_id); } }
static void _poff_intr_callback(void *pkt, void *param) { iSignalSema(PowerOffSema); }
void _fio_intr() { iSignalSema(_fio_completion_sema); }
static int IntFunc0( void* common ) { gBgmIntr[0] = 1; iSignalSema( gSem ); return 1; //-- Required for re-enabling interrupts }
static void EthStatusCheckCb(s32 alarm_id, u16 time, void *common) { iSignalSema(*(int*)common); }
static int fillbuffer(void *arg) { iSignalSema((int)arg); return 0; }
static void rpcCompleteIntr(void *param) { iSignalSema(kbdRpcSema); }
static void _audsrv_intr() { iSignalSema(completion_sema); }