Line | |
---|
1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @brief Thread Dispatch Wrapper Implmentation |
---|
5 | */ |
---|
6 | |
---|
7 | /* |
---|
8 | * COPYRIGHT (c) 1989-2014. |
---|
9 | * On-Line Applications Research Corporation (OAR). |
---|
10 | * |
---|
11 | * The license and distribution terms for this file may be |
---|
12 | * found in the file LICENSE in this distribution or at |
---|
13 | * http://www.rtems.com/license/LICENSE. |
---|
14 | */ |
---|
15 | |
---|
16 | #include "shell.h" |
---|
17 | #include <schedsim_shell.h> |
---|
18 | |
---|
19 | #include <stdio.h> |
---|
20 | #include <rtems.h> |
---|
21 | |
---|
22 | Thread_Control *last_heir = NULL; |
---|
23 | Thread_Control *last_executing = NULL; |
---|
24 | |
---|
25 | extern void __real__Thread_Dispatch(void); |
---|
26 | |
---|
27 | void Init__wrap__Thread_Dispatch() |
---|
28 | { |
---|
29 | } |
---|
30 | |
---|
31 | void check_heir_and_executing(void) |
---|
32 | { |
---|
33 | uint32_t level; |
---|
34 | |
---|
35 | _ISR_Disable_without_giant( level ); |
---|
36 | if ( last_heir != _Thread_Heir ) |
---|
37 | PRINT_HEIR(); |
---|
38 | |
---|
39 | if ( last_executing != _Thread_Executing ) |
---|
40 | PRINT_EXECUTING(); |
---|
41 | |
---|
42 | last_heir = _Thread_Heir; |
---|
43 | last_executing = _Thread_Executing; |
---|
44 | _ISR_Enable_without_giant( level ); |
---|
45 | } |
---|
46 | |
---|
47 | void __wrap__Thread_Dispatch(void) |
---|
48 | { |
---|
49 | if ( schedsim_is_dispatch_allowed() == false ) |
---|
50 | return; |
---|
51 | |
---|
52 | check_heir_and_executing(); |
---|
53 | __real__Thread_Dispatch(); |
---|
54 | check_heir_and_executing(); |
---|
55 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.