FreeRTOS源码分析-异常处理
来源:互联网 发布:淘宝怎么买电鸡 编辑:程序博客网 时间:2024/05/17 04:13
__asm void vPortSVCHandler( void ){PRESERVE8ldrr3, =pxCurrentTCB/* Restore the context. */ldr r1, [r3]/* Use pxCurrentTCBConst to get the pxCurrentTCB address. */ldr r0, [r1]/* The first item in pxCurrentTCB is the task top of stack. */ldmia r0!, {r4-r11}/* Pop the registers that are not automatically saved on exception entry and the critical nesting count. */msr psp, r0/* Restore the task stack pointer. */mov r0, #0msrbasepri, r0orr r14, #0xdbx r14}/*-----------------------------------------------------------*/__asm void prvStartFirstTask( void ){PRESERVE8/* Use the NVIC offset register to locate the stack. */ldr r0, =0xE000ED08ldr r0, [r0]ldr r0, [r0]/* Set the msp back to the start of the stack. */msr msp, r0/* Globally enable interrupts. */cpsie i/* Call SVC to start the first task. */svc 0nop}__asm void xPortPendSVHandler( void ){extern uxCriticalNesting;extern pxCurrentTCB;extern vTaskSwitchContext;PRESERVE8mrs r0, pspldrr3, =pxCurrentTCB/* Get the location of the current TCB. */ldrr2, [r3]stmdb r0!, {r4-r11}/* Save the remaining registers. */str r0, [r2]/* Save the new top of stack into the first member of the TCB. */stmdb sp!, {r3, r14}mov r0, #configMAX_SYSCALL_INTERRUPT_PRIORITYmsr basepri, r0bl vTaskSwitchContextmov r0, #0msr basepri, r0ldmia sp!, {r3, r14}ldr r1, [r3]ldr r0, [r1]/* The first item in pxCurrentTCB is the task top of stack. */ldmia r0!, {r4-r11}/* Pop the registers and the critical nesting count. */msr psp, r0bx r14nop}void xPortSysTickHandler( void ){/* The SysTick runs at the lowest interrupt priority, so when this interruptexecutes all interrupts must be unmasked. There is therefore no need tosave and then restore the interrupt mask value as its value is alreadyknown. */( void ) portSET_INTERRUPT_MASK_FROM_ISR();{/* Increment the RTOS tick. */if( xTaskIncrementTick() != pdFALSE ){/* A context switch is required. Context switching is performed inthe PendSV interrupt. Pend the PendSV interrupt. */portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT;}}portCLEAR_INTERRUPT_MASK_FROM_ISR( 0 );}
AREA RESET, DATA, READONLY EXPORT __Vectors__Vectors DCD __initial_sp ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD MemManage_Handler ; MPU Fault Handler DCD BusFault_Handler ; Bus Fault Handler DCD UsageFault_Handler ; Usage Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD vPortSVCHandler ; SVCall Handler DCD DebugMon_Handler ; Debug Monitor Handler DCD 0 ; Reserved DCD xPortPendSVHandler ; PendSV Handler DCD xPortSysTickHandler ; SysTick Handler
0 0
- FreeRTOS源码分析-异常处理
- FreeRTOS 源码分析
- FreeRtos heap1源码分析
- FreeRtos heap2源码分析
- FreeRtos heap3源码分析
- FreeRtos heap4源码分析
- FreeRtos heap5源码分析
- ThinkPHP源码分析----异常处理
- FreeRTOS源码分析-代码结构
- FreeRTOS 内存管理源码分析
- FreeRTOS timer定时器源码分析
- KVM异常处理流程源码简要分析
- FreeRTOS源码分析之heap1.c
- FreeRTOS源码分析之heap2.c .
- FreeRTOS源码分析之heap3.c
- FreeRTOS源码分析之heap4.c
- 关于FreeRTOS源码分析的论坛
- FreeRTOS的Tickless低功耗源码分析
- [九度OJ]货币问题,解题报告
- 关于android开发
- Hibernate多对多关联映射的HQL中的in条件查询问题
- vmware redhat linux 根目录调整
- iOS 7 教程:定制iOS 7中的导航栏和状态栏
- FreeRTOS源码分析-异常处理
- Cocos2DX 3.0新建工程
- 数据结构 第三季(part 3)
- Outlook安全钩子控件Security Manager for Microsoft Outlook介绍和下载
- uva 111 History Grading 动态规划
- Leetcode_jump-game-ii(c++ and python version)
- 给未加皮肤的EXE文件加皮肤
- 过来人经验分享:英国留学过程中如何省钱?
- jQuery插件AjaxFileUpload实现ajax文件上传时老是执行error方法 问题原因