Lines Matching refs:sigCB
46 OsSigCB *sigCB = (OsSigCB *)task->sig; in OsSignalTaskContextRestore() local
49 if ((sigCB == NULL) || (sigCB->sigRestoreSP == NULL)) { in OsSignalTaskContextRestore()
53 sp = (UINTPTR)sigCB->sigRestoreSP; in OsSignalTaskContextRestore()
54 sigCB->sigRestoreSP = NULL; in OsSignalTaskContextRestore()
70 STATIC UINT32 AddSigInfoToList(OsSigCB *sigCB, siginfo_t *info) in AddSigInfoToList() argument
75 LOS_DL_LIST_FOR_EACH_ENTRY(tmpInfo, &sigCB->sigInfoList, OsSigInfoNode, node) { in AddSigInfoToList()
87 LOS_ListAdd(&sigCB->sigInfoList, &tmpInfo->node); in AddSigInfoToList()
93 STATIC VOID DeleteSigInfoFromList(OsSigCB *sigCB, INT32 sigNo) in DeleteSigInfoFromList() argument
98 LOS_DL_LIST_FOR_EACH_ENTRY(tmpInfo, &sigCB->sigInfoList, OsSigInfoNode, node) { in DeleteSigInfoFromList()
107 (VOID)memcpy_s(&sigCB->sigInfo, sizeof(siginfo_t), &tmpInfo->info, sizeof(siginfo_t)); in DeleteSigInfoFromList()
115 OsSigCB *sigCB = NULL; in SignalHandle() local
118 sigCB = task->sig; in SignalHandle()
119 if (sigCB == NULL) { in SignalHandle()
124 while (sigCB->sigPendFlag & sigCB->sigSetFlag) { in SignalHandle()
125 UINT32 sigFlag = sigCB->sigPendFlag & sigCB->sigSetFlag; in SignalHandle()
127 DeleteSigInfoFromList(sigCB, sigNo); in SignalHandle()
129 SIG_HANDLER handler = sigCB->sigHandlers[sigNo - 1]; in SignalHandle()
130 sigCB->sigPendFlag &= ~LOS_SIGNAL_MASK(sigNo); in SignalHandle()
149 OsSigCB *sigCB = (OsSigCB *)task->sig; in SignalEntry() local
153 task->stackPointer = sigCB->sigSaveSP; in SignalEntry()
154 sigCB->sigSaveSP = NULL; in SignalEntry()
155 sigCB->sigRestoreSP = task->stackPointer; in SignalEntry()
164 OsSigCB *sigCB = NULL; in SignalSend() local
168 sigCB = task->sig; in SignalSend()
169 if (sigCB == NULL) { in SignalSend()
174 if (!(sigCB->sigPendFlag & mask)) { in SignalSend()
175 sigCB->sigPendFlag |= mask; in SignalSend()
186 if (sigCB->sigStatus & OS_SIGNAL_STATUS_WAIT) { in SignalSend()
187 if (sigCB->sigWaitFlag & LOS_SIGNAL_MASK(sigNo)) { in SignalSend()
188 DeleteSigInfoFromList(sigCB, sigNo); in SignalSend()
194 sigCB->sigSaveSP = task->stackPointer; in SignalSend()
195 sigCB->sigRestoreSP = NULL; in SignalSend()
206 OsSigCB *sigCB = NULL; in SignalCBInit() local
210 sigCB = (OsSigCB *)LOS_MemAlloc(OS_SYS_MEM_ADDR, sizeof(OsSigCB)); in SignalCBInit()
211 if (sigCB == NULL) { in SignalCBInit()
214 (VOID)memset_s(sigCB, sizeof(OsSigCB), 0, sizeof(OsSigCB)); in SignalCBInit()
215 LOS_ListInit(&sigCB->sigInfoList); in SignalCBInit()
218 sigCB->sigHandlers[i] = SignalDefaultHandler; in SignalCBInit()
221 task->sig = (VOID *)sigCB; in SignalCBInit()
223 sigCB = (OsSigCB *)task->sig; in SignalCBInit()
226 return sigCB; in SignalCBInit()
234 OsSigCB *sigCB = NULL; in LOS_SignalSet() local
245 sigCB = SignalCBInit(task); in LOS_SignalSet()
246 if (sigCB == NULL) { in LOS_SignalSet()
251 old = sigCB->sigHandlers[sigNo - 1]; /* signal number from 1, but index from 0 */ in LOS_SignalSet()
253 sigCB->sigHandlers[sigNo - 1] = NULL; in LOS_SignalSet()
254 sigCB->sigSetFlag &= ~LOS_SIGNAL_MASK(sigNo); in LOS_SignalSet()
256 sigCB->sigHandlers[sigNo - 1] = SignalDefaultHandler; in LOS_SignalSet()
257 sigCB->sigSetFlag |= LOS_SIGNAL_MASK(sigNo); in LOS_SignalSet()
259 sigCB->sigHandlers[sigNo - 1] = handler; in LOS_SignalSet()
260 sigCB->sigSetFlag |= LOS_SIGNAL_MASK(sigNo); in LOS_SignalSet()
271 OsSigCB *sigCB = NULL; in LOS_SignalMask() local
278 sigCB = SignalCBInit(task); in LOS_SignalMask()
279 if (sigCB == NULL) { in LOS_SignalMask()
285 *oldSet = sigCB->sigSetFlag; in LOS_SignalMask()
295 sigCB->sigSetFlag &= ~*set; in LOS_SignalMask()
298 sigCB->sigSetFlag = *set; in LOS_SignalMask()
301 sigCB->sigSetFlag |= *set; in LOS_SignalMask()
314 OsSigCB *sigCB = (OsSigCB *)task->sig; in SignalTimedWait() local
327 sigCB->sigWaitFlag |= *set; in SignalTimedWait()
328 sigCB->sigStatus |= OS_SIGNAL_STATUS_WAIT; in SignalTimedWait()
336 sigCB->sigStatus &= ~OS_SIGNAL_STATUS_WAIT; in SignalTimedWait()
337 sigCB->sigWaitFlag = 0; in SignalTimedWait()
343 sigNo = sigCB->sigInfo.si_signo; in SignalTimedWait()
344 sigCB->sigPendFlag &= ~LOS_SIGNAL_MASK(sigNo); in SignalTimedWait()
352 OsSigCB *sigCB = NULL; in LOS_SignalWait() local
365 sigCB = SignalCBInit(task); in LOS_SignalWait()
366 if (sigCB == NULL) { in LOS_SignalWait()
371 sigFlag = sigCB->sigPendFlag & *set; in LOS_SignalWait()
373 sigCB->sigPendFlag ^= sigFlag; in LOS_SignalWait()
375 DeleteSigInfoFromList(sigCB, sigNo); in LOS_SignalWait()
385 (VOID)memcpy_s(info, sizeof(siginfo_t), &sigCB->sigInfo, sizeof(siginfo_t)); in LOS_SignalWait()
396 OsSigCB *sigCB = NULL; in LOS_SignalSend() local
413 sigCB = SignalCBInit(task); in LOS_SignalSend()
414 if (sigCB == NULL) { in LOS_SignalSend()
419 if (!(sigCB->sigSetFlag & LOS_SIGNAL_MASK(sigNo))) { /* the signal has not been set */ in LOS_SignalSend()
424 UINT32 ret = AddSigInfoToList(sigCB, &info); in LOS_SignalSend()