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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [exec/] [score/] [macros/] [rtems/] [score/] [coremsg.inl] - Blame information for rev 773

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

Line No. Rev Author Line
1 30 unneback
/*  coremsg.inl
2
 *
3
 *  This include file contains the macro implementation of all
4
 *  inlined routines in the Core Message Handler.
5
 *
6
 *  COPYRIGHT (c) 1989-1999.
7
 *  On-Line Applications Research Corporation (OAR).
8
 *
9
 *  The license and distribution terms for this file may be
10
 *  found in the file LICENSE in this distribution or at
11
 *  http://www.OARcorp.com/rtems/license.html.
12
 *
13
 *  $Id: coremsg.inl,v 1.2 2001-09-27 11:59:34 chris Exp $
14
 */
15
 
16
#ifndef __CORE_MESSAGE_QUEUE_inl
17
#define __CORE_MESSAGE_QUEUE_inl
18
 
19
/*PAGE
20
 *
21
 *  _CORE_message_queue_Send
22
 *
23
 */
24
 
25
#define _CORE_message_queue_Send( _the_message_queue, _buffer, _size, \
26
       _id, _api_message_queue_mp_support, _wait, _timeout ) \
27
  _CORE_message_queue_Submit( (_the_message_queue), (_buffer), (_size), \
28
     (_id), (_api_message_queue_mp_support), \
29
     CORE_MESSAGE_QUEUE_SEND_REQUEST, (_wait), (_timeout)
30
 
31
/*PAGE
32
 *
33
 *  _CORE_message_queue_Urgent
34
 *
35
 */
36
 
37
#define _CORE_message_queue_Urgent( _the_message_queue, _buffer, _size, \
38
       _id, _api_message_queue_mp_support, _wait, _timeout ) \
39
  _CORE_message_queue_Submit( (_the_message_queue), (_buffer), (_size), \
40
     (_id), (_api_message_queue_mp_support), \
41
     CORE_MESSAGE_QUEUE_URGENT_REQUEST, (_wait), (_timeout)
42
 
43
/*PAGE
44
 *
45
 *  _CORE_message_queue_Copy_buffer
46
 */
47
 
48
#define _CORE_message_queue_Copy_buffer( _source, _destination, _size ) \
49
  memcpy( _destination, _source, _size)
50
 
51
/*PAGE
52
 *
53
 *  _CORE_message_queue_Allocate_message_buffer
54
 *
55
 */
56
 
57
#define _CORE_message_queue_Allocate_message_buffer( _the_message_queue ) \
58
  (CORE_message_queue_Buffer_control *) \
59
    _Chain_Get( &(_the_message_queue)->Inactive_messages )
60
 
61
/*PAGE
62
 *
63
 *  _CORE_message_queue_Free_message_buffer
64
 *
65
 */
66
 
67
#define _CORE_message_queue_Free_message_buffer( _the_message_queue, _the_message ) \
68
  _Chain_Append( \
69
    &(_the_message_queue)->Inactive_messages, \
70
    &(_the_message)->Node \
71
  )
72
 
73
/*PAGE
74
 *
75
 *  _CORE_message_queue_Is_priority
76
 *
77
 */
78
 
79
#define _CORE_message_queue_Is_priority( _the_attribute ) \
80
  ((_the_attribute)->discipline == CORE_MESSAGE_QUEUE_DISCIPLINES_PRIORITY)
81
 
82
/*PAGE
83
 *
84
 *  _CORE_message_queue_Get_pending_message
85
 *
86
 */
87
 
88
#define _CORE_message_queue_Get_pending_message( _the_message_queue ) \
89
   (CORE_message_queue_Buffer_control *) \
90
     _Chain_Get_unprotected( &(_the_message_queue)->Pending_messages )
91
 
92
/*PAGE
93
 *
94
 *  _CORE_message_queue_Append
95
 *
96
 */
97
 
98
#define _CORE_message_queue_Append( _the_message_queue, _the_message ) \
99
   _Chain_Append( &(_the_message_queue)->Pending_messages, \
100
                  &(_the_message)->Node )
101
 
102
/*PAGE
103
 *
104
 *  _CORE_message_queue_Prepend
105
 *
106
 */
107
 
108
#define _CORE_message_queue_Prepend( _the_message_queue, _the_message ) \
109
   _Chain_Prepend( &(_the_message_queue)->Pending_messages, \
110
                   &(_the_message)->Node )
111
 
112
/*PAGE
113
 *
114
 *  _CORE_message_queue_Is_null
115
 *
116
 */
117
 
118
#define _CORE_message_queue_Is_null( _the_message_queue ) \
119
   ( (_the_message_queue) == NULL  )
120
 
121
/*PAGE
122
 *
123
 *  _CORE_message_queue_Is_notify_enabled
124
 *
125
 */
126
 
127
#define _CORE_message_queue_Is_notify_enabled( _the_message_queue ) \
128
  ( (_the_message_queue)->notify_handler != NULL )
129
 
130
/*PAGE
131
 *
132
 *  _CORE_message_queue_Set_notify
133
 *
134
 */
135
 
136
#define _CORE_message_queue_Set_notify( \
137
  _the_message_queue, _the_handler, _the_argument ) \
138
    do { \
139
      (_the_message_queue)->notify_handler  = (_the_handler); \
140
      (_the_message_queue)->notify_argument = (_the_argument); \
141
    } while ( 0 )
142
 
143
#endif
144
/* end of include file */

powered by: WebSVN 2.1.0

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