source: rtems-schedsim/schedsim/shell/schedsim_priority/wrap_thread_dispatch.c @ d13fa72

Last change on this file since d13fa72 was d13fa72, checked in by Joel Sherrill <joel.sherrill@…>, on Apr 30, 2014 at 7:53:29 PM

wrap_thread_dispatch.c: Add missed file

  • Property mode set to 100644
File size: 951 bytes
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
22Thread_Control *last_heir = NULL;
23Thread_Control *last_executing = NULL;
24
25extern void __real__Thread_Dispatch(void);
26
27void check_heir_and_executing(void)
28{
29  if ( last_heir != _Thread_Heir ) 
30    PRINT_HEIR();
31
32  if ( last_executing != _Thread_Executing )
33    PRINT_EXECUTING();
34
35  last_heir = _Thread_Heir;
36  last_executing = _Thread_Executing;
37}
38
39void __wrap__Thread_Dispatch(void)
40{
41  if ( schedsim_is_dispatch_allowed() == false )
42    return;
43
44  check_heir_and_executing();
45    __real__Thread_Dispatch();
46  check_heir_and_executing();
47}
Note: See TracBrowser for help on using the repository browser.