source: rtems/cpukit/sapi/src/extensioncreate.c @ 05ef287

Last change on this file since 05ef287 was 05ef287, checked in by Sebastian Huber <sebastian.huber@…>, on Mar 15, 2016 at 2:09:17 PM

sapi: Do not disable thread dispatching

Do not disable thread dispatching to add a user extension. After
startup, the object allocator lock is enough.

Update #2555.

  • Property mode set to 100644
File size: 1.3 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup ClassicUserExtensions
5 *
6 * @brief User Extensions 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/system.h>
23#include <rtems/rtems/support.h>
24#include <rtems/score/thread.h>
25#include <rtems/score/userextimpl.h>
26#include <rtems/extensionimpl.h>
27
28rtems_status_code rtems_extension_create(
29  rtems_name                    name,
30  const rtems_extensions_table *extension_table,
31  rtems_id                     *id
32)
33{
34  Extension_Control *the_extension;
35
36  if ( !id )
37    return RTEMS_INVALID_ADDRESS;
38
39  if ( !rtems_is_name_valid( name ) )
40    return RTEMS_INVALID_NAME;
41
42  the_extension = _Extension_Allocate();
43
44  if ( !the_extension ) {
45    _Objects_Allocator_unlock();
46    return RTEMS_TOO_MANY;
47  }
48
49  _User_extensions_Add_set_with_table( &the_extension->Extension, extension_table );
50
51  _Objects_Open(
52    &_Extension_Information,
53    &the_extension->Object,
54    (Objects_Name) name
55  );
56
57  *id = the_extension->Object.id;
58  _Objects_Allocator_unlock();
59  return RTEMS_SUCCESSFUL;
60}
Note: See TracBrowser for help on using the repository browser.