source: rtems/cpukit/sapi/src/extensiondelete.c

Last change on this file was 80cf60e, checked in by Sebastian Huber <sebastian.huber@…>, on Apr 15, 2020 at 7:48:32 AM

Canonicalize config.h include

Use the following variant which was already used by most source files:

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

  • Property mode set to 100644
File size: 1001 bytes
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#ifdef HAVE_CONFIG_H
19#include "config.h"
20#endif
21
22#include <rtems/extensionimpl.h>
23#include <rtems/score/userextimpl.h>
24
25rtems_status_code rtems_extension_delete(
26  rtems_id id
27)
28{
29  rtems_status_code  status;
30  Extension_Control *the_extension;
31
32  _Objects_Allocator_lock();
33
34  the_extension = _Extension_Get( id );
35
36  if ( the_extension != NULL ) {
37    _Objects_Close( &_Extension_Information, &the_extension->Object );
38    _User_extensions_Remove_set( &the_extension->Extension );
39    _Extension_Free( the_extension );
40    status = RTEMS_SUCCESSFUL;
41  } else {
42    status = RTEMS_INVALID_ID;
43  }
44
45  _Objects_Allocator_unlock();
46  return status;
47}
Note: See TracBrowser for help on using the repository browser.