@@ -459,7 +459,7 @@ SVC_0_1(svcKernelRunning, int32_t, RET_int32_t)
459
459
SVC_0_1 (svcKernelSysTick , uint32_t , RET_uint32_t )
460
460
461
461
static void sysThreadError (osStatus status );
462
- osThreadId svcThreadCreate (const osThreadDef_t * thread_def , void * argument );
462
+ osThreadId svcThreadCreate (const osThreadDef_t * thread_def , void * argument , void * context );
463
463
osMessageQId svcMessageCreate (const osMessageQDef_t * queue_def , osThreadId thread_id );
464
464
465
465
// Kernel Control Service Calls
@@ -489,7 +489,7 @@ osStatus svcKernelInitialize (void) {
489
489
if (os_initialized == 0U ) {
490
490
// Create OS Timers resources (Message Queue & Thread)
491
491
osMessageQId_osTimerMessageQ = svcMessageCreate (& os_messageQ_def_osTimerMessageQ , NULL );
492
- osThreadId_osTimerThread = svcThreadCreate (& os_thread_def_osTimerThread , NULL );
492
+ osThreadId_osTimerThread = svcThreadCreate (& os_thread_def_osTimerThread , NULL , NULL );
493
493
}
494
494
495
495
sysThreadError (osOK );
@@ -621,7 +621,7 @@ static void sysThreadError (osStatus status) {
621
621
__NO_RETURN void osThreadExit (void );
622
622
623
623
// Thread Service Calls declarations
624
- SVC_2_1 (svcThreadCreate , osThreadId , const osThreadDef_t * , void * , RET_pointer )
624
+ SVC_3_1 (svcThreadCreate , osThreadId , const osThreadDef_t * , void * , void * , RET_pointer )
625
625
SVC_0_1 (svcThreadGetId , osThreadId , RET_pointer )
626
626
SVC_1_1 (svcThreadTerminate , osStatus , osThreadId , RET_osStatus )
627
627
SVC_0_1 (svcThreadYield , osStatus , RET_osStatus )
@@ -631,7 +631,7 @@ SVC_1_1(svcThreadGetPriority, osPriority, osThreadId, RET
631
631
// Thread Service Calls
632
632
633
633
/// Create a thread and add it to Active Threads and set it to state READY
634
- osThreadId svcThreadCreate (const osThreadDef_t * thread_def , void * argument ) {
634
+ osThreadId svcThreadCreate (const osThreadDef_t * thread_def , void * argument , void * context ) {
635
635
P_TCB ptcb ;
636
636
OS_TID tsk ;
637
637
void * stk ;
@@ -791,14 +791,17 @@ osPriority svcThreadGetPriority (osThreadId thread_id) {
791
791
792
792
/// Create a thread and add it to Active Threads and set it to state READY
793
793
osThreadId osThreadCreate (const osThreadDef_t * thread_def , void * argument ) {
794
- if (__get_IPSR () != 0U ) {
794
+ return osThreadContextCreate (thread_def , argument , NULL );
795
+ }
796
+ osThreadId osThreadContextCreate (const osThreadDef_t * thread_def , void * argument , void * context ) {
797
+ if (__get_IPSR () != 0U ) {
795
798
return NULL ; // Not allowed in ISR
796
799
}
797
800
if (((__get_CONTROL () & 1U ) == 0U ) && (os_running == 0U )) {
798
801
// Privileged and not running
799
- return svcThreadCreate (thread_def , argument );
802
+ return svcThreadCreate (thread_def , argument , context );
800
803
} else {
801
- return __svcThreadCreate (thread_def , argument );
804
+ return __svcThreadCreate (thread_def , argument , context );
802
805
}
803
806
}
804
807
0 commit comments