OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [cpukit/] [rtems/] [src/] [dpmemdelete.c] - Blame information for rev 1780

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1026 ivang
/*
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
 *  dpmemdelete.c,v 1.2 1999/11/17 17:50:27 joel Exp
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
 
38
rtems_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
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.