source: rtems/cpukit/rtems/src/dpmemdelete.c @ 2d2352b

4.115
Last change on this file since 2d2352b was 2d2352b, checked in by Sebastian Huber <sebastian.huber@…>, on 06/05/13 at 09:48:57

score: Add and use _Objects_Put()

Add and use _Objects_Put_without_thread_dispatch(). These two functions
pair with the _Objects_Get() function. This helps to introduce object
specific SMP locks to avoid lock contention.

  • Property mode set to 100644
File size: 1.2 KB
Line 
1/**
2 *  @file
3 *
4 *  @brief RTEMS Delete Port
5 *  @ingroup ClassicDPMEM
6 */
7
8/*
9 *  COPYRIGHT (c) 1989-2007.
10 *  On-Line Applications Research Corporation (OAR).
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.rtems.com/license/LICENSE.
15 */
16
17#if HAVE_CONFIG_H
18#include "config.h"
19#endif
20
21#include <rtems/system.h>
22#include <rtems/rtems/status.h>
23#include <rtems/rtems/support.h>
24#include <rtems/score/address.h>
25#include <rtems/rtems/dpmem.h>
26#include <rtems/score/object.h>
27#include <rtems/score/thread.h>
28#include <rtems/rtems/dpmem.h>
29
30rtems_status_code rtems_port_delete(
31  rtems_id id
32)
33{
34  register Dual_ported_memory_Control *the_port;
35  Objects_Locations                    location;
36
37  the_port = _Dual_ported_memory_Get( id, &location );
38  switch ( location ) {
39
40    case OBJECTS_LOCAL:
41      _Objects_Close( &_Dual_ported_memory_Information, &the_port->Object );
42      _Dual_ported_memory_Free( the_port );
43      _Objects_Put( &the_port->Object );
44      return RTEMS_SUCCESSFUL;
45
46#if defined(RTEMS_MULTIPROCESSING)
47    case OBJECTS_REMOTE:        /* this error cannot be returned */
48#endif
49    case OBJECTS_ERROR:
50      break;
51  }
52
53  return RTEMS_INVALID_ID;
54}
Note: See TracBrowser for help on using the repository browser.