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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [cpukit/] [score/] [macros/] [rtems/] [score/] [address.inl] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1026 ivang
/*  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-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
 *  address.inl,v 1.10 2000/11/30 14:07:54 joel Exp
14
 */
15
 
16
#ifndef __MACROS_ADDRESSES_h
17
#define __MACROS_ADDRESSES_h
18
 
19
/*PAGE
20
 *
21
 *  _Addresses_Add_offset
22
 *
23
 */
24
 
25
#define _Addresses_Add_offset( _base, _offset ) \
26
  ((void *)((char *)(_base) + (_offset)))
27
 
28
/*PAGE
29
 *
30
 *  _Addresses_Subtract_offset
31
 *
32
 */
33
 
34
#define _Addresses_Subtract_offset( _base, _offset ) \
35
  ((void *)((char *)(_base) - (_offset)))
36
 
37
/*PAGE
38
 *
39
 *  _Addresses_Subtract
40
 *
41
 *  NOTE:  The cast of an address to an unsigned32 makes this code
42
 *         dependent on an addresses being thirty two bits.
43
 */
44
 
45
#define _Addresses_Subtract( _left, _right ) \
46
  ((void *)(_left) - (void *)(_right))
47
 
48
/*PAGE
49
 *
50
 *  _Addresses_Is_aligned
51
 *
52
 */
53
 
54
#if (CPU_ALIGNMENT == 0)
55
#define _Addresses_Is_aligned( _address ) \
56
    (TRUE)
57
#elif defined(RTEMS_CPU_HAS_16_BIT_ADDRESSES)
58
#define _Addresses_Is_aligned( _address ) \
59
    ( ( (unsigned short)(_address) % CPU_ALIGNMENT ) == 0 )
60
#else
61
#define _Addresses_Is_aligned( _address ) \
62
    ( ( (unsigned32)(_address) % CPU_ALIGNMENT ) == 0 )
63
#endif
64
 
65
/*PAGE
66
 *
67
 *  _Addresses_Is_in_range
68
 *
69
 */
70
 
71
#define _Addresses_Is_in_range( _address, _base, _limit ) \
72
  ( (_address) >= (_base) && (_address) <= (_limit) )
73
 
74
#endif
75
/* end of include file */

powered by: WebSVN 2.1.0

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