source: rtems/cpukit/score/macros/rtems/score/address.inl @ 43b6f75

4.104.114.84.95
Last change on this file since 43b6f75 was 43b6f75, checked in by Joel Sherrill <joel.sherrill@…>, on 11/30/00 at 14:08:30

2000-11-30 Joel Sherrill <joel@…>

  • General effort to make things compile with macros not inlines
  • inline/rtems/score/coremutex.inl: Added comment indicating for macros there is another copy of _CORE_mutex_Seize_interrupt_trylock() in src/coremutexseize.c.
  • src/coremutexseize.c: Added body of _CORE_mutex_Seize_interrupt_trylock() for macro case.
  • macros/rtems/score/coremutex.inl: Added prototype for _CORE_mutex_Seize_interrupt_trylock() since there is a real body when macros are enabled.
  • macros/rtems/score/coresem.inl: Added macro implementation of _CORE_semaphore_Seize_isr_disable.
  • macros/score/Makefile.am: Fixed typos.
  • rtems/score/address.inl: Correct macro implementation of _Addresses_Is_aligned() so it would compile.
  • macros/rtems/score/coremsg.inl: Added closing parentheses.
  • 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.OARcorp.com/rtems/license.html.
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 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 */
Note: See TracBrowser for help on using the repository browser.