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

Subversion Repositories or1k

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1026 ivang
/*
2
 *  Semaphore Manager
3
 *
4
 *  DESCRIPTION:
5
 *
6
 *  This package is the implementation of the Semaphore Manager.
7
 *  This manager utilizes standard Dijkstra counting semaphores to provide
8
 *  synchronization and mutual exclusion capabilities.
9
 *
10
 *  Directives provided are:
11
 *
12
 *     + create a semaphore
13
 *     + get an ID of a semaphore
14
 *     + delete a semaphore
15
 *     + acquire a semaphore
16
 *     + release a semaphore
17
 *
18
 *  COPYRIGHT (c) 1989-1999.
19
 *  On-Line Applications Research Corporation (OAR).
20
 *
21
 *  The license and distribution terms for this file may be
22
 *  found in the file LICENSE in this distribution or at
23
 *  http://www.OARcorp.com/rtems/license.html.
24
 *
25
 *  sem.c,v 1.21 2002/07/01 22:32:31 joel Exp
26
 */
27
 
28
#include <rtems/system.h>
29
#include <rtems/rtems/status.h>
30
#include <rtems/rtems/support.h>
31
#include <rtems/rtems/attr.h>
32
#include <rtems/score/isr.h>
33
#include <rtems/score/object.h>
34
#include <rtems/rtems/options.h>
35
#include <rtems/rtems/sem.h>
36
#include <rtems/score/coremutex.h>
37
#include <rtems/score/coresem.h>
38
#include <rtems/score/states.h>
39
#include <rtems/score/thread.h>
40
#include <rtems/score/threadq.h>
41
#if defined(RTEMS_MULTIPROCESSING)
42
#include <rtems/score/mpci.h>
43
#endif
44
#include <rtems/score/sysstate.h>
45
 
46
#include <rtems/score/interr.h>
47
 
48
/*PAGE
49
 *
50
 *  _Semaphore_Manager_initialization
51
 *
52
 *  This routine initializes all semaphore manager related data structures.
53
 *
54
 *  Input parameters:
55
 *    maximum_semaphores - maximum configured semaphores
56
 *
57
 *  Output parameters:  NONE
58
 */
59
 
60
void _Semaphore_Manager_initialization(
61
  unsigned32 maximum_semaphores
62
)
63
{
64
  _Objects_Initialize_information(
65
    &_Semaphore_Information,     /* object information table */
66
    OBJECTS_CLASSIC_API,         /* object API */
67
    OBJECTS_RTEMS_SEMAPHORES,    /* object class */
68
    maximum_semaphores,          /* maximum objects of this class */
69
    sizeof( Semaphore_Control ), /* size of this object's control block */
70
    FALSE,                       /* TRUE if the name is a string */
71
    RTEMS_MAXIMUM_NAME_LENGTH    /* maximum length of an object name */
72
#if defined(RTEMS_MULTIPROCESSING)
73
    ,
74
    FALSE,                       /* TRUE if this is a global object class */
75
    NULL                         /* Proxy extraction support callout */
76
#endif
77
  );
78
 
79
  /*
80
   *  Register the MP Process Packet routine.
81
   */
82
 
83
#if defined(RTEMS_MULTIPROCESSING)
84
  _MPCI_Register_packet_processor(
85
    MP_PACKET_SEMAPHORE,
86
    _Semaphore_MP_Process_packet
87
  );
88
#endif
89
 
90
}

powered by: WebSVN 2.1.0

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