@@ -581,8 +581,8 @@ static void osRtxThreadPostProcess (os_thread_t *thread) {
581
581
// ==== Service Calls ====
582
582
583
583
/// Create a thread and add it to Active Threads.
584
- /// \note API identical to osThreadNew
585
- static osThreadId_t svcRtxThreadNew (osThreadFunc_t func , void * argument , const osThreadAttr_t * attr ) {
584
+ /// \note API identical to osThreadContextNew
585
+ osThreadId_t svcRtxThreadNew (osThreadFunc_t func , void * argument , const osThreadAttr_t * attr , void * context ) {
586
586
os_thread_t * thread ;
587
587
uint32_t attr_bits ;
588
588
void * stack_mem ;
@@ -1608,7 +1608,7 @@ static uint32_t svcRtxThreadFlagsWait (uint32_t flags, uint32_t options, uint32_
1608
1608
1609
1609
// Service Calls definitions
1610
1610
//lint ++flb "Library Begin" [MISRA Note 11]
1611
- SVC0_3 (ThreadNew , osThreadId_t , osThreadFunc_t , void * , const osThreadAttr_t * )
1611
+ SVC0_4 (ThreadNew , osThreadId_t , osThreadFunc_t , void * , const osThreadAttr_t * , void * )
1612
1612
SVC0_1 (ThreadGetName , const char * , osThreadId_t )
1613
1613
SVC0_0 (ThreadGetId , osThreadId_t )
1614
1614
SVC0_1 (ThreadGetState , osThreadState_t , osThreadId_t )
@@ -1679,7 +1679,7 @@ bool_t osRtxThreadStartup (void) {
1679
1679
// Create Idle Thread
1680
1680
if (osRtxInfo .thread .idle == NULL ) {
1681
1681
osRtxInfo .thread .idle = osRtxThreadId (
1682
- svcRtxThreadNew (osRtxIdleThread , NULL , osRtxConfig .idle_thread_attr )
1682
+ svcRtxThreadNew (osRtxIdleThread , NULL , osRtxConfig .idle_thread_attr , NULL )
1683
1683
);
1684
1684
if (osRtxInfo .thread .idle == NULL ) {
1685
1685
ret = FALSE;
@@ -1690,7 +1690,7 @@ bool_t osRtxThreadStartup (void) {
1690
1690
if (osRtxConfig .timer_mq_mcnt != 0U ) {
1691
1691
if (osRtxInfo .timer .thread == NULL ) {
1692
1692
osRtxInfo .timer .thread = osRtxThreadId (
1693
- svcRtxThreadNew (osRtxTimerThread , NULL , osRtxConfig .timer_thread_attr )
1693
+ svcRtxThreadNew (osRtxTimerThread , NULL , osRtxConfig .timer_thread_attr , NULL )
1694
1694
);
1695
1695
if (osRtxInfo .timer .thread == NULL ) {
1696
1696
ret = FALSE;
@@ -1706,14 +1706,17 @@ bool_t osRtxThreadStartup (void) {
1706
1706
1707
1707
/// Create a thread and add it to Active Threads.
1708
1708
osThreadId_t osThreadNew (osThreadFunc_t func , void * argument , const osThreadAttr_t * attr ) {
1709
- osThreadId_t thread_id ;
1709
+ return osThreadContextNew (func , argument , attr , NULL );
1710
+ }
1710
1711
1712
+ osThreadId_t osThreadContextNew (osThreadFunc_t func , void * argument , const osThreadAttr_t * attr , void * context ) {
1713
+ osThreadId_t thread_id ;
1711
1714
EvrRtxThreadNew (func , argument , attr );
1712
1715
if (IsIrqMode () || IsIrqMasked ()) {
1713
1716
EvrRtxThreadError (NULL , (int32_t )osErrorISR );
1714
1717
thread_id = NULL ;
1715
1718
} else {
1716
- thread_id = __svcThreadNew (func , argument , attr );
1719
+ thread_id = __svcThreadNew (func , argument , attr , context );
1717
1720
}
1718
1721
return thread_id ;
1719
1722
}
0 commit comments