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

Last change on this file since b38dbcc was b38dbcc, checked in by Joel Sherrill <joel.sherrill@…>, on May 14, 2014 at 2:55:21 PM

Many files: rm white space at EOL and EOF

  • Property mode set to 100644
File size: 1.1 KB
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 Init__wrap__Thread_Dispatch()
28{
29}
30
31void 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
47void __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.