From ac7d5ef06a6d6e8d84abbd1f0b82162725f98326 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 11 May 1995 17:39:37 +0000 Subject: Initial revision --- cpukit/rtems/macros/rtems/rtems/part.inl | 117 +++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 cpukit/rtems/macros/rtems/rtems/part.inl (limited to 'cpukit/rtems/macros/rtems/rtems/part.inl') diff --git a/cpukit/rtems/macros/rtems/rtems/part.inl b/cpukit/rtems/macros/rtems/rtems/part.inl new file mode 100644 index 0000000000..55c188b210 --- /dev/null +++ b/cpukit/rtems/macros/rtems/rtems/part.inl @@ -0,0 +1,117 @@ +/* part.inl + * + * This file contains the macro implementation of all inlined routines + * in the Partition Manager. + * + * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. + * On-Line Applications Research Corporation (OAR). + * All rights assigned to U.S. Government, 1994. + * + * This material may be reproduced by or for the U.S. Government pursuant + * to the copyright license under the clause at DFARS 252.227-7013. This + * notice must appear in all copies of this file and its derivatives. + * + * $Id$ + */ + +#ifndef __PARTITION_inl +#define __PARTITION_inl + +/*PAGE + * + * _Partition_Allocate_buffer + * + */ + +#define _Partition_Allocate_buffer( _the_partition ) \ + _Chain_Get( &(_the_partition)->Memory ) + +/*PAGE + * + * _Partition_Free_buffer + * + */ + +#define _Partition_Free_buffer( _the_partition, _the_buffer ) \ + _Chain_Append( &(_the_partition)->Memory, (_the_buffer) ) + +/*PAGE + * + * _Partition_Is_buffer_on_boundary + * + */ + +#define _Partition_Is_buffer_on_boundary( _the_buffer, _the_partition ) \ + ((((unsigned32) _Addresses_Subtract( \ + (_the_buffer), \ + (_the_partition)->starting_address ) \ + ) % \ + (_the_partition)->buffer_size) == 0) + +/*PAGE + * + * _Partition_Is_buffer_valid + * + */ + +#define _Partition_Is_buffer_valid( _the_buffer, _the_partition ) \ + ( \ + _Addresses_Is_in_range( \ + (_the_buffer), \ + (_the_partition)->starting_address, \ + _Addresses_Add_offset( \ + (_the_partition)->starting_address, \ + (_the_partition)->length \ + ) \ + ) && \ + _Partition_Is_buffer_on_boundary( (_the_buffer), (_the_partition) ) \ + ) + +/*PAGE + * + * _Partition_Is_buffer_size_aligned + * + */ + +#define _Partition_Is_buffer_size_aligned( _buffer_size ) \ + ((_buffer_size) % CPU_PARTITION_ALIGNMENT == 0) + +/*PAGE + * + * _Partition_Allocate + * + */ + +#define _Partition_Allocate() \ + (Partition_Control *) _Objects_Allocate( &_Partition_Information ) + +/*PAGE + * + * _Partition_Free + * + */ + +#define _Partition_Free( _the_partition ) \ + _Objects_Free( &_Partition_Information, &(_the_partition)->Object ) + +/*PAGE + * + * _Partition_Get + * + */ + +#define _Partition_Get( _id, _location ) \ + (Partition_Control *) \ + _Objects_Get( &_Partition_Information, (_id), (_location) ) + +/*PAGE + * + * _Partition_Is_null + * + */ + +#define _Partition_Is_null( _the_partition ) \ + ( (_the_partition) == NULL ) + +#endif +/* end of include file */ -- cgit v1.2.3