当前位置: 首页 > news >正文

网站空间一定要买吗如何在网站做qq群链接

网站空间一定要买吗,如何在网站做qq群链接,c 做网站,互联网运营FreeRTOS之ARM CR5栈结构操作示意图 1 FreeRTOS源码下载地址2 ARM CR5栈结构操作宏和接口2.1 portSAVE_CONTEXT宏2.1.1 portSAVE_CONTEXT源码2.1.2 portSAVE_CONTEXT宏操作栈结构变化示意图 2.2 portRESTORE_CONTEXT宏2.2.1 portRESTORE_CONTEXT源码2.2.2 portRESTORE_CONTEXT宏… FreeRTOS之ARM CR5栈结构操作示意图 1 FreeRTOS源码下载地址2 ARM CR5栈结构操作宏和接口2.1 portSAVE_CONTEXT宏2.1.1 portSAVE_CONTEXT源码2.1.2 portSAVE_CONTEXT宏操作栈结构变化示意图 2.2 portRESTORE_CONTEXT宏2.2.1 portRESTORE_CONTEXT源码2.2.2 portRESTORE_CONTEXT宏操作栈结构变化示意图 2.3 pxPortInitialiseStack2.3.1 pxPortInitialiseStack源码3.2.2 pxPortInitialiseStack栈结构变化示意图 2.4 pxPortInitialiseStack调用关系2.5 portRESTORE_CONTEXT调用关系 3 参考文章 下面以FreeRTOS源码中arm cortex-r5处理器的栈处理为例来介绍栈结构操作前后变化。 1 FreeRTOS源码下载地址 https://www.freertos.org/ 2 ARM CR5栈结构操作宏和接口 .macro portSAVE_CONTEXT.macro portRESTORE_CONTEXTpxPortInitialiseStack 2.1 portSAVE_CONTEXT宏 2.1.1 portSAVE_CONTEXT源码 .macro portSAVE_CONTEXT/* Save the LR and SPSR onto the system mode stack before switching tosystem mode to save the remaining system mode registers. */SRSDB sp!, #SYS_MODECPS #SYS_MODEPUSH {R0-R12, R14}/* Push the critical nesting count. */LDR R2, ulCriticalNestingConstLDR R1, [R2]PUSH {R1}#if defined( __ARM_FP )/* Does the task have a floating point context that needs saving? IfulPortTaskHasFPUContext is 0 then no. */LDR R2, ulPortTaskHasFPUContextConstLDR R3, [R2]CMP R3, #0/* Save the floating point context, if any. */FMRXNE R1, FPSCRPUSHNE {R1}VPUSHNE {D0-D15}/* Save ulPortTaskHasFPUContext itself. */PUSH {R3}#endif /* __ARM_FP *//* Save the stack pointer in the TCB. */LDR R0, pxCurrentTCBConstLDR R1, [R0]STR SP, [R1].endm2.1.2 portSAVE_CONTEXT宏操作栈结构变化示意图 2.2 portRESTORE_CONTEXT宏 2.2.1 portRESTORE_CONTEXT源码 .macro portRESTORE_CONTEXT/* Set the SP to point to the stack of the task being restored. */LDR R0, pxCurrentTCBConstLDR R1, [R0]LDR SP, [R1]#if defined( __ARM_FP )/** Is there a floating point context to restore? If the restored* ulPortTaskHasFPUContext is zero then no.*/LDR R0, ulPortTaskHasFPUContextConstPOP {R1}STR R1, [R0]CMP R1, #0/* Restore the floating point context, if any. */VPOPNE {D0-D15}POPNE {R0}VMSRNE FPSCR, R0#endif /* __ARM_FP *//* Restore the critical section nesting depth. */LDR R0, ulCriticalNestingConstPOP {R1}STR R1, [R0]/* Ensure the priority mask is correct for the critical nesting depth. */LDR R2, ulICCPMRConstLDR R2, [R2]CMP R1, #0MOVEQ R4, #255LDRNE R4, ulMaxAPIPriorityMaskConstLDRNE R4, [R4]STR R4, [R2]/* Restore all system mode registers other than the SP (which is alreadybeing used). */POP {R0-R12, R14}/* Return to the task code, loading CPSR on the way. */RFEIA sp!.endm2.2.2 portRESTORE_CONTEXT宏操作栈结构变化示意图 2.3 pxPortInitialiseStack 2.3.1 pxPortInitialiseStack源码 /** See header file for description.*/ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,TaskFunction_t pxCode,void * pvParameters ) {/** Setup the initial stack of the task. The stack is set exactly as* expected by the portRESTORE_CONTEXT() macro.** The fist real value on the stack is the status register, which is set for* system mode, with interrupts enabled. A few NULLs are added first to ensure* GDB does not try decoding a non-existent return address.*/*pxTopOfStack ( StackType_t ) NULL;pxTopOfStack--;*pxTopOfStack ( StackType_t ) NULL;pxTopOfStack--;*pxTopOfStack ( StackType_t ) NULL;pxTopOfStack--;*pxTopOfStack ( StackType_t ) portINITIAL_SPSR;if( ( ( uint32_t ) pxCode portTHUMB_MODE_ADDRESS ) ! 0x00UL ){/* The task will start in THUMB mode. */*pxTopOfStack | portTHUMB_MODE_BIT;}pxTopOfStack--;/* Next the return address, which in this case is the start of the task. */*pxTopOfStack ( StackType_t ) pxCode;pxTopOfStack--;/* Next all the registers other than the stack pointer. */*pxTopOfStack ( StackType_t ) portTASK_RETURN_ADDRESS; /* R14 */pxTopOfStack--;*pxTopOfStack ( StackType_t ) 0x12121212; /* R12 */pxTopOfStack--;*pxTopOfStack ( StackType_t ) 0x11111111; /* R11 */pxTopOfStack--;*pxTopOfStack ( StackType_t ) 0x10101010; /* R10 */pxTopOfStack--;*pxTopOfStack ( StackType_t ) 0x09090909; /* R9 */pxTopOfStack--;*pxTopOfStack ( StackType_t ) 0x08080808; /* R8 */pxTopOfStack--;*pxTopOfStack ( StackType_t ) 0x07070707; /* R7 */pxTopOfStack--;*pxTopOfStack ( StackType_t ) 0x06060606; /* R6 */pxTopOfStack--;*pxTopOfStack ( StackType_t ) 0x05050505; /* R5 */pxTopOfStack--;*pxTopOfStack ( StackType_t ) 0x04040404; /* R4 */pxTopOfStack--;*pxTopOfStack ( StackType_t ) 0x03030303; /* R3 */pxTopOfStack--;*pxTopOfStack ( StackType_t ) 0x02020202; /* R2 */pxTopOfStack--;*pxTopOfStack ( StackType_t ) 0x01010101; /* R1 */pxTopOfStack--;*pxTopOfStack ( StackType_t ) pvParameters; /* R0 *//** The task will start with a critical nesting count of 0 as interrupts are* enabled.*/pxTopOfStack--;*pxTopOfStack portNO_CRITICAL_NESTING;#if ( configUSE_TASK_FPU_SUPPORT 1 ){/** The task will start without a floating point context.* A task that uses the floating point hardware must call* vPortTaskUsesFPU() before executing any floating point* instructions.*/pxTopOfStack--;*pxTopOfStack portNO_FLOATING_POINT_CONTEXT;}#elif ( configUSE_TASK_FPU_SUPPORT 2 ){/** The task will start with a floating point context. Leave enough* space for the registers and ensure they are initialized to 0.*/pxTopOfStack - portFPU_REGISTER_WORDS;memset( pxTopOfStack, 0x00, portFPU_REGISTER_WORDS * sizeof( StackType_t ) );pxTopOfStack--;*pxTopOfStack pdTRUE;ulPortTaskHasFPUContext pdTRUE;}#elif ( configUSE_TASK_FPU_SUPPORT ! 0 ){#error Invalid configUSE_TASK_FPU_SUPPORT setting - configUSE_TASK_FPU_SUPPORT must be set to 0, 1, or 2.}#endif /* configUSE_TASK_FPU_SUPPORT */return pxTopOfStack; }3.2.2 pxPortInitialiseStack栈结构变化示意图 2.4 pxPortInitialiseStack调用关系 |- xTaskCreate( pxIdleTaskFunction, ...)|- prvCreateTask|- pxStack pvPortMallocStack( ( ( ( size_t ) uxStackDepth ) * sizeof( StackType_t ) ) );|- pxNewTCB ( TCB_t * ) pvPortMalloc( sizeof( TCB_t ) );|- prvInitialiseNewTask|- vListInitialiseItem( ( pxNewTCB-xStateListItem ) );|- vListInitialiseItem( ( pxNewTCB-xEventListItem ) );|- pxNewTCB-pxTopOfStack pxPortInitialiseStack( pxTopOfStack, pxTaskCode, pvParameters );2.5 portRESTORE_CONTEXT调用关系 |- vTaskStartScheduler|- prvCreateIdleTasks()|- xTaskCreate( pxIdleTaskFunction, ...)|- prvCreateTask|- pxStack pvPortMallocStack( ( ( ( size_t ) uxStackDepth ) * sizeof( StackType_t ) ) );|- pxNewTCB ( TCB_t * ) pvPortMalloc( sizeof( TCB_t ) );|- prvInitialiseNewTask|- vListInitialiseItem( ( pxNewTCB-xStateListItem ) );|- vListInitialiseItem( ( pxNewTCB-xEventListItem ) );|- pxNewTCB-pxTopOfStack pxPortInitialiseStack( pxTopOfStack, pxTaskCode, pvParameters );|- *pxCreatedTask ( TaskHandle_t ) pxNewTCB;|- prvAddNewTaskToReadyList|- prvInitialiseTaskLists|- prvAddTaskToReadyList|- listINSERT_END( ( pxReadyTasksLists[ ( pxTCB )-uxPriority ] ), ( ( pxTCB )-xStateListItem ) );|- xTimerCreateTimerTask()|- xTaskCreateAffinitySet|- prvCreateTask|- pxStack pvPortMallocStack( ( ( ( size_t ) uxStackDepth ) * sizeof( StackType_t ) ) );|- pxNewTCB ( TCB_t * ) pvPortMalloc( sizeof( TCB_t ) );|- prvInitialiseNewTask|- vListInitialiseItem( ( pxNewTCB-xStateListItem ) );|- vListInitialiseItem( ( pxNewTCB-xEventListItem ) );|- pxNewTCB-pxTopOfStack pxPortInitialiseStack( pxTopOfStack, pxTaskCode, pvParameters );|- *pxCreatedTask ( TaskHandle_t ) pxNewTCB;|- prvAddNewTaskToReadyList|- prvInitialiseTaskLists|- prvAddTaskToReadyList|- listINSERT_END( ( pxReadyTasksLists[ ( pxTCB )-uxPriority ] ), ( ( pxTCB )-xStateListItem ) )|- pxNewTCB-uxCoreAffinityMask uxCoreAffinityMask;|- prvAddNewTaskToReadyList( pxNewTCB );|- xPortStartScheduler()|- vPortRestoreTaskContext|- portRESTORE_CONTEXT 3 参考文章 arm汇编指令之数据块传输LDM,STM详见 arm 处理器的堆栈操作
http://www.hkea.cn/news/14462101/

相关文章:

  • 企业网站建设的总体架构企业网站备案域名可以用个人的
  • 好用的wordpress模板下载地址公司网站建设推荐乐云seo
  • 网站建设属于哪个税目商务网站建设工程师
  • 官方网站的重要性wordpress免费空间
  • 做饼的网站在线建站网站
  • 太原网站建设报价最便宜的重庆网站建设
  • 公司网站与营销网站在栏目上的不同郑州网站建设公司排名
  • 卡曼科技网站建设织梦 xml网站地图
  • 做国外网站建设江西响应式网页建设价位
  • 网站运营方案书营销网站建设免费
  • 建筑类企业网站模板下载鸿蒙os用什么语言开发app
  • 如何做网站优化关键词优化石河子建设局网站
  • 网站页面锚点怎么做北京 一图看懂 最新
  • 浙江久天建设有限公司网站西安大雁塔在哪个区
  • 乐清网站推广公司宣传推广费用预算
  • 网站建设考虑因素net网站开发JD
  • 设计师网站库软件制作app下载
  • 上蔡网站建设公司高级网站开发工程师 证书
  • 备案网站代理商查工程中标信息哪个网站
  • 做网站要实名认证吗古交市网站建设公司
  • 北京软件网站开发来个可以做渗透的网站
  • 告状书放网站上怎么做网站建设建材
  • 做网站的最大的挑战是什么中国机械加工网哪家好
  • 关于申请网站建设管理网站怎么做的
  • 网站首页图片效果湛江网站建设方案策划
  • joomla适合做什么网站代写软文公司
  • 做网站工作好么做视频网站需要哪些手续
  • 微网站是用什么开发的昆明网页制作
  • 国外做家居类的网站动画设计专业大学排名
  • 建设一个网站平台营销网站的推广