37
37
38
38
39
39
/* Defined in portasm.h */
40
- extern void _frxt_tick_timer_init ( void );
40
+ extern void _frxt_tick_timer_init (void );
41
41
42
42
/* Defined in xtensa_context.S */
43
- extern void _xt_coproc_init ( void );
43
+ extern void _xt_coproc_init (void );
44
44
45
45
46
46
/*-----------------------------------------------------------*/
47
47
48
48
/* We require the address of the pxCurrentTCB variable, but don't want to know
49
- * any details of its type. */
49
+ any details of its type. */
50
50
typedef void TCB_t ;
51
51
extern volatile TCB_t * volatile pxCurrentTCB ;
52
52
53
- unsigned port_xSchedulerRunning = 0 ; /* Duplicate of inaccessible xSchedulerRunning; needed at startup to avoid counting nesting */
54
- unsigned port_interruptNesting = 0 ; /* Interrupt nesting level */
53
+ unsigned port_xSchedulerRunning = 0 ; // Duplicate of inaccessible xSchedulerRunning; needed at startup to avoid counting nesting
54
+ unsigned port_interruptNesting = 0 ; // Interrupt nesting level
55
55
56
56
/*-----------------------------------------------------------*/
57
57
58
- /* User exception dispatcher when exiting */
59
- void _xt_user_exit ( void );
58
+ // User exception dispatcher when exiting
59
+ void _xt_user_exit (void );
60
60
61
61
/*
62
62
* Stack initialization
63
63
*/
64
64
#if portUSING_MPU_WRAPPERS
65
- StackType_t * pxPortInitialiseStack ( StackType_t * pxTopOfStack ,
66
- TaskFunction_t pxCode ,
67
- void * pvParameters ,
68
- BaseType_t xRunPrivileged )
65
+ StackType_t * pxPortInitialiseStack ( StackType_t * pxTopOfStack , TaskFunction_t pxCode , void * pvParameters , BaseType_t xRunPrivileged )
69
66
#else
70
- StackType_t * pxPortInitialiseStack ( StackType_t * pxTopOfStack ,
71
- TaskFunction_t pxCode ,
72
- void * pvParameters )
67
+ StackType_t * pxPortInitialiseStack ( StackType_t * pxTopOfStack , TaskFunction_t pxCode , void * pvParameters )
73
68
#endif
74
69
{
75
70
StackType_t * sp ;
@@ -134,18 +129,18 @@ void _xt_user_exit( void );
134
129
void vPortEndScheduler ( void )
135
130
{
136
131
/* It is unlikely that the Xtensa port will get stopped. If required simply
137
- * disable the tick interrupt here. */
132
+ disable the tick interrupt here. */
138
133
}
139
134
140
135
/*-----------------------------------------------------------*/
141
136
142
137
BaseType_t xPortStartScheduler ( void )
143
138
{
144
- /* Interrupts are disabled at this point and stack contains PS with enabled interrupts when task context is restored */
139
+ // Interrupts are disabled at this point and stack contains PS with enabled interrupts when task context is restored
145
140
146
141
#if XCHAL_CP_NUM > 0
147
- /* Initialize co-processor management for tasks. Leave CPENABLE alone. */
148
- _xt_coproc_init ();
142
+ /* Initialize co-processor management for tasks. Leave CPENABLE alone. */
143
+ _xt_coproc_init ();
149
144
#endif
150
145
151
146
/* Init the tick divisor value */
@@ -155,14 +150,14 @@ BaseType_t xPortStartScheduler( void )
155
150
_frxt_tick_timer_init ();
156
151
157
152
#if XT_USE_THREAD_SAFE_CLIB
158
- /* Init C library */
159
- vPortClibInit ();
153
+ // Init C library
154
+ vPortClibInit ();
160
155
#endif
161
156
162
157
port_xSchedulerRunning = 1 ;
163
158
164
- /* Cannot be directly called from C; never returns */
165
- __asm__ volatile ( "call0 _frxt_dispatch\n" );
159
+ // Cannot be directly called from C; never returns
160
+ __asm__ volatile ("call0 _frxt_dispatch\n" );
166
161
167
162
/* Should not get here. */
168
163
return pdTRUE ;
@@ -195,13 +190,14 @@ BaseType_t xPortSysTickHandler( void )
195
190
* Used to set coprocessor area in stack. Current hack is to reuse MPU pointer for coprocessor area.
196
191
*/
197
192
#if portUSING_MPU_WRAPPERS
193
+
198
194
void vPortStoreTaskMPUSettings ( xMPU_SETTINGS * xMPUSettings ,
199
195
const struct xMEMORY_REGION * const xRegions ,
200
196
StackType_t * pxBottomOfStack ,
201
- configSTACK_DEPTH_TYPE ulStackDepth )
197
+ configSTACK_DEPTH_TYPE uxStackDepth )
202
198
{
203
199
#if XCHAL_CP_NUM > 0
204
- xMPUSettings -> coproc_area = ( StackType_t * ) ( ( uint32_t ) ( pxBottomOfStack + ulStackDepth - 1 ) );
200
+ xMPUSettings -> coproc_area = ( StackType_t * ) ( ( uint32_t ) ( pxBottomOfStack + uxStackDepth - 1 ) );
205
201
xMPUSettings -> coproc_area = ( StackType_t * ) ( ( ( portPOINTER_SIZE_TYPE ) xMPUSettings -> coproc_area ) & ( ~( ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK ) ) );
206
202
xMPUSettings -> coproc_area = ( StackType_t * ) ( ( ( uint32_t ) xMPUSettings -> coproc_area - XT_CP_SIZE ) & ~0xf );
207
203
0 commit comments