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

4.104.114.84.95
Last change on this file since ef7ceb4 was 08311cc3, checked in by Joel Sherrill <joel.sherrill@…>, on 11/17/99 at 17:51:34

Updated copyright notice.

  • Property mode set to 100644
File size: 1.5 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.OARcorp.com/rtems/license.html.
10 *
11 *  $Id$
12 */
13
14#include <rtems/system.h>
15#include <rtems/rtems/status.h>
16#include <rtems/rtems/support.h>
17#include <rtems/score/address.h>
18#include <rtems/rtems/dpmem.h>
19#include <rtems/score/object.h>
20#include <rtems/score/thread.h>
21#include <rtems/rtems/dpmem.h>
22
23/*PAGE
24 *
25 *  rtems_port_delete
26 *
27 *  This directive allows a thread to delete a dual-ported memory area
28 *  specified by the dual-ported memory identifier.
29 *
30 *  Input parameters:
31 *    id - dual-ported memory area id
32 *
33 *  Output parameters:
34 *    RTEMS_SUCCESSFUL - if successful
35 *    error code        - if unsuccessful
36 */
37
38rtems_status_code rtems_port_delete(
39  Objects_Id id
40)
41{
42  register Dual_ported_memory_Control *the_port;
43  Objects_Locations                    location;
44
45  the_port = _Dual_ported_memory_Get( id, &location );
46  switch ( location ) {
47    case OBJECTS_REMOTE:        /* this error cannot be returned */
48      return RTEMS_INTERNAL_ERROR;
49
50    case OBJECTS_ERROR:
51      return RTEMS_INVALID_ID;
52
53    case OBJECTS_LOCAL:
54      _Objects_Close( &_Dual_ported_memory_Information, &the_port->Object );
55      _Dual_ported_memory_Free( the_port );
56      _Thread_Enable_dispatch();
57      return RTEMS_SUCCESSFUL;
58  }
59
60  return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
61}
Note: See TracBrowser for help on using the repository browser.