Skip to content

Commit 81c6232

Browse files
authored
Update SMP branch readme for port migration (#999)
1 parent eb80149 commit 81c6232

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,44 @@ The contents of this branch will remain available for certain period but we will
99
Have more questions? Post them in the [FreeRTOS forum](https://forums.freertos.org/).
1010

1111

12+
## Migrate port from SMP branch to FreeRTOS v11
13+
14+
The following changes should be applied to migrate a port from this branch to FreeRTOS v11:
15+
16+
* Call `xTaskIncrementTick` in critical section in port
17+
18+
RP2040 example:
19+
```c
20+
void xPortSysTickHandler( void )
21+
{
22+
portBASE_TYPE xPreviousMask;
23+
24+
/* xTaskIncrementTick now must be called in critical section. */
25+
xPreviousMask = taskENTER_CRITICAL_FROM_ISR();
26+
{
27+
/* Increment the RTOS tick. */
28+
if( xTaskIncrementTick() != pdFALSE )
29+
{
30+
/* Pend a context switch. */
31+
portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT;
32+
}
33+
}
34+
taskEXIT_CRITICAL_FROM_ISR( xPreviousMask );
35+
}
36+
```
37+
38+
* Rename `configNUM_CORES` to `configNUMBER_OF_CORES`
39+
40+
* Define `portSET/CLEAR_INTERRUPT_MASK` in port
41+
42+
* Define `portENTER/EXIT_CRITICAL_FROM_ISR` for SMP in port
43+
* These macros should be implemented with `vTaskEnterCriticalFromISR`/`xTaskExitCriticalFromISR`
44+
45+
* Update `portSET/CLEAR_INTERRUPT_MASK_FROM_ISR` implementation in port
46+
* SMP-dev doesn’t use these macros to enter/exit critical section from ISR. Instead,
47+
`portENTER/EXIT_CRITICAL_FROM_ISR` are used. These functions should be implemented as
48+
the macro name suggested, set or clear interrupt mask from ISR if nested interrupt are supported.
49+
1250
1351
---
1452

0 commit comments

Comments
 (0)