diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-08-06 11:42:54 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-08-06 14:06:50 +0200 |
commit | 363333ede6e77baac9e79c8e664cffe88b6d25d3 (patch) | |
tree | 1fd086e820fac5430f9f91fd6273811ef8fecd55 | |
parent | bf931ccd4b815884f06839e122db38e807dffcfe (diff) |
tx-support SetTaskSwitchExtension
-rw-r--r-- | testsuites/validation/ts-default.h | 6 | ||||
-rw-r--r-- | testsuites/validation/tx-support.c | 18 | ||||
-rw-r--r-- | testsuites/validation/tx-support.h | 4 |
3 files changed, 27 insertions, 1 deletions
diff --git a/testsuites/validation/ts-default.h b/testsuites/validation/ts-default.h index bb0ce8dd91..7c517ef0a6 100644 --- a/testsuites/validation/ts-default.h +++ b/testsuites/validation/ts-default.h @@ -186,7 +186,11 @@ static void task_stack_deallocate( void *stack ) #define CONFIGURE_INIT_TASK_CONSTRUCT_STORAGE_SIZE TASK_STORAGE_SIZE #if !defined( CONFIGURE_INITIAL_EXTENSIONS ) -#define CONFIGURE_INITIAL_EXTENSIONS { .fatal = FatalInitialExtension } +#define CONFIGURE_INITIAL_EXTENSIONS \ + { \ + .fatal = FatalInitialExtension, \ + .thread_switch = TaskSwitchInitialExtension \ + } #endif #if defined( RTEMS_SMP ) && \ diff --git a/testsuites/validation/tx-support.c b/testsuites/validation/tx-support.c index 2c4c659aaa..6e1a27beb8 100644 --- a/testsuites/validation/tx-support.c +++ b/testsuites/validation/tx-support.c @@ -638,6 +638,24 @@ void SetFatalExtension( rtems_fatal_extension fatal ) fatal_extension = fatal; } +static rtems_task_switch_extension task_switch_extension; + +void TaskSwitchInitialExtension( rtems_tcb *executing, rtems_tcb *heir ) +{ + rtems_task_switch_extension task_switch; + + task_switch = task_switch_extension; + + if ( task_switch != NULL ) { + ( *task_switch )( executing, heir ); + } +} + +void SetTaskSwitchExtension( rtems_task_switch_extension task_switch ) +{ + task_switch_extension = task_switch; +} + void ClearExtensionCalls( ExtensionCalls *calls ) { memset( calls, 0, sizeof( *calls ) ); diff --git a/testsuites/validation/tx-support.h b/testsuites/validation/tx-support.h index f7600d4a07..fa60b76b65 100644 --- a/testsuites/validation/tx-support.h +++ b/testsuites/validation/tx-support.h @@ -434,6 +434,10 @@ void FatalInitialExtension( void SetFatalExtension( rtems_fatal_extension fatal ); +void TaskSwitchInitialExtension( rtems_tcb *executing, rtems_tcb *heir ); + +void SetTaskSwitchExtension( rtems_task_switch_extension task_switch ); + typedef struct { uint32_t fatal; uint32_t thread_begin; |