📄 os_sem.lst
字号:
\ 000000B8 300000EA B ??OSSemPend_0
317 }
318 /* Otherwise, must wait until event occurs */
319 OSTCBCur->OSTCBStat |= OS_STAT_SEM; /* Resource not available, pend on semaphore */
\ ??OSSemPend_6:
\ 000000BC C4009FE5 LDR R0,??OSSemPend_4+0x4 ;; OSTCBCur
\ 000000C0 000090E5 LDR R0,[R0, #+0]
\ 000000C4 BC109FE5 LDR R1,??OSSemPend_4+0x4 ;; OSTCBCur
\ 000000C8 001091E5 LDR R1,[R1, #+0]
\ 000000CC 2C10D1E5 LDRB R1,[R1, #+44]
\ 000000D0 011091E3 ORRS R1,R1,#0x1
\ 000000D4 2C10C0E5 STRB R1,[R0, #+44]
320 OSTCBCur->OSTCBStatPend = OS_STAT_PEND_OK;
\ 000000D8 A8009FE5 LDR R0,??OSSemPend_4+0x4 ;; OSTCBCur
\ 000000DC 000090E5 LDR R0,[R0, #+0]
\ 000000E0 0010A0E3 MOV R1,#+0
\ 000000E4 2D10C0E5 STRB R1,[R0, #+45]
321 OSTCBCur->OSTCBDly = timeout; /* Store pend timeout in TCB */
\ 000000E8 98009FE5 LDR R0,??OSSemPend_4+0x4 ;; OSTCBCur
\ 000000EC 000090E5 LDR R0,[R0, #+0]
\ 000000F0 BA62C0E1 STRH R6,[R0, #+42]
322 OS_EventTaskWait(pevent); /* Suspend task until event or timeout occurs */
\ 000000F4 0500B0E1 MOVS R0,R5
\ 000000F8 ........ _BLF OS_EventTaskWait,??OS_EventTaskWait??rA
323 OS_EXIT_CRITICAL();
\ 000000FC 0700B0E1 MOVS R0,R7
\ 00000100 ........ _BLF OS_CPU_SR_Restore,??OS_CPU_SR_Restore??rA
324 OS_Sched(); /* Find next highest priority task ready */
\ 00000104 ........ _BLF OS_Sched,??OS_Sched??rA
325 OS_ENTER_CRITICAL();
\ 00000108 ........ _BLF OS_CPU_SR_Save,??OS_CPU_SR_Save??rA
\ 0000010C 0070B0E1 MOVS R7,R0
326 if (OSTCBCur->OSTCBStatPend != OS_STAT_PEND_OK) { /* See if we timed-out or aborted */
\ 00000110 70009FE5 LDR R0,??OSSemPend_4+0x4 ;; OSTCBCur
\ 00000114 000090E5 LDR R0,[R0, #+0]
\ 00000118 2D00D0E5 LDRB R0,[R0, #+45]
\ 0000011C 000050E3 CMP R0,#+0
\ 00000120 0E00000A BEQ ??OSSemPend_7
327 pend_stat = OSTCBCur->OSTCBStatPend;
\ 00000124 5C009FE5 LDR R0,??OSSemPend_4+0x4 ;; OSTCBCur
\ 00000128 000090E5 LDR R0,[R0, #+0]
\ 0000012C 2D60D0E5 LDRB R6,[R0, #+45]
328 OS_EventTOAbort(pevent);
\ 00000130 0500B0E1 MOVS R0,R5
\ 00000134 ........ _BLF OS_EventTOAbort,??OS_EventTOAbort??rA
329 OS_EXIT_CRITICAL();
\ 00000138 0700B0E1 MOVS R0,R7
\ 0000013C ........ _BLF OS_CPU_SR_Restore,??OS_CPU_SR_Restore??rA
330 switch (pend_stat) {
\ 00000140 020056E3 CMP R6,#+2
\ 00000144 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:
\ 00000148 0A00A0E3 MOV R0,#+10
\ 0000014C 0000C4E5 STRB R0,[R4, #+0]
\ 00000150 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:
\ 00000154 0E00A0E3 MOV R0,#+14
\ 00000158 0000C4E5 STRB R0,[R4, #+0]
\ 0000015C 070000EA B ??OSSemPend_0
338 break;
339 }
340 return;
341 }
342 OSTCBCur->OSTCBEventPtr = (OS_EVENT *)0;
\ ??OSSemPend_7:
\ 00000160 20009FE5 LDR R0,??OSSemPend_4+0x4 ;; OSTCBCur
\ 00000164 000090E5 LDR R0,[R0, #+0]
\ 00000168 0010A0E3 MOV R1,#+0
\ 0000016C 1C1080E5 STR R1,[R0, #+28]
343 OS_EXIT_CRITICAL();
\ 00000170 0700B0E1 MOVS R0,R7
\ 00000174 ........ _BLF OS_CPU_SR_Restore,??OS_CPU_SR_Restore??rA
344 *err = OS_ERR_NONE;
\ 00000178 0000A0E3 MOV R0,#+0
\ 0000017C 0000C4E5 STRB R0,[R4, #+0]
345 }
\ ??OSSemPend_0:
\ 00000180 F080BDE8 POP {R4-R7,PC} ;; return
\ ??OSSemPend_4:
\ 00000184 ........ DC32 OSLockNesting
\ 00000188 ........ 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 0050B0E1 MOVS R5,R0
\ 00000008 0160B0E1 MOVS R6,R1
\ 0000000C 0240B0E1 MOVS R4,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 0080A0E3 MOV R8,#+0
387 #endif
388
389
390
391 #if OS_ARG_CHK_EN > 0
392 if (err == (INT8U *)0) { /* Validate 'err' */
\ 00000014 000054E3 CMP R4,#+0
\ 00000018 0100001A BNE ??OSSemPendAbort_0
393 return (0);
\ 0000001C 0000A0E3 MOV R0,#+0
\ 00000020 310000EA B ??OSSemPendAbort_1
394 }
395 if (pevent == (OS_EVENT *)0) { /* Validate 'pevent' */
\ ??OSSemPendAbort_0:
\ 00000024 000055E3 CMP R5,#+0
\ 00000028 0300001A BNE ??OSSemPendAbort_2
396 *err = OS_ERR_PEVENT_NULL;
\ 0000002C 0400A0E3 MOV R0,#+4
\ 00000030 0000C4E5 STRB R0,[R4, #+0]
397 return (0);
\ 00000034 0000A0E3 MOV R0,#+0
\ 00000038 2B0000EA B ??OSSemPendAbort_1
398 }
399 #endif
400 if (pevent->OSEventType != OS_EVENT_TYPE_SEM) { /* Validate event block type */
\ ??OSSemPendAbort_2:
\ 0000003C 0000D5E5 LDRB R0,[R5, #+0]
\ 00000040 030050E3 CMP R0,#+3
\ 00000044 0300000A BEQ ??OSSemPendAbort_3
401 *err = OS_ERR_EVENT_TYPE;
\ 00000048 0100A0E3 MOV R0,#+1
\ 0000004C 0000C4E5 STRB R0,[R4, #+0]
402 return (0);
\ 00000050 0000A0E3 MOV R0,#+0
\ 00000054 240000EA B ??OSSemPendAbort_1
403 }
404 OS_ENTER_CRITICAL();
\ ??OSSemPendAbort_3:
\ 00000058 ........ _BLF OS_CPU_SR_Save,??OS_CPU_SR_Save??rA
\ 0000005C 0080B0E1 MOVS R8,R0
405 if (pevent->OSEventGrp != 0) { /* See if any task waiting on semaphore? */
\ 00000060 0A00D5E5 LDRB R0,[R5, #+10]
\ 00000064 000050E3 CMP R0,#+0
\ 00000068 1A00000A BEQ ??OSSemPendAbort_4
406 nbr_tasks = 0;
\ 0000006C 0070A0E3 MOV R7,#+0
407 switch (opt) {
\ 00000070 010056E3 CMP R6,#+1
\ 00000074 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:
\ 00000078 0A00D5E5 LDRB R0,[R5, #+10]
\ 0000007C 000050E3 CMP R0,#+0
\ 00000080 0C00000A BEQ ??OSSemPendAbort_7
410 (void)OS_EventTaskRdy(pevent, (void *)0, OS_STAT_SEM, OS_STAT_PEND_ABORT);
\ 00000084 0230A0E3 MOV R3,#+2
\ 00000088 0120A0E3 MOV R2,#+1
\ 0000008C 0010A0E3 MOV R1,#+0
\ 00000090 0500B0E1 MOVS R0,R5
\ 00000094 ........ _BLF OS_EventTaskRdy,??OS_EventTaskRdy??rA
411 nbr_tasks++;
\ 00000098 017097E2 ADDS R7,R7,#+1
\ 0000009C 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:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -