diff options
author | Joel Sherrill <joel.sherrill@oarcorp.com> | 2014-05-26 13:15:13 -0500 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@oarcorp.com> | 2014-05-26 13:15:13 -0500 |
commit | 968d2b26c7ca5bb61d82254c3d1340b72e35e6b5 (patch) | |
tree | bab88ec229783b3313d0bcd646b0a03fa466c968 /schedsim/shell/shared | |
parent | dispatch is now a shared SMP command (diff) | |
download | rtems-schedsim-968d2b26c7ca5bb61d82254c3d1340b72e35e6b5.tar.bz2 |
Unify printing of heir and executing
Diffstat (limited to 'schedsim/shell/shared')
-rw-r--r-- | schedsim/shell/shared/Makefile.am | 1 | ||||
-rw-r--r-- | schedsim/shell/shared/printheir_executing.c | 41 |
2 files changed, 42 insertions, 0 deletions
diff --git a/schedsim/shell/shared/Makefile.am b/schedsim/shell/shared/Makefile.am index 6940f41..af5b282 100644 --- a/schedsim/shell/shared/Makefile.am +++ b/schedsim/shell/shared/Makefile.am @@ -48,6 +48,7 @@ libschedsim_a_SOURCES += main_taskpriority.c libschedsim_a_SOURCES += main_taskresume.c libschedsim_a_SOURCES += main_tasksuspend.c libschedsim_a_SOURCES += main_taskwakeafter.c +libschedsim_a_SOURCES += printheir_executing.c libschedsim_a_SOURCES += schedsim_disable_dispatch.c libschedsim_a_SOURCES += shell_cmdset.c libschedsim_a_SOURCES += shell_makeargs.c diff --git a/schedsim/shell/shared/printheir_executing.c b/schedsim/shell/shared/printheir_executing.c new file mode 100644 index 0000000..604b434 --- /dev/null +++ b/schedsim/shell/shared/printheir_executing.c @@ -0,0 +1,41 @@ +/** + * @file + * @brief print heir and executing support + */ + +/* + * COPYRIGHT (c) 1989-2013. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + */ + +#include <stdio.h> +#include <rtems.h> + +#if RTEMS_SMP + extern uint32_t Schedsim_Current_cpu; + #define MY_CPU Schedsim_Current_cpu +#else + #define MY_CPU 0 +#endif + +void PRINT_EXECUTING() { + printf( + " CPU %d: Thread Executing: 0x%08x priority=%ld\n", + MY_CPU, + _Thread_Executing->Object.id, + (long) _Thread_Executing->current_priority + ); +} + +void PRINT_HEIR() { + printf( + " CPU %d: Thread Heir: 0x%08x priority=%ld\n", + MY_CPU, + _Thread_Heir->Object.id, + (long) _Thread_Heir->current_priority + ); +} |