Style: Add uncrustify guards, fix asm (#136)

Co-authored-by: Alfred Gedeon <gedeonag@amazon.com>
This commit is contained in:
alfred gedeon 2020-08-24 15:32:02 -07:00 committed by GitHub
parent a038146915
commit 0afc048cf2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 142 additions and 195 deletions

View file

@ -176,7 +176,7 @@ __asm void prvPortStartFirstTask( void )
/* The MSP stack is not reset as, unlike on M3/4 parts, there is no vector
* table offset register that can be used to locate the initial stack value.
* Not all M0 parts have the application vector table at address 0. */
/* *INDENT-OFF* */
/* *INDENT-OFF* */
ldr r3, = pxCurrentTCB /* Obtain location of pxCurrentTCB. */
ldr r1, [ r3 ]
@ -186,16 +186,10 @@ __asm void prvPortStartFirstTask( void )
movs r0, # 2 /* Switch to the psp stack. */
msr CONTROL, r0
isb
pop {
r0 - r5
} /* Pop the registers that are saved automatically. */
pop { r0 - r5 } /* Pop the registers that are saved automatically. */
mov lr, r5 /* lr is now in r5. */
pop {
r3
} /* The return address is now in r3. */
pop {
r2
} /* Pop and discard the XPSR. */
pop { r3 } /* The return address is now in r3. */
pop { r2 } /* Pop and discard the XPSR. */
cpsie i /* The first task has its context and interrupts can be enabled. */
bx r3 /* Finally, jump to the user defined task code. */
@ -272,16 +266,20 @@ void vPortExitCritical( void )
__asm uint32_t ulSetInterruptMaskFromISR( void )
{
/* *INDENT-OFF* */
mrs r0, PRIMASK
cpsid i
bx lr
/* *INDENT-ON* */
}
/*-----------------------------------------------------------*/
__asm void vClearInterruptMaskFromISR( uint32_t ulMask )
{
/* *INDENT-OFF* */
msr PRIMASK, r0
bx lr
/* *INDENT-ON* */
}
/*-----------------------------------------------------------*/
@ -300,33 +298,23 @@ __asm void xPortPendSVHandler( void )
subs r0, # 32 /* Make space for the remaining low registers. */
str r0, [ r2 ] /* Save the new top of stack. */
stmia r0 !, {
r4 - r7
} /* Store the low registers that are not saved automatically. */
stmia r0 !, { r4 - r7 } /* Store the low registers that are not saved automatically. */
mov r4, r8 /* Store the high registers. */
mov r5, r9
mov r6, r10
mov r7, r11
stmia r0 !, {
r4 - r7
}
stmia r0 !, { r4 - r7 }
push {
r3, r14
}
push { r3, r14 }
cpsid i
bl vTaskSwitchContext
cpsie i
pop {
r2, r3
} /* lr goes in r3. r2 now holds tcb pointer. */
pop { r2, r3 } /* lr goes in r3. r2 now holds tcb pointer. */
ldr r1, [ r2 ]
ldr r0, [ r1 ] /* The first item in pxCurrentTCB is the task top of stack. */
adds r0, # 16 /* Move to the high registers. */
ldmia r0 !, {
r4 - r7
} /* Pop the high registers. */
ldmia r0 !, { r4 - r7 } /* Pop the high registers. */
mov r8, r4
mov r9, r5
mov r10, r6
@ -335,9 +323,7 @@ __asm void xPortPendSVHandler( void )
msr psp, r0 /* Remember the new top of stack for the task. */
subs r0, # 32 /* Go back for the low registers that are not automatically restored. */
ldmia r0 !, {
r4 - r7
} /* Pop low registers. */
ldmia r0 !, { r4 - r7 } /* Pop low registers. */
bx r3
ALIGN