source: rtems/cpukit/score/src/userextaddset.c @ 0a97ba5b

5
Last change on this file since 0a97ba5b was 865f110b, checked in by Sebastian Huber <sebastian.huber@…>, on 03/22/16 at 06:58:41

score: Fix for RTEMS_DEBUG

The rtems_extension_create() no longer uses the Giant lock. Ensure that
we call _User_extensions_Add_set() only in the right context.

Update #2555.

  • Property mode set to 100644
File size: 1.2 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup ScoreUserExt
5 *
6 * @brief User Extension Handler implementation.
7 */
8
9/*
10 *  COPYRIGHT (c) 1989-2007.
11 *  On-Line Applications Research Corporation (OAR).
12 *
13 *  The license and distribution terms for this file may be
14 *  found in the file LICENSE in this distribution or at
15 *  http://www.rtems.org/license/LICENSE.
16 */
17
18#if HAVE_CONFIG_H
19#include "config.h"
20#endif
21
22#include <rtems/score/userextimpl.h>
23#include <rtems/score/objectimpl.h>
24#include <rtems/score/percpu.h>
25#include <rtems/score/sysstate.h>
26
27void _User_extensions_Add_set(
28  User_extensions_Control *the_extension
29)
30{
31  _Assert(
32    _Objects_Allocator_is_owner()
33      || _System_state_Is_before_multitasking( _System_state_Get() )
34  );
35
36  _Chain_Append_unprotected( &_User_extensions_List, &the_extension->Node );
37
38  /*
39   * If a switch handler is present, append it to the switch chain.
40   */
41
42  if ( the_extension->Callouts.thread_switch != NULL ) {
43    ISR_Level level;
44
45    the_extension->Switch.thread_switch =
46      the_extension->Callouts.thread_switch;
47
48    _Per_CPU_Acquire_all( level );
49    _Chain_Append_unprotected(
50      &_User_extensions_Switches_list,
51      &the_extension->Switch.Node
52    );
53    _Per_CPU_Release_all( level );
54  }
55}
Note: See TracBrowser for help on using the repository browser.