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

Last change on this file since 7c50462 was abb18dc, checked in by Joel Sherrill <joel.sherrill@…>, on Apr 25, 2011 at 3:53:10 PM

Initial import.

  • Property mode set to 100644
File size: 875 bytes
Line 
1/*
2 *  Thread Dispatch Wrapper Implmentation
3 *
4 *  COPYRIGHT (c) 1989-2010.
5 *  On-Line Applications Research Corporation (OAR).
6 *
7 *  The license and distribution terms for this file may be
8 *  found in the file LICENSE in this distribution or at
9 *  http://www.rtems.com/license/LICENSE.
10 *
11 *  $Id$
12 */
13
14#include "shell.h"
15#include <schedsim_shell.h>
16
17#include <stdio.h>
18#include <rtems.h>
19
20Thread_Control *last_heir = NULL;
21Thread_Control *last_executing = NULL;
22
23extern void __real__Thread_Dispatch(void);
24
25void check_heir_and_executing(void)
26{
27  if ( last_heir != _Thread_Heir ) 
28    PRINT_HEIR();
29
30  if ( last_executing != _Thread_Executing )
31    PRINT_EXECUTING();
32
33  last_heir = _Thread_Heir;
34  last_executing = _Thread_Executing;
35}
36
37void __wrap__Thread_Dispatch(void)
38{
39  check_heir_and_executing();
40    __real__Thread_Dispatch();
41  check_heir_and_executing();
42}
Note: See TracBrowser for help on using the repository browser.