📄 os_flag.txt
字号:
;;;390 return ((OS_FLAGS)0);
0005a0 e3a00000 MOV r0,#0
|L1.1444|
0005a4 e28dd01c ADD sp,sp,#0x1c
0005a8 e8bd4ff0 POP {r4-r11,lr}
;;;391 }
;;;392 #if OS_ARG_CHK_EN > 0
;;;393 if (pgrp == (OS_FLAG_GRP *)0) { /* Validate 'pgrp' */
;;;394 *err = OS_FLAG_INVALID_PGRP;
;;;395 return ((OS_FLAGS)0);
;;;396 }
;;;397 if (pgrp->OSFlagType != OS_EVENT_TYPE_FLAG) { /* Validate event block type */
;;;398 *err = OS_ERR_EVENT_TYPE;
;;;399 return ((OS_FLAGS)0);
;;;400 }
;;;401 #endif
;;;402 if (wait_type & OS_FLAG_CONSUME) { /* See if we need to consume the flags */
;;;403 wait_type &= ~OS_FLAG_CONSUME;
;;;404 consume = TRUE;
;;;405 } else {
;;;406 consume = FALSE;
;;;407 }
;;;408 /*$PAGE*/
;;;409 OS_ENTER_CRITICAL();
;;;410 switch (wait_type) {
;;;411 case OS_FLAG_WAIT_SET_ALL: /* See if all required flags are set */
;;;412 flags_rdy = pgrp->OSFlagFlags & flags; /* Extract only the bits we want */
;;;413 if (flags_rdy == flags) { /* Must match ALL the bits that we want */
;;;414 if (consume == TRUE) { /* See if we need to consume the flags */
;;;415 pgrp->OSFlagFlags &= ~flags_rdy; /* Clear ONLY the flags that we wanted */
;;;416 }
;;;417 flags_cur = pgrp->OSFlagFlags; /* Will return the state of the group */
;;;418 OS_EXIT_CRITICAL(); /* Yes, condition met, return to caller */
;;;419 *err = OS_NO_ERR;
;;;420 return (flags_cur);
;;;421 } else { /* Block task until events occur or timeout */
;;;422 OS_FlagBlock(pgrp, &node, flags, wait_type, timeout);
;;;423 OS_EXIT_CRITICAL();
;;;424 }
;;;425 break;
;;;426
;;;427 case OS_FLAG_WAIT_SET_ANY:
;;;428 flags_rdy = pgrp->OSFlagFlags & flags; /* Extract only the bits we want */
;;;429 if (flags_rdy != (OS_FLAGS)0) { /* See if any flag set */
;;;430 if (consume == TRUE) { /* See if we need to consume the flags */
;;;431 pgrp->OSFlagFlags &= ~flags_rdy; /* Clear ONLY the flags that we got */
;;;432 }
;;;433 flags_cur = pgrp->OSFlagFlags; /* Will return the state of the group */
;;;434 OS_EXIT_CRITICAL(); /* Yes, condition met, return to caller */
;;;435 *err = OS_NO_ERR;
;;;436 return (flags_cur);
;;;437 } else { /* Block task until events occur or timeout */
;;;438 OS_FlagBlock(pgrp, &node, flags, wait_type, timeout);
;;;439 OS_EXIT_CRITICAL();
;;;440 }
;;;441 break;
;;;442
;;;443 #if OS_FLAG_WAIT_CLR_EN > 0
;;;444 case OS_FLAG_WAIT_CLR_ALL: /* See if all required flags are cleared */
;;;445 flags_rdy = ~pgrp->OSFlagFlags & flags; /* Extract only the bits we want */
;;;446 if (flags_rdy == flags) { /* Must match ALL the bits that we want */
;;;447 if (consume == TRUE) { /* See if we need to consume the flags */
;;;448 pgrp->OSFlagFlags |= flags_rdy; /* Set ONLY the flags that we wanted */
;;;449 }
;;;450 flags_cur = pgrp->OSFlagFlags; /* Will return the state of the group */
;;;451 OS_EXIT_CRITICAL(); /* Yes, condition met, return to caller */
;;;452 *err = OS_NO_ERR;
;;;453 return (flags_cur);
;;;454 } else { /* Block task until events occur or timeout */
;;;455 OS_FlagBlock(pgrp, &node, flags, wait_type, timeout);
;;;456 OS_EXIT_CRITICAL();
;;;457 }
;;;458 break;
;;;459
;;;460 case OS_FLAG_WAIT_CLR_ANY:
;;;461 flags_rdy = ~pgrp->OSFlagFlags & flags; /* Extract only the bits we want */
;;;462 if (flags_rdy != (OS_FLAGS)0) { /* See if any flag cleared */
;;;463 if (consume == TRUE) { /* See if we need to consume the flags */
;;;464 pgrp->OSFlagFlags |= flags_rdy; /* Set ONLY the flags that we got */
;;;465 }
;;;466 flags_cur = pgrp->OSFlagFlags; /* Will return the state of the group */
;;;467 OS_EXIT_CRITICAL(); /* Yes, condition met, return to caller */
;;;468 *err = OS_NO_ERR;
;;;469 return (flags_cur);
;;;470 } else { /* Block task until events occur or timeout */
;;;471 OS_FlagBlock(pgrp, &node, flags, wait_type, timeout);
;;;472 OS_EXIT_CRITICAL();
;;;473 }
;;;474 break;
;;;475 #endif
;;;476
;;;477 default:
;;;478 OS_EXIT_CRITICAL();
;;;479 flags_cur = (OS_FLAGS)0;
;;;480 *err = OS_FLAG_ERR_WAIT_TYPE;
;;;481 return (flags_cur);
;;;482 }
;;;483 OS_Sched(); /* Find next HPT ready to run */
;;;484 OS_ENTER_CRITICAL();
;;;485 if (OSTCBCur->OSTCBStat & OS_STAT_FLAG) { /* Have we timed-out? */
;;;486 OS_FlagUnlink(&node);
;;;487 OSTCBCur->OSTCBStat = OS_STAT_RDY; /* Yes, make task ready-to-run */
;;;488 OS_EXIT_CRITICAL();
;;;489 flags_cur = (OS_FLAGS)0;
;;;490 *err = OS_TIMEOUT; /* Indicate that we timed-out waiting */
;;;491 } else {
;;;492 if (consume == TRUE) { /* See if we need to consume the flags */
;;;493 switch (wait_type) {
;;;494 case OS_FLAG_WAIT_SET_ALL:
;;;495 case OS_FLAG_WAIT_SET_ANY: /* Clear ONLY the flags we got */
;;;496 pgrp->OSFlagFlags &= ~OSTCBCur->OSTCBFlagsRdy;
;;;497 break;
;;;498
;;;499 #if OS_FLAG_WAIT_CLR_EN > 0
;;;500 case OS_FLAG_WAIT_CLR_ALL:
;;;501 case OS_FLAG_WAIT_CLR_ANY: /* Set ONLY the flags we got */
;;;502 pgrp->OSFlagFlags |= OSTCBCur->OSTCBFlagsRdy;
;;;503 break;
;;;504 #endif
;;;505 }
;;;506 }
;;;507 flags_cur = pgrp->OSFlagFlags;
;;;508 OS_EXIT_CRITICAL();
;;;509 *err = OS_NO_ERR; /* Event(s) must have occurred */
;;;510 }
;;;511 return (flags_cur);
;;;512 }
0005ac e12fff1e BX lr
|L1.1456|
0005b0 e3540000 CMP r4,#0 ;393
0005b4 1a000003 BNE |L1.1480| ;393
0005b8 e3a00096 MOV r0,#0x96 ;394
0005bc e5c80000 STRB r0,[r8,#0] ;394
0005c0 e3a00000 MOV r0,#0 ;395
0005c4 eafffff6 B |L1.1444| ;395
|L1.1480|
0005c8 e5d40000 LDRB r0,[r4,#0] ;397
0005cc e3500005 CMP r0,#5 ;397
0005d0 0a000003 BEQ |L1.1508| ;397
0005d4 e3a00001 MOV r0,#1 ;398
0005d8 e5c80000 STRB r0,[r8,#0] ;398
0005dc e3a00000 MOV r0,#0 ;399
0005e0 eaffffef B |L1.1444| ;399
|L1.1508|
0005e4 e3160080 TST r6,#0x80 ;402
0005e8 0a000002 BEQ |L1.1528| ;402
0005ec e3c66080 BIC r6,r6,#0x80 ;403
0005f0 e3a0b001 MOV r11,#1 ;404
0005f4 ea000000 B |L1.1532| ;404
|L1.1528|
0005f8 e3a0b000 MOV r11,#0 ;406
|L1.1532|
0005fc ef000002 SVC 0x2 ; formerly SWI ;409
000600 e3560000 CMP r6,#0 ;410
000604 0a000036 BEQ |L1.1764| ;410
000608 e3560001 CMP r6,#1 ;410
00060c 0a00004e BEQ |L1.1868| ;410
000610 e3560002 CMP r6,#2 ;410
000614 0a000002 BEQ |L1.1572| ;410
000618 e3560003 CMP r6,#3 ;410
00061c 1a000064 BNE |L1.1972| ;410
000620 ea000017 B |L1.1668| ;410
|L1.1572|
000624 e1a00000 MOV r0,r0 ;411
000628 e1d400b8 LDRH r0,[r4,#8] ;412
00062c e000a005 AND r10,r0,r5 ;412
000630 e15a0005 CMP r10,r5 ;413
000634 1a00000a BNE |L1.1636| ;413
000638 e35b0001 CMP r11,#1 ;414
00063c 1a000002 BNE |L1.1612| ;414
000640 e1d400b8 LDRH r0,[r4,#8] ;415
000644 e1c0000a BIC r0,r0,r10 ;415
000648 e1c400b8 STRH r0,[r4,#8] ;415
|L1.1612|
00064c e1d490b8 LDRH r9,[r4,#8] ;417
000650 ef000003 SVC 0x3 ; formerly SWI ;418
000654 e3a00000 MOV r0,#0 ;419
000658 e5c80000 STRB r0,[r8,#0] ;419
00065c e1a00009 MOV r0,r9 ;420
000660 eaffffcf B |L1.1444| ;420
|L1.1636|
000664 e1a03006 MOV r3,r6 ;422
000668 e1a02005 MOV r2,r5 ;422
00066c e58d7000 STR r7,[sp,#0] ;422
000670 e28d1008 ADD r1,sp,#8 ;422
000674 e1a00004 MOV r0,r4 ;422
000678 ebfffffe BL OS_FlagBlock ;422
00067c ef000003 SVC 0x3 ; formerly SWI ;423
000680 ea000052 B |L1.2000| ;425
|L1.1668|
000684 e1a00000 MOV r0,r0 ;427
000688 e1d400b8 LDRH r0,[r4,#8] ;428
00068c e000a005 AND r10,r0,r5 ;428
000690 e35a0000 CMP r10,#0 ;429
000694 0a00000a BEQ |L1.1732| ;429
000698 e35b0001 CMP r11,#1 ;430
00069c 1a000002 BNE |L1.1708| ;430
0006a0 e1d400b8 LDRH r0,[r4,#8] ;431
0006a4 e1c0000a BIC r0,r0,r10 ;431
0006a8 e1c400b8 STRH r0,[r4,#8] ;431
|L1.1708|
0006ac e1d490b8 LDRH r9,[r4,#8] ;433
0006b0 ef000003 SVC 0x3 ; formerly SWI ;434
0006b4 e3a00000 MOV r0,#0 ;435
0006b8 e5c80000 STRB r0,[r8,#0] ;435
0006bc e1a00009 MOV r0,r9 ;436
0006c0 eaffffb7 B |L1.1444| ;436
|L1.1732|
0006c4 e1a03006 MOV r3,r6 ;438
0006c8 e1a02005 MOV r2,r5 ;438
0006cc e58d7000 STR r7,[sp,#0] ;438
0006d0 e28d1008 ADD r1,sp,#8 ;438
0006d4 e1a00004 MOV r0,r4 ;438
0006d8 ebfffffe BL OS_FlagBlock ;438
0006dc ef000003 SVC 0x3 ; formerly SWI ;439
0006e0 ea00003a B |L1.2000| ;441
|L1.1764|
0006e4 e1a00000 MOV r0,r0 ;444
0006e8 e1d400b8 LDRH r0,[r4,#8] ;445
0006ec e1c50000 BIC r0,r5,r0 ;445
0006f0 e1a0a800 LSL r10,r0,#16 ;445
0006f4 e1a0a82a LSR r10,r10,#16 ;445
0006f8 e15a0005 CMP r10,r5 ;446
0006fc 1a00000a BNE |L1.1836| ;446
000700 e35b0001 CMP r11,#1 ;447
000704 1a000002 BNE |L1.1812| ;447
000708 e1d400b8 LDRH r0,[r4,#8] ;448
00070c e180000a ORR r0,r0,r10 ;448
000710 e1c400b8 STRH r0,[r4,#8] ;448
|L1.1812|
000714 e1d490b8 LDRH r9,[r4,#8] ;450
000718 ef000003 SVC 0x3 ; formerly SWI ;451
00071c e3a00000 MOV r0,#0 ;452
000720 e5c80000 STRB r0,[r8,#0] ;452
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -