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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [doc/] [tools/] [bmenu/] [address.inl] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1026 ivang
/*  inline/address.inl
2
 *
3
 *  This include file contains the bodies of the routines
4
 *  about addresses which are inlined.
5
 *
6
 *  COPYRIGHT (c) 1988-2002.
7
 *  On-Line Applications Research Corporation (OAR).
8
 *  All rights reserved.
9
 *
10
 *  address.inl,v 1.5 2002/01/17 21:47:47 joel Exp
11
 */
12
 
13
#ifndef __INLINE_ADDRESSES_inl
14
#define __INLINE_ADDRESSES_inl
15
 
16
/*PAGE
17
 *
18
 *  _Addresses_Add_offset
19
 *
20
 */
21
 
22
STATIC INLINE void *_Addresses_Add_offset (
23
  void       *base,
24
  unsigned32  offset
25
)
26
{
27
  return (base + offset);
28
}
29
 
30
/*PAGE
31
 *
32
 *  _Addresses_Subtract_offset
33
 *
34
 */
35
 
36
STATIC INLINE void *_Addresses_Subtract_offset (
37
  void       *base,
38
  unsigned32  offset
39
)
40
{
41
  return (base - offset);
42
}
43
 
44
/*PAGE
45
 *
46
 *  _Addresses_Add
47
 *
48
 *  NOTE:  The cast of an address to an unsigned32 makes this code
49
 *         dependent on an addresses being thirty two bits.
50
 */
51
 
52
STATIC INLINE void *_Addresses_Add (
53
  void *left,
54
  void *right
55
)
56
{
57
  return (left + (unsigned32)right);
58
}
59
 
60
/*PAGE
61
 *
62
 *  _Addresses_Subtract
63
 *
64
 *  NOTE:  The cast of an address to an unsigned32 makes this code
65
 *         dependent on an addresses being thirty two bits.
66
 */
67
 
68
STATIC INLINE unsigned32 _Addresses_Subtract (
69
  void *left,
70
  void *right
71
)
72
{
73
  return (left - right);
74
}
75
 
76
/*PAGE
77
 *
78
 *  _Addresses_Is_aligned
79
 *
80
 */
81
 
82
STATIC INLINE boolean _Addresses_Is_aligned (
83
  void *address
84
)
85
{
86
    return ( ( (unsigned32)address % 4 ) == 0 );
87
}
88
 
89
/*PAGE
90
 *
91
 *  _Addresses_Is_aligned
92
 *
93
 */
94
 
95
STATIC INLINE boolean _Addresses_Is_in_range (
96
  void *address,
97
  void *base,
98
  void *limit
99
)
100
{
101
  return ( address >= base && address <= limit );
102
}
103
 
104
#endif
105
/* end of include file */

powered by: WebSVN 2.1.0

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