source: rtems/cpukit/score/src/isrsmp.c @ 2d7ae960

4.115
Last change on this file since 2d7ae960 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 1.8 KB
Line 
1/*
2 *  ISR Enable/Disable for SMP Configurations
3 *
4 *  COPYRIGHT (c) 1989-2011.
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
12#if HAVE_CONFIG_H
13#include "config.h"
14#endif
15
16#include <rtems/system.h>
17#include <rtems/score/isr.h>
18#include <rtems/score/thread.h>
19#include <rtems/score/smp.h>
20
21void _ISR_SMP_Initialize(void)
22{
23}
24
25ISR_Level _ISR_SMP_Disable(void)
26{
27  ISR_Level level;
28
29  _ISR_Disable_on_this_core( level );
30  return level;
31}
32
33void _ISR_SMP_Enable(ISR_Level level)
34{
35  _ISR_Enable_on_this_core( level );
36}
37
38void _ISR_SMP_Flash(ISR_Level level)
39{
40  ISR_Level ignored;
41
42  _ISR_SMP_Enable( level );
43  ignored = _ISR_SMP_Disable();
44}
45
46int _ISR_SMP_Enter(void)
47{
48  uint32_t isr_nest_level;
49  ISR_Level level;
50
51  _ISR_Disable_on_this_core( level );
52
53  isr_nest_level = _ISR_Nest_level++;
54
55  _Thread_Disable_dispatch();
56
57  return isr_nest_level;
58}
59
60/*
61 *  Return values:
62 *     0 - simple return
63 *     1 - dispatching return
64 */
65int _ISR_SMP_Exit(void)
66{
67  ISR_Level level;
68  int       retval;
69
70  retval = 0;
71
72  _ISR_Disable_on_this_core( level );
73
74  _ISR_Nest_level--;
75
76  if ( _ISR_Nest_level == 0 ) {
77    if ( _Thread_Dispatch_necessary ) {
78      if ( _Thread_Dispatch_get_disable_level() == 1 ) {
79        retval = 1;
80      }
81    }
82  }
83
84  /*
85   *  SPARC has special support to avoid some nasty recursive type behaviour.
86   *  When dispatching in a thread and we want to return to it then it needs
87   *  to finish.
88   */
89  #if defined(__sparc__)
90    if ( _CPU_ISR_Dispatch_disable )
91      retval = 0;
92  #endif
93
94  _ISR_Enable_on_this_core( level );
95
96  _Thread_Dispatch_decrement_disable_level();
97
98   if ( retval == 0 )
99    _SMP_Request_other_cores_to_dispatch();
100
101  return retval;
102}
Note: See TracBrowser for help on using the repository browser.