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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [librtems++/] [src/] [rtemsEvent.cc] - Blame information for rev 596

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

Line No. Rev Author Line
1 30 unneback
/*
2
  ------------------------------------------------------------------------
3
  $Id: rtemsEvent.cc,v 1.2 2001-09-27 12:02:05 chris Exp $
4
  ------------------------------------------------------------------------
5
 
6
  COPYRIGHT (c) 1997
7
  Objective Design Systems Ltd Pty (ODS)
8
  All rights reserved (R) Objective Design Systems Ltd Pty
9
 
10
  The license and distribution terms for this file may be found in the
11
  file LICENSE in this distribution or at
12
  http://www.OARcorp.com/rtems/license.html.
13
 
14
  ------------------------------------------------------------------------
15
 
16
  See header file.
17
 
18
  ------------------------------------------------------------------------
19
*/
20
 
21
#include <rtems++/rtemsEvent.h>
22
 
23
/* ----
24
    rtemsEvent
25
*/
26
 
27
rtemsEvent::rtemsEvent(const char *name_str, rtems_unsigned32 node)
28
  : name(rtems_build_name('S', 'E', 'L', 'F')),
29
    id(RTEMS_SELF)
30
{
31
  connect(name_str, node);
32
}
33
 
34
rtemsEvent::rtemsEvent(const rtemsEvent& event)
35
{
36
  name = event.name;
37
  id = event.id;
38
}
39
 
40
rtemsEvent::rtemsEvent()
41
  : name(rtems_build_name('S', 'E', 'L', 'F')),
42
    id(RTEMS_SELF)
43
{
44
}
45
 
46
rtemsEvent::~rtemsEvent()
47
{
48
}
49
 
50
const rtemsEvent& rtemsEvent::operator=(const rtemsEvent& event)
51
{
52
  name = event.name;
53
  id = event.id;
54
 
55
  return *this;
56
}
57
 
58
const rtems_status_code rtemsEvent::connect(const char *name_str,
59
                                            const rtems_unsigned32 node)
60
{
61
  name = rtems_build_name(name_str[0],
62
                          name_str[1],
63
                          name_str[2],
64
                          name_str[3]);
65
 
66
  set_status_code(rtems_task_ident(name, node, &id));
67
 
68
  if (unsuccessful())
69
  {
70
    name = rtems_build_name('S', 'E', 'L', 'F');
71
    id = RTEMS_SELF;
72
  }
73
 
74
  return last_status_code();
75
}

powered by: WebSVN 2.1.0

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