⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 queue.lst

📁 MSP430 IAR project with FreeRTOS port.
💻 LST
📖 第 1 页 / 共 5 页
字号:
   \   0000AA   0343         NOP
   \   0000AC   9253....     ADD.W   #0x1, &usCriticalNesting
    339          	{
    340          		if( pxQueue->uxMessagesWaiting < pxQueue->uxLength )
   \   0000B0   99991E001C00 CMP.W   0x1e(R9), 0x1c(R9)
   \   0000B6   1A2C         JC      ??xQueueSend_4
    341          		{
    342          			/* There is room in the queue, copy the data into the queue. */			
    343          			prvCopyQueueData( pxQueue, pvItemToQueue );		
   \   0000B8   19122000     PUSH.W  0x20(R9)
   \   0000BC   0E4A         MOV.W   R10, R14
   \   0000BE   1C490400     MOV.W   0x4(R9), R12
   \   0000C2   B012....     CALL    #memcpy
   \   0000C6   0F49         MOV.W   R9, R15
   \   0000C8   9F531C00     ADD.W   #0x1, 0x1c(R15)
   \   0000CC   0F49         MOV.W   R9, R15
   \   0000CE   9F5920000400 ADD.W   0x20(R9), 0x4(R15)
   \   0000D4   2153         ADD.W   #0x2, SP
   \   0000D6   999902000400 CMP.W   0x2(R9), 0x4(R9)
   \   0000DC   0228         JNC     ??xQueueSend_5
   \   0000DE   A9490400     MOV.W   @R9, 0x4(R9)
    344          			xReturn = pdPASS;
   \                     ??xQueueSend_5:
   \   0000E2   1843         MOV.W   #0x1, R8
    345          
    346          			/* Update the TxLock count so prvUnlockQueue knows to check for
    347          			tasks waiting for data to become available in the queue. */
    348          			++( pxQueue->xTxLock );
   \   0000E4   0F49         MOV.W   R9, R15
   \   0000E6   9F532400     ADD.W   #0x1, 0x24(R15)
   \   0000EA   023C         JMP     ??xQueueSend_6
    349          		}
    350          		else
    351          		{
    352          			xReturn = errQUEUE_FULL;
   \                     ??xQueueSend_4:
   \   0000EC   3840FDFF     MOV.W   #0xfffd, R8
    353          		}
    354          	}
    355          	taskEXIT_CRITICAL();
   \                     ??xQueueSend_6:
   \   0000F0   8293....     CMP.W   #0x0, &usCriticalNesting
   \   0000F4   0624         JEQ     ??xQueueSend_7
   \   0000F6   B253....     ADD.W   #0xffff, &usCriticalNesting
   \   0000FA   8293....     CMP.W   #0x0, &usCriticalNesting
   \   0000FE   0120         JNE     ??xQueueSend_7
   \   000100   32D2         EINT
    356          
    357          	/* We no longer require exclusive access to the queue.  prvUnlockQueue
    358          	will remove any tasks suspended on a receive if either this function
    359          	or an ISR has posted onto the queue. */
    360          	if( prvUnlockQueue( pxQueue ) )
   \                     ??xQueueSend_7:
   \   000102   0C49         MOV.W   R9, R12
   \   000104   B012....     CALL    #prvUnlockQueue
   \   000108   0C93         CMP.W   #0x0, R12
   \   00010A   0724         JEQ     ??xQueueSend_8
    361          	{
    362          		/* Resume the scheduler - making ready any tasks that were woken
    363          		by an event while the scheduler was locked.  Resuming the
    364          		scheduler may cause a yield, in which case there is no point
    365          		yielding again here. */
    366          		if( !xTaskResumeAll() )
   \   00010C   B012....     CALL    #xTaskResumeAll
   \   000110   0C93         CMP.W   #0x0, R12
   \   000112   0520         JNE     ??xQueueSend_9
    367          		{
    368          			taskYIELD();
   \   000114   B012....     CALL    #vPortYield
   \   000118   023C         JMP     ??xQueueSend_9
    369          		}
    370          	}
    371          	else
    372          	{
    373          		/* Resume the scheduler - making ready any tasks that were woken
    374          		by an event while the scheduler was locked. */
    375          		xTaskResumeAll();
   \                     ??xQueueSend_8:
   \   00011A   B012....     CALL    #xTaskResumeAll
    376          	}
    377          
    378          	return xReturn;
   \                     ??xQueueSend_9:
   \   00011E   0C48         MOV.W   R8, R12
   \   000120   3040....     BR      #?Epilogue4
    379          }
    380          /*-----------------------------------------------------------*/
    381          

   \                                 In segment CODE, align 2
    382          signed portBASE_TYPE xQueueSendFromISR( xQueueHandle pxQueue, const void *pvItemToQueue, signed portBASE_TYPE xTaskPreviouslyWoken )
   \                     xQueueSendFromISR:
    383          {
   \   000000   0A12         PUSH.W  R10
   \   000002   0B12         PUSH.W  R11
   \   000004   0812         PUSH.W  R8
   \   000006   0A4C         MOV.W   R12, R10
   \   000008   0B4E         MOV.W   R14, R11
   \   00000A   18410800     MOV.W   0x8(SP), R8
    384          	/* Similar to xQueueSend, except we don't block if there is no room in the
    385          	queue.  Also we don't directly wake a task that was blocked on a queue
    386          	read, instead we return a flag to say whether a context switch is required
    387          	or not (i.e. has a task with a higher priority than us been woken by this
    388          	post). */
    389          	if( pxQueue->uxMessagesWaiting < pxQueue->uxLength )
   \   00000E   9A9A1E001C00 CMP.W   0x1e(R10), 0x1c(R10)
   \   000014   292C         JC      ??xQueueSendFromISR_0
    390          	{
    391          		prvCopyQueueData( pxQueue, pvItemToQueue );
   \   000016   1A122000     PUSH.W  0x20(R10)
   \   00001A   0E4B         MOV.W   R11, R14
   \   00001C   1C4A0400     MOV.W   0x4(R10), R12
   \   000020   B012....     CALL    #memcpy
   \   000024   0F4A         MOV.W   R10, R15
   \   000026   9F531C00     ADD.W   #0x1, 0x1c(R15)
   \   00002A   0F4A         MOV.W   R10, R15
   \   00002C   9F5A20000400 ADD.W   0x20(R10), 0x4(R15)
   \   000032   2153         ADD.W   #0x2, SP
   \   000034   9A9A02000400 CMP.W   0x2(R10), 0x4(R10)
   \   00003A   0228         JNC     ??xQueueSendFromISR_1
   \   00003C   AA4A0400     MOV.W   @R10, 0x4(R10)
    392          
    393          		/* If the queue is locked we do not alter the event list.  This will
    394          		be done when the queue is unlocked later. */
    395          		if( pxQueue->xTxLock == queueUNLOCKED )
   \                     ??xQueueSendFromISR_1:
   \   000040   BA932400     CMP.W   #0xffff, 0x24(R10)
   \   000044   0E20         JNE     ??xQueueSendFromISR_2
    396          		{
    397          			/* We only want to wake one task per ISR, so check that a task has
    398          			not already been woken. */
    399          			if( !xTaskPreviouslyWoken )		
   \   000046   0893         CMP.W   #0x0, R8
   \   000048   0F20         JNE     ??xQueueSendFromISR_0
    400          			{
    401          				if( !listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) )
   \   00004A   8A931200     CMP.W   #0x0, 0x12(R10)
   \   00004E   0C24         JEQ     ??xQueueSendFromISR_0
    402          				{
    403          					if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE )
   \   000050   0C4A         MOV.W   R10, R12
   \   000052   3C501200     ADD.W   #0x12, R12
   \   000056   B012....     CALL    #xTaskRemoveFromEventList
   \   00005A   0C93         CMP.W   #0x0, R12
   \   00005C   0524         JEQ     ??xQueueSendFromISR_0
    404          					{
    405          						/* The task waiting has a higher priority so record that a
    406          						context	switch is required. */
    407          						return pdTRUE;
   \   00005E   1C43         MOV.W   #0x1, R12
   \   000060   043C         JMP     ??xQueueSendFromISR_3
    408          					}
    409          				}
    410          			}
    411          		}
    412          		else
    413          		{
    414          			/* Increment the lock count so the task that unlocks the queue
    415          			knows that data was posted while it was locked. */
    416          			++( pxQueue->xTxLock );
   \                     ??xQueueSendFromISR_2:
   \   000062   0F4A         MOV.W   R10, R15
   \   000064   9F532400     ADD.W   #0x1, 0x24(R15)
    417          		}
    418          	}
    419          
    420          	return xTaskPreviouslyWoken;
   \                     ??xQueueSendFromISR_0:
   \   000068   0C48         MOV.W   R8, R12
   \                     ??xQueueSendFromISR_3:
   \   00006A   3040....     BR      #?Epilogue3
    421          }
    422          /*-----------------------------------------------------------*/
    423          

   \                                 In segment CODE, align 2
    424          signed portBASE_TYPE xQueueReceive( xQueueHandle pxQueue, void *pvBuffer, portTickType xTicksToWait )
   \                     xQueueReceive:
    425          {
   \   000000   0A12         PUSH.W  R10
   \   000002   0B12         PUSH.W  R11
   \   000004   0812         PUSH.W  R8
   \   000006   0912         PUSH.W  R9
   \   000008   094C         MOV.W   R12, R9
   \   00000A   0A4E         MOV.W   R14, R10
   \   00000C   1B410A00     MOV.W   0xa(SP), R11
    426          signed portBASE_TYPE xReturn;
    427          
    428          	/* This function is very similar to xQueueSend().  See comments within
    429          	xQueueSend() for a more detailed explanation.
    430          
    431          	Make sure other tasks do not access the queue. */
    432          	vTaskSuspendAll();
   \   000010   B012....     CALL    #vTaskSuspendAll
    433          
    434          	/* Make sure interrupts do not access the queue. */
    435          	prvLockQueue( pxQueue );
   \   000014   32C2         DINT
   \   000016   0343         NOP
   \   000018   9253....     ADD.W   #0x1, &usCriticalNesting
   \   00001C   0F49         MOV.W   R9, R15
   \   00001E   9F532200     ADD.W   #0x1, 0x22(R15)
   \   000022   0F49         MOV.W   R9, R15
   \   000024   9F532400     ADD.W   #0x1, 0x24(R15)
   \   000028   8293....     CMP.W   #0x0, &usCriticalNesting
   \   00002C   0624         JEQ     ??xQueueReceive_0
   \   00002E   B253....     ADD.W   #0xffff, &usCriticalNesting
   \   000032   8293....     CMP.W   #0x0, &usCriticalNesting
   \   000036   0120         JNE     ??xQueueReceive_0
   \   000038   32D2         EINT
    436          
    437          	/* If there are no messages in the queue we may have to block. */
    438          	if( prvIsQueueEmpty( pxQueue ) )
   \                     ??xQueueReceive_0:
   \   00003A   0C49         MOV.W   R9, R12
   \   00003C   B012....     CALL    #prvIsQueueEmpty
   \   000040   0C93         CMP.W   #0x0, R12
   \   000042   3324         JEQ     ??xQueueReceive_1
    439          	{
    440          		/* There are no messages in the queue, do we want to block or just
    441          		leave with nothing? */			
    442          		if( xTicksToWait > ( portTickType ) 0 )
   \   000044   0B93         CMP.W   #0x0, R11
   \   000046   3124         JEQ     ??xQueueReceive_1
    443          		{
    444          			vTaskPlaceOnEventList( &( pxQueue->xTasksWaitingToReceive ), xTicksToWait );
   \   000048   0E4B         MOV.W   R11, R14
   \   00004A   0C49         MOV.W   R9, R12
   \   00004C   3C501200     ADD.W   #0x12, R12
   \   000050   B012....     CALL    #vTaskPlaceOnEventList
    445          			taskENTER_CRITICAL();
   \   000054   32C2         DINT
   \   000056   0343         NOP
   \   000058   9253....     ADD.W   #0x1, &usCriticalNesting
    446          			{
    447          				prvUnlockQueue( pxQueue );
   \   00005C   0C49         MOV.W   R9, R12
   \   00005E   B012....     CALL    #prvUnlockQueue
    448          				if( !xTaskResumeAll() )
   \   000062   B012....     CALL    #xTaskResumeAll
   \   000066   0C93         CMP.W   #0x0, R12
   \   000068   0220         JNE     ??xQueueReceive_2
    449          				{
    450          					taskYIELD();
   \   00006A   B012....     CALL    #vPortYield
    451          				}
    452          
    453          				vTaskSuspendAll();
   \                     ??xQueueReceive_2:
   \   00006E   B012....     CALL    #vTaskSuspendAll
    454          				prvLockQueue( pxQueue );
   \   000072   32C2         DINT

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -