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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [exec/] [rtems/] [src/] [dpmemdelete.c] - Blame information for rev 30

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

Line No. Rev Author Line
1 30 unneback
/*
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: dpmemdelete.c,v 1.2 2001-09-27 11:59:19 chris 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.