source: rtems/cpukit/score/macros/rtems/score/address.inl @ ac7d5ef0

4.104.114.84.95
Last change on this file since ac7d5ef0 was ac7d5ef0, checked in by Joel Sherrill <joel.sherrill@…>, on 05/11/95 at 17:39:37

Initial revision

  • Property mode set to 100644
File size: 1.6 KB
Line 
1/*  macros/address.h
2 *
3 *  This include file contains the bodies of the routines
4 *  about addresses which are inlined.
5 *
6 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
7 *  On-Line Applications Research Corporation (OAR).
8 *  All rights assigned to U.S. Government, 1994.
9 *
10 *  This material may be reproduced by or for the U.S. Government pursuant
11 *  to the copyright license under the clause at DFARS 252.227-7013.  This
12 *  notice must appear in all copies of this file and its derivatives.
13 *
14 *  $Id$
15 */
16
17#ifndef __MACROS_ADDRESSES_h
18#define __MACROS_ADDRESSES_h
19
20/*PAGE
21 *
22 *  _Addresses_Add_offset
23 *
24 */
25
26#define _Addresses_Add_offset( _base, _offset ) \
27  ((void *)(_base) + (_offset))
28
29/*PAGE
30 *
31 *  _Addresses_Subtract_offset
32 *
33 */
34
35#define _Addresses_Subtract_offset( _base, _offset ) \
36  ((void *)(_base) - (_offset))
37
38/*PAGE
39 *
40 *  _Addresses_Add
41 *
42 *  NOTE:  The cast of an address to an unsigned32 makes this code
43 *         dependent on an addresses being thirty two bits.
44 */
45
46#define _Addresses_Add( _left, _right ) \
47  ((void *)(_left) + (unsigned32)(_right))
48
49/*PAGE
50 *
51 *  _Addresses_Subtract
52 *
53 *  NOTE:  The cast of an address to an unsigned32 makes this code
54 *         dependent on an addresses being thirty two bits.
55 */
56
57#define _Addresses_Subtract( _left, _right ) \
58  ((void *)(_left) - (void *)(_right))
59
60/*PAGE
61 *
62 *  _Addresses_Is_aligned
63 *
64 */
65
66#define _Addresses_Is_aligned( _address ) \
67    ( ( (unsigned32)(_address) % 4 ) == 0 )
68
69/*PAGE
70 *
71 *  _Addresses_Is_in_range
72 *
73 */
74
75#define _Addresses_Is_in_range( _address, _base, _limit ) \
76  ( (_address) >= (_base) && (_address) <= (_limit) )
77
78#endif
79/* end of include file */
Note: See TracBrowser for help on using the repository browser.