source: rtems/cpukit/rtems/src/dpmemdelete.c @ e7541849

4.104.114.84.95
Last change on this file since e7541849 was 1095ec1, checked in by Ralf Corsepius <ralf.corsepius@…>, on 01/18/05 at 09:03:45

Include config.h.

  • Property mode set to 100644
File size: 1.6 KB
Line 
1/*
2 *  Dual Port Memory Manager
3 *
4 *  COPYRIGHT (c) 1989-1999.
5 *  On-Line Applications Research Corporation (OAR).
6 *
7 *  The license and distribution terms for this file may be
8 *  found in the file LICENSE in this distribution or at
9 *  http://www.rtems.com/license/LICENSE.
10 *
11 *  $Id$
12 */
13
14#if HAVE_CONFIG_H
15#include "config.h"
16#endif
17
18#include <rtems/system.h>
19#include <rtems/rtems/status.h>
20#include <rtems/rtems/support.h>
21#include <rtems/score/address.h>
22#include <rtems/rtems/dpmem.h>
23#include <rtems/score/object.h>
24#include <rtems/score/thread.h>
25#include <rtems/rtems/dpmem.h>
26
27/*PAGE
28 *
29 *  rtems_port_delete
30 *
31 *  This directive allows a thread to delete a dual-ported memory area
32 *  specified by the dual-ported memory identifier.
33 *
34 *  Input parameters:
35 *    id - dual-ported memory area id
36 *
37 *  Output parameters:
38 *    RTEMS_SUCCESSFUL - if successful
39 *    error code        - if unsuccessful
40 */
41
42rtems_status_code rtems_port_delete(
43  Objects_Id id
44)
45{
46  register Dual_ported_memory_Control *the_port;
47  Objects_Locations                    location;
48
49  the_port = _Dual_ported_memory_Get( id, &location );
50  switch ( location ) {
51    case OBJECTS_REMOTE:        /* this error cannot be returned */
52      return RTEMS_INTERNAL_ERROR;
53
54    case OBJECTS_ERROR:
55      return RTEMS_INVALID_ID;
56
57    case OBJECTS_LOCAL:
58      _Objects_Close( &_Dual_ported_memory_Information, &the_port->Object );
59      _Dual_ported_memory_Free( the_port );
60      _Thread_Enable_dispatch();
61      return RTEMS_SUCCESSFUL;
62  }
63
64  return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
65}
Note: See TracBrowser for help on using the repository browser.