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

4.104.114.84.95
Last change on this file since f26145b was 16351f7a, checked in by Ralf Corsepius <ralf.corsepius@…>, on Jan 28, 2005 at 2:04:21 AM

2005-01-28 Ralf Corsepius <ralf.corsepius@…>

  • sapi/src/debug.c, sapi/src/exinit.c, sapi/src/extension.c, sapi/src/extensioncreate.c, sapi/src/extensiondelete.c, sapi/src/extensionident.c, sapi/src/fatal.c, sapi/src/io.c, sapi/src/itronapi.c, sapi/src/posixapi.c, sapi/src/rtemsapi.c: Include config.h.
  • Property mode set to 100644
File size: 1.4 KB
Line 
1/*
2 *  Extension Manager -- rtems_extension_delete
3 *
4 *
5 *  COPYRIGHT (c) 1989-2002.
6 *  On-Line Applications Research Corporation (OAR).
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.rtems.com/license/LICENSE.
11 *
12 *  $Id$
13 */
14
15#if HAVE_CONFIG_H
16#include "config.h"
17#endif
18
19#include <rtems/system.h>
20#include <rtems/rtems/support.h>
21#include <rtems/score/object.h>
22#include <rtems/score/thread.h>
23#include <rtems/extension.h>
24
25/*PAGE
26 *
27 *  rtems_extension_delete
28 *
29 *  This directive allows a thread to delete a extension.
30 *
31 *  Input parameters:
32 *    id - extension id
33 *
34 *  Output parameters:
35 *    RTEMS_SUCCESSFUL - if successful
36 *    error code - if unsuccessful
37 */
38
39rtems_status_code rtems_extension_delete(
40  Objects_Id id
41)
42{
43  Extension_Control   *the_extension;
44  Objects_Locations    location;
45
46  the_extension = _Extension_Get( id, &location );
47  switch ( location ) {
48    case OBJECTS_ERROR:
49    case OBJECTS_REMOTE:            /* should never return this */
50      return RTEMS_INVALID_ID;
51    case OBJECTS_LOCAL:
52      _User_extensions_Remove_set( &the_extension->Extension );
53      _Objects_Close( &_Extension_Information, &the_extension->Object );
54      _Extension_Free( the_extension );
55      _Thread_Enable_dispatch();
56      return RTEMS_SUCCESSFUL;
57  }
58
59  return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
60}
Note: See TracBrowser for help on using the repository browser.