Lines Matching +full:runs +full:- +full:on
5 * SPDX-License-Identifier: MIT
53 * a tick interrupt being generated on an embedded target. In this Windows
60 * Process all the simulated interrupts - each represented by a bit in
73 * Exiting a critical section will cause the calling task to block on yield
87 /*-----------------------------------------------------------*/
89 /* The WIN32 simulator runs each task in a thread. The context switching is
119 * initialised to a non-zero value so interrupts do not become enabled during
121 * ulCriticalNesting will get set to zero when the first task runs. This
138 /*-----------------------------------------------------------*/
191 /* The interrupt is now pending - notify the simulated interrupt in prvSimulatedPeripheralTimer()
206 /*-----------------------------------------------------------*/
223 /*-----------------------------------------------------------*/
236 * the stack that was created for the task - so the stack buffer is still in pxPortInitialiseStack()
239 pxThreadState = ( ThreadState_t * ) ( pcTopOfStack - sizeof( ThreadState_t ) ); in pxPortInitialiseStack()
244 pxThreadState->pvYieldEvent = CreateEvent( NULL, /* Default security attributes. */ in pxPortInitialiseStack()
250 …pxThreadState->pvThread = CreateThread( NULL, xStackSize, ( LPTHREAD_START_ROUTINE ) pxCode, pvPar… in pxPortInitialiseStack()
251 configASSERT( pxThreadState->pvThread ); /* See comment where TerminateThread() is called. */ in pxPortInitialiseStack()
252 SetThreadAffinityMask( pxThreadState->pvThread, 0x01 ); in pxPortInitialiseStack()
253 SetThreadPriorityBoost( pxThreadState->pvThread, TRUE ); in pxPortInitialiseStack()
254 SetThreadPriority( pxThreadState->pvThread, portTASK_THREAD_PRIORITY ); in pxPortInitialiseStack()
258 /*-----------------------------------------------------------*/
267 /* This port runs windows threads with extremely high priority. All the in xPortStartScheduler()
268 * threads execute on the same core - to prevent locking up the host only start in xPortStartScheduler()
274 … printf( "This version of the FreeRTOS Windows port can only be used on multi-core hosts.\r\n" ); in xPortStartScheduler()
346 ResumeThread( pxThreadState->pvThread ); in xPortStartScheduler()
351 /* Handle all simulated interrupts - including yield requests and in xPortStartScheduler()
360 /*-----------------------------------------------------------*/
367 /*-----------------------------------------------------------*/
379 /*-----------------------------------------------------------*/
390 /* Going to block on the mutex that ensured exclusive access to the simulated in prvProcessSimulatedInterrupts()
412 * critical section will block on a yield mutex to wait for an interrupt to in prvProcessSimulatedInterrupts()
462 * 'suspend' operation doesn't take effect immediately - if it in prvProcessSimulatedInterrupts()
465 * or yielding then the task will block on a yield event after the in prvProcessSimulatedInterrupts()
469 SuspendThread( pxThreadState->pvThread ); in prvProcessSimulatedInterrupts()
476 * https://devblogs.microsoft.com/oldnewthing/20150205-00/?p=44743 in prvProcessSimulatedInterrupts()
477 * they do - so as they do not harm (slight run-time hit). */ in prvProcessSimulatedInterrupts()
479 ( void ) GetThreadContext( pxThreadState->pvThread, &xContext ); in prvProcessSimulatedInterrupts()
485 /* pxThreadState->pvThread can be NULL if the task deleted in prvProcessSimulatedInterrupts()
486 * itself - but a deleted task should never be resumed here. */ in prvProcessSimulatedInterrupts()
487 configASSERT( pxThreadState->pvThread != NULL ); in prvProcessSimulatedInterrupts()
488 ResumeThread( pxThreadState->pvThread ); in prvProcessSimulatedInterrupts()
493 * because it yielded then it will wait on an event when it resumed in prvProcessSimulatedInterrupts()
499 * is reset before the task blocks on it. */ in prvProcessSimulatedInterrupts()
501 SetEvent( pxThreadState->pvYieldEvent ); in prvProcessSimulatedInterrupts()
506 /*-----------------------------------------------------------*/
520 * vPortCloseRunningThread() - which will be the case if the task associated in vPortDeleteThread()
523 if( pxThreadState->pvThread != NULL ) in vPortDeleteThread()
531 ulErrorCode = TerminateThread( pxThreadState->pvThread, 0 ); in vPortDeleteThread()
534 ulErrorCode = CloseHandle( pxThreadState->pvThread ); in vPortDeleteThread()
540 /*-----------------------------------------------------------*/
554 pvThread = pxThreadState->pvThread; in vPortCloseRunningThread()
563 * ensure a context switch occurs away from this thread on the next tick. */ in vPortCloseRunningThread()
568 pxThreadState->pvThread = NULL; in vPortCloseRunningThread()
577 CloseHandle( pxThreadState->pvYieldEvent ); in vPortCloseRunningThread()
580 /*-----------------------------------------------------------*/
586 /*-----------------------------------------------------------*/
609 /* Going to wait for an event - make sure the event is not already in vPortGenerateSimulatedInterrupt()
611 ResetEvent( pxThreadState->pvYieldEvent ); in vPortGenerateSimulatedInterrupt()
620 * executed before the next line is reached - so this is just to make in vPortGenerateSimulatedInterrupt()
622 WaitForSingleObject( pxThreadState->pvYieldEvent, INFINITE ); in vPortGenerateSimulatedInterrupt()
626 /*-----------------------------------------------------------*/
645 /*-----------------------------------------------------------*/
658 /*-----------------------------------------------------------*/
665 * obtained on entry to the critical section. */ in vPortExitCritical()
670 ulCriticalNesting--; in vPortExitCritical()
685 * pvInterruptEventMutex is released as it waits on both in vPortExitCritical()
689 * from outside a critical section - hence it is set in vPortExitCritical()
695 * critical section is exited - so make sure the event is not in vPortExitCritical()
697 ResetEvent( pxThreadState->pvYieldEvent ); in vPortExitCritical()
700 * execute, so does not require releasing on function exit. */ in vPortExitCritical()
703 WaitForSingleObject( pxThreadState->pvYieldEvent, INFINITE ); in vPortExitCritical()
717 /*-----------------------------------------------------------*/