mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-09-01 20:03:50 -04:00
Style: Add uncrustify guards, fix asm (#136)
Co-authored-by: Alfred Gedeon <gedeonag@amazon.com>
This commit is contained in:
parent
a038146915
commit
0afc048cf2
11 changed files with 142 additions and 195 deletions
|
@ -244,12 +244,10 @@ __asm void vPortSVCHandler( void )
|
|||
|
||||
/* Get the location of the current TCB. */
|
||||
ldr r3, = pxCurrentTCB
|
||||
ldr r1, [ r3 ]
|
||||
ldr r1, [ r3 ]
|
||||
ldr r0, [ r1 ]
|
||||
/* Pop the core registers. */
|
||||
ldmia r0 !, {
|
||||
r4 - r11, r14
|
||||
}
|
||||
ldmia r0 !, {r4-r11,r14}
|
||||
msr psp, r0
|
||||
isb
|
||||
mov r0, # 0
|
||||
|
@ -300,7 +298,7 @@ __asm void prvEnableVFP( void )
|
|||
ldr r1, [ r0 ]
|
||||
|
||||
/* Enable CP10 and CP11 coprocessors, then save back. */
|
||||
orr r1, r1, # ( 0xf << 20 )
|
||||
orr r1, r1, #( 0xf << 20 )
|
||||
str r1, [ r0 ]
|
||||
bx r14
|
||||
nop
|
||||
|
@ -470,21 +468,15 @@ __asm void xPortPendSVHandler( void )
|
|||
/* Is the task using the FPU context? If so, push high vfp registers. */
|
||||
tst r14, #0x10
|
||||
it eq
|
||||
vstmdbeq r0 !, {
|
||||
s16 - s31
|
||||
}
|
||||
vstmdbeq r0!, {s16-s31}
|
||||
|
||||
/* Save the core registers. */
|
||||
stmdb r0 !, {
|
||||
r4 - r11, r14
|
||||
}
|
||||
stmdb r0!, {r4-r11, r14}
|
||||
|
||||
/* Save the new top of stack into the first member of the TCB. */
|
||||
str r0, [ r2 ]
|
||||
|
||||
stmdb sp !, {
|
||||
r0, r3
|
||||
}
|
||||
stmdb sp!, {r0, r3}
|
||||
mov r0, # configMAX_SYSCALL_INTERRUPT_PRIORITY
|
||||
msr basepri, r0
|
||||
dsb
|
||||
|
@ -492,37 +484,27 @@ __asm void xPortPendSVHandler( void )
|
|||
bl vTaskSwitchContext
|
||||
mov r0, # 0
|
||||
msr basepri, r0
|
||||
ldmia sp !, {
|
||||
r0, r3
|
||||
}
|
||||
ldmia sp!, {r0, r3}
|
||||
|
||||
/* The first item in pxCurrentTCB is the task top of stack. */
|
||||
ldr r1, [ r3 ]
|
||||
ldr r0, [ r1 ]
|
||||
|
||||
/* Pop the core registers. */
|
||||
ldmia r0 !, {
|
||||
r4 - r11, r14
|
||||
}
|
||||
ldmia r0!, {r4-r11, r14}
|
||||
|
||||
/* Is the task using the FPU context? If so, pop the high vfp registers
|
||||
* too. */
|
||||
tst r14, # 0x10
|
||||
it eq
|
||||
vldmiaeq r0 !, {
|
||||
s16 - s31
|
||||
}
|
||||
vldmiaeq r0!, {s16-s31}
|
||||
|
||||
msr psp, r0
|
||||
isb
|
||||
#ifdef WORKAROUND_PMU_CM001 /* XMC4000 specific errata */
|
||||
#if WORKAROUND_PMU_CM001 == 1
|
||||
push {
|
||||
r14
|
||||
}
|
||||
pop {
|
||||
pc
|
||||
}
|
||||
push { r14 }
|
||||
pop { pc }
|
||||
nop
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -27,11 +27,13 @@
|
|||
|
||||
|
||||
#ifndef PORTMACRO_H
|
||||
#define PORTMACRO_H
|
||||
#define PORTMACRO_H
|
||||
/* *INDENT-OFF* */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/* *INDENT-ON* */
|
||||
|
||||
/*-----------------------------------------------------------
|
||||
* Port specific definitions.
|
||||
|
@ -170,7 +172,9 @@
|
|||
{
|
||||
/* Barrier instructions are not used as this function is only used to
|
||||
* lower the BASEPRI value. */
|
||||
msr basepri, ulBASEPRI
|
||||
/* *INDENT-OFF* */
|
||||
msr basepri, ulBASEPRI
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
@ -183,9 +187,11 @@
|
|||
{
|
||||
/* Set BASEPRI to the max syscall priority to effect a critical
|
||||
* section. */
|
||||
/* *INDENT-OFF* */
|
||||
msr basepri, ulNewBASEPRI
|
||||
dsb
|
||||
isb
|
||||
isb
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
@ -197,7 +203,9 @@
|
|||
/* Set BASEPRI to 0 so no interrupts are masked. This function is only
|
||||
* used to lower the mask in an interrupt, so memory barriers are not
|
||||
* used. */
|
||||
/* *INDENT-OFF* */
|
||||
msr basepri, # 0
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
@ -210,10 +218,12 @@
|
|||
{
|
||||
/* Set BASEPRI to the max syscall priority to effect a critical
|
||||
* section. */
|
||||
/* *INDENT-OFF* */
|
||||
mrs ulReturn, basepri
|
||||
msr basepri, ulNewBASEPRI
|
||||
dsb
|
||||
isb
|
||||
isb
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
|
||||
return ulReturn;
|
||||
|
@ -228,7 +238,9 @@
|
|||
/* Obtain the number of the currently executing interrupt. */
|
||||
__asm
|
||||
{
|
||||
/* *INDENT-OFF* */
|
||||
mrs ulCurrentInterrupt, ipsr
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
|
||||
if( ulCurrentInterrupt == 0 )
|
||||
|
@ -243,9 +255,10 @@
|
|||
return xReturn;
|
||||
}
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/* *INDENT-OFF* */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/* *INDENT-ON* */
|
||||
|
||||
#endif /* PORTMACRO_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue