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

4.104.114.84.95
Last change on this file since d6154c7 was d6154c7, checked in by Ralf Corsepius <ralf.corsepius@…>, on 03/29/04 at 16:41:13

2004-03-29 Ralf Corsepius <ralf_corsepius@…>

  • score/include/rtems/debug.h, score/include/rtems/score/bitfield.h, score/include/rtems/score/chain.h, score/include/rtems/score/coremsg.h, score/include/rtems/score/coremutex.h, score/include/rtems/score/coresem.h, score/include/rtems/score/heap.h, score/include/rtems/score/interr.h, score/include/rtems/score/isr.h, score/include/rtems/score/mpci.h, score/include/rtems/score/mppkt.h, score/include/rtems/score/object.h, score/include/rtems/score/objectmp.h, score/include/rtems/score/priority.h, score/include/rtems/score/stack.h, score/include/rtems/score/states.h, score/include/rtems/score/thread.h, score/include/rtems/score/threadmp.h, score/include/rtems/score/threadq.h, score/include/rtems/score/tod.h, score/include/rtems/score/tqdata.h, score/include/rtems/score/userext.h, score/include/rtems/score/watchdog.h, score/include/rtems/score/wkspace.h, score/inline/rtems/score/address.inl, score/inline/rtems/score/coremsg.inl, score/inline/rtems/score/coresem.inl, score/inline/rtems/score/heap.inl, score/inline/rtems/score/isr.inl, score/inline/rtems/score/object.inl, score/inline/rtems/score/priority.inl, score/inline/rtems/score/stack.inl, score/inline/rtems/score/thread.inl, score/inline/rtems/score/tqdata.inl, score/inline/rtems/score/userext.inl, score/inline/rtems/score/wkspace.inl, score/macros/rtems/score/address.inl, score/macros/rtems/score/heap.inl, score/macros/rtems/score/object.inl, score/macros/rtems/score/priority.inl, score/macros/rtems/score/userext.inl: Convert to using c99 fixed size types.
  • Property mode set to 100644
File size: 1.5 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-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.rtems.com/license/LICENSE.
12 *
13 *  $Id$
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 uint32_t   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    ( ( (uint32_t  )(_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 */
Note: See TracBrowser for help on using the repository browser.