📄 os_sem.lst
字号:
\ 000000E4 0010A0E3 MOV R1,#+0
\ 000000E8 2D10C0E5 STRB R1,[R0, #+45]
321 OSTCBCur->OSTCBDly = timeout; /* Store pend timeout in TCB */
\ 000000EC A0009FE5 LDR R0,??OSSemPend_4+0x4 ;; OSTCBCur
\ 000000F0 000090E5 LDR R0,[R0, #+0]
\ 000000F4 BA52C0E1 STRH R5,[R0, #+42]
322 OS_EventTaskWait(pevent); /* Suspend task until event or timeout occurs */
\ 000000F8 0400B0E1 MOVS R0,R4
\ 000000FC ........ _BLF OS_EventTaskWait,??OS_EventTaskWait??rA
323 OS_EXIT_CRITICAL();
\ 00000100 0800B0E1 MOVS R0,R8
\ 00000104 ........ _BLF OS_CPU_SR_Restore,??OS_CPU_SR_Restore??rA
324 OS_Sched(); /* Find next highest priority task ready */
\ 00000108 ........ _BLF OS_Sched,??OS_Sched??rA
325 OS_ENTER_CRITICAL();
\ 0000010C ........ _BLF OS_CPU_SR_Save,??OS_CPU_SR_Save??rA
\ 00000110 0080B0E1 MOVS R8,R0
326 if (OSTCBCur->OSTCBStatPend != OS_STAT_PEND_OK) { /* See if we timed-out or aborted */
\ 00000114 78009FE5 LDR R0,??OSSemPend_4+0x4 ;; OSTCBCur
\ 00000118 000090E5 LDR R0,[R0, #+0]
\ 0000011C 2D00D0E5 LDRB R0,[R0, #+45]
\ 00000120 000050E3 CMP R0,#+0
\ 00000124 1000000A BEQ ??OSSemPend_7
327 pend_stat = OSTCBCur->OSTCBStatPend;
\ 00000128 64009FE5 LDR R0,??OSSemPend_4+0x4 ;; OSTCBCur
\ 0000012C 000090E5 LDR R0,[R0, #+0]
\ 00000130 2D00D0E5 LDRB R0,[R0, #+45]
\ 00000134 0070B0E1 MOVS R7,R0
328 OS_EventTOAbort(pevent);
\ 00000138 0400B0E1 MOVS R0,R4
\ 0000013C ........ _BLF OS_EventTOAbort,??OS_EventTOAbort??rA
329 OS_EXIT_CRITICAL();
\ 00000140 0800B0E1 MOVS R0,R8
\ 00000144 ........ _BLF OS_CPU_SR_Restore,??OS_CPU_SR_Restore??rA
330 switch (pend_stat) {
\ 00000148 0700B0E1 MOVS R0,R7
\ 0000014C 020050E3 CMP R0,#+2
\ 00000150 0200000A BEQ ??OSSemPend_8
331 case OS_STAT_PEND_TO:
332 default:
333 *err = OS_ERR_TIMEOUT; /* Indicate that didn't get event within TO */
\ ??OSSemPend_9:
\ 00000154 0A00A0E3 MOV R0,#+10
\ 00000158 0000C6E5 STRB R0,[R6, #+0]
\ 0000015C 0A0000EA B ??OSSemPend_0
334 break;
335
336 case OS_STAT_PEND_ABORT:
337 *err = OS_ERR_PEND_ABORT; /* Indicate that we aborted */
\ ??OSSemPend_8:
\ 00000160 0E00A0E3 MOV R0,#+14
\ 00000164 0000C6E5 STRB R0,[R6, #+0]
\ 00000168 070000EA B ??OSSemPend_0
338 break;
339 }
340 return;
341 }
342 OSTCBCur->OSTCBEventPtr = (OS_EVENT *)0;
\ ??OSSemPend_7:
\ 0000016C 20009FE5 LDR R0,??OSSemPend_4+0x4 ;; OSTCBCur
\ 00000170 000090E5 LDR R0,[R0, #+0]
\ 00000174 0010A0E3 MOV R1,#+0
\ 00000178 1C1080E5 STR R1,[R0, #+28]
343 OS_EXIT_CRITICAL();
\ 0000017C 0800B0E1 MOVS R0,R8
\ 00000180 ........ _BLF OS_CPU_SR_Restore,??OS_CPU_SR_Restore??rA
344 *err = OS_ERR_NONE;
\ 00000184 0000A0E3 MOV R0,#+0
\ 00000188 0000C6E5 STRB R0,[R6, #+0]
345 }
\ ??OSSemPend_0:
\ 0000018C F081BDE8 POP {R4-R8,PC} ;; return
\ ??OSSemPend_4:
\ 00000190 ........ DC32 OSLockNesting
\ 00000194 ........ DC32 OSTCBCur
346
347 /*$PAGE*/
348 /*
349 *********************************************************************************************************
350 * ABORT WAITING ON A SEMAPHORE
351 *
352 * Description: This function aborts & readies any tasks currently waiting on a semaphore. This function
353 * should be used to fault-abort the wait on the semaphore, rather than to normally signal
354 * the semaphore via OSSemPost().
355 *
356 * Arguments : pevent is a pointer to the event control block associated with the desired
357 * semaphore.
358 *
359 * opt determines the type of ABORT performed:
360 * OS_PEND_OPT_NONE ABORT wait for a single task (HPT) waiting on the
361 * semaphore
362 * OS_PEND_OPT_BROADCAST ABORT wait for ALL tasks that are waiting on the
363 * semaphore
364 *
365 * err is a pointer to where an error message will be deposited. Possible error
366 * messages are:
367 *
368 * OS_ERR_NONE No tasks were waiting on the semaphore.
369 * OS_ERR_PEND_ABORT At least one task waiting on the semaphore was readied
370 * and informed of the aborted wait; check return value
371 * for the number of tasks whose wait on the semaphore
372 * was aborted.
373 * OS_ERR_EVENT_TYPE If you didn't pass a pointer to a semaphore.
374 * OS_ERR_PEVENT_NULL If 'pevent' is a NULL pointer.
375 *
376 * Returns : == 0 if no tasks were waiting on the semaphore, or upon error.
377 * > 0 if one or more tasks waiting on the semaphore are now readied and informed.
378 *********************************************************************************************************
379 */
380
381 #if OS_SEM_PEND_ABORT_EN > 0
\ In segment CODE, align 4, keep-with-next
382 INT8U OSSemPendAbort (OS_EVENT *pevent, INT8U opt, INT8U *err)
383 {
\ OSSemPendAbort:
\ 00000000 F0412DE9 PUSH {R4-R8,LR}
\ 00000004 0040B0E1 MOVS R4,R0
\ 00000008 0150B0E1 MOVS R5,R1
\ 0000000C 0260B0E1 MOVS R6,R2
384 INT8U nbr_tasks;
385 #if OS_CRITICAL_METHOD == 3 /* Allocate storage for CPU status register */
386 OS_CPU_SR cpu_sr = 0;
\ 00000010 0000A0E3 MOV R0,#+0
\ 00000014 0080B0E1 MOVS R8,R0
387 #endif
388
389
390
391 #if OS_ARG_CHK_EN > 0
392 if (err == (INT8U *)0) { /* Validate 'err' */
\ 00000018 000056E3 CMP R6,#+0
\ 0000001C 0100001A BNE ??OSSemPendAbort_0
393 return (0);
\ 00000020 0000A0E3 MOV R0,#+0
\ 00000024 330000EA B ??OSSemPendAbort_1
394 }
395 if (pevent == (OS_EVENT *)0) { /* Validate 'pevent' */
\ ??OSSemPendAbort_0:
\ 00000028 000054E3 CMP R4,#+0
\ 0000002C 0300001A BNE ??OSSemPendAbort_2
396 *err = OS_ERR_PEVENT_NULL;
\ 00000030 0400A0E3 MOV R0,#+4
\ 00000034 0000C6E5 STRB R0,[R6, #+0]
397 return (0);
\ 00000038 0000A0E3 MOV R0,#+0
\ 0000003C 2D0000EA B ??OSSemPendAbort_1
398 }
399 #endif
400 if (pevent->OSEventType != OS_EVENT_TYPE_SEM) { /* Validate event block type */
\ ??OSSemPendAbort_2:
\ 00000040 0000D4E5 LDRB R0,[R4, #+0]
\ 00000044 030050E3 CMP R0,#+3
\ 00000048 0300000A BEQ ??OSSemPendAbort_3
401 *err = OS_ERR_EVENT_TYPE;
\ 0000004C 0100A0E3 MOV R0,#+1
\ 00000050 0000C6E5 STRB R0,[R6, #+0]
402 return (0);
\ 00000054 0000A0E3 MOV R0,#+0
\ 00000058 260000EA B ??OSSemPendAbort_1
403 }
404 OS_ENTER_CRITICAL();
\ ??OSSemPendAbort_3:
\ 0000005C ........ _BLF OS_CPU_SR_Save,??OS_CPU_SR_Save??rA
\ 00000060 0080B0E1 MOVS R8,R0
405 if (pevent->OSEventGrp != 0) { /* See if any task waiting on semaphore? */
\ 00000064 0A00D4E5 LDRB R0,[R4, #+10]
\ 00000068 000050E3 CMP R0,#+0
\ 0000006C 1C00000A BEQ ??OSSemPendAbort_4
406 nbr_tasks = 0;
\ 00000070 0000A0E3 MOV R0,#+0
\ 00000074 0070B0E1 MOVS R7,R0
407 switch (opt) {
\ 00000078 0500B0E1 MOVS R0,R5
\ 0000007C 010050E3 CMP R0,#+1
\ 00000080 0900001A BNE ??OSSemPendAbort_5
408 case OS_PEND_OPT_BROADCAST: /* Do we need to abort ALL waiting tasks? */
409 while (pevent->OSEventGrp != 0) { /* Yes, ready ALL tasks waiting on semaphore */
\ ??OSSemPendAbort_6:
\ 00000084 0A00D4E5 LDRB R0,[R4, #+10]
\ 00000088 000050E3 CMP R0,#+0
\ 0000008C 0C00000A BEQ ??OSSemPendAbort_7
410 (void)OS_EventTaskRdy(pevent, (void *)0, OS_STAT_SEM, OS_STAT_PEND_ABORT);
\ 00000090 0230A0E3 MOV R3,#+2
\ 00000094 0120A0E3 MOV R2,#+1
\ 00000098 0010A0E3 MOV R1,#+0
\ 0000009C 0400B0E1 MOVS R0,R4
\ 000000A0 ........ _BLF OS_EventTaskRdy,??OS_EventTaskRdy??rA
411 nbr_tasks++;
\ 000000A4 017097E2 ADDS R7,R7,#+1
\ 000000A8 F5FFFFEA B ??OSSemPendAbort_6
412 }
413 break;
414
415 case OS_PEND_OPT_NONE: /* No, ready HPT waiting on semaphore */
416 default:
417 (void)OS_EventTaskRdy(pevent, (void *)0, OS_STAT_SEM, OS_STAT_PEND_ABORT);
\ ??OSSemPendAbort_5:
\ 000000AC 0230A0E3 MOV R3,#+2
\ 000000B0 0120A0E3 MOV R2,#+1
\ 000000B4 0010A0E3 MOV R1,#+0
\ 000000B8 0400B0E1 MOVS R0,R4
\ 000000BC ........ _BLF OS_EventTaskRdy,??OS_EventTaskRdy??rA
418 nbr_tasks++;
\ 000000C0 017097E2 ADDS R7,R7,#+1
419 break;
420 }
421 OS_EXIT_CRITICAL();
\ ??OSSemPendAbort_7:
\ 000000C4 0800B0E1 MOVS R0,R8
\ 000000C8 ........ _BLF OS_CPU_SR_Restore,??OS_CPU_SR_Restore??rA
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -