Changeset 6365f81 in rtems


Ignore:
Timestamp:
Apr 22, 1996, 4:46:00 PM (25 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
8faca06
Parents:
a155b3c
Message:

made initialization routine a regular subroutine

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/score/inline/rtems/score/wkspace.inl

    ra155b3c r6365f81  
    1717#ifndef __WORKSPACE_inl
    1818#define __WORKSPACE_inl
    19 
    20 /*PAGE
    21  *
    22  *  _Workspace_Handler_initialization
    23  *
    24  *  DESCRIPTION:
    25  *
    26  *  This routine performs the initialization necessary for this handler.
    27  */
    28 
    29 STATIC INLINE void _Workspace_Handler_initialization(
    30   void       *starting_address,
    31   unsigned32  size
    32 )
    33 {
    34   unsigned32 *zero_out_array;
    35   unsigned32  index;
    36   unsigned32  memory_available;
    37 
    38   if ( !starting_address || !_Addresses_Is_aligned( starting_address ) )
    39     _Internal_error_Occurred(
    40       INTERNAL_ERROR_CORE,
    41       TRUE,
    42       INTERNAL_ERROR_INVALID_WORKSPACE_ADDRESS
    43     );
    44 
    45   if ( _CPU_Table.do_zero_of_workspace ) {
    46     for( zero_out_array  = (unsigned32 *) starting_address, index = 0 ;
    47          index < size / 4 ;
    48          index++ )
    49       zero_out_array[ index ] = 0;
    50   }
    51 
    52   memory_available = _Heap_Initialize(
    53     &_Workspace_Area,
    54     starting_address,
    55     size,
    56     CPU_HEAP_ALIGNMENT
    57   );
    58 
    59   if ( memory_available == 0 )
    60     _Internal_error_Occurred(
    61       INTERNAL_ERROR_CORE,
    62       TRUE,
    63       INTERNAL_ERROR_TOO_LITTLE_WORKSPACE
    64     );
    65 }
    6619
    6720/*PAGE
  • c/src/exec/score/inline/wkspace.inl

    ra155b3c r6365f81  
    1717#ifndef __WORKSPACE_inl
    1818#define __WORKSPACE_inl
    19 
    20 /*PAGE
    21  *
    22  *  _Workspace_Handler_initialization
    23  *
    24  *  DESCRIPTION:
    25  *
    26  *  This routine performs the initialization necessary for this handler.
    27  */
    28 
    29 STATIC INLINE void _Workspace_Handler_initialization(
    30   void       *starting_address,
    31   unsigned32  size
    32 )
    33 {
    34   unsigned32 *zero_out_array;
    35   unsigned32  index;
    36   unsigned32  memory_available;
    37 
    38   if ( !starting_address || !_Addresses_Is_aligned( starting_address ) )
    39     _Internal_error_Occurred(
    40       INTERNAL_ERROR_CORE,
    41       TRUE,
    42       INTERNAL_ERROR_INVALID_WORKSPACE_ADDRESS
    43     );
    44 
    45   if ( _CPU_Table.do_zero_of_workspace ) {
    46     for( zero_out_array  = (unsigned32 *) starting_address, index = 0 ;
    47          index < size / 4 ;
    48          index++ )
    49       zero_out_array[ index ] = 0;
    50   }
    51 
    52   memory_available = _Heap_Initialize(
    53     &_Workspace_Area,
    54     starting_address,
    55     size,
    56     CPU_HEAP_ALIGNMENT
    57   );
    58 
    59   if ( memory_available == 0 )
    60     _Internal_error_Occurred(
    61       INTERNAL_ERROR_CORE,
    62       TRUE,
    63       INTERNAL_ERROR_TOO_LITTLE_WORKSPACE
    64     );
    65 }
    6619
    6720/*PAGE
  • c/src/exec/score/macros/rtems/score/wkspace.inl

    ra155b3c r6365f81  
    2020/*PAGE
    2121 *
    22  *  _Workspace_Handler_initialization
    23  *
    24  */
    25 
    26 #define _Workspace_Handler_initialization( _starting_address, _size ) \
    27 { \
    28   unsigned32 *zero_out_array; \
    29   unsigned32  index; \
    30   unsigned32  memory_available; \
    31   \
    32   if ( !(_starting_address) || !_Addresses_Is_aligned( (_starting_address) ) ) \
    33     _Internal_error_Occurred( \
    34       INTERNAL_ERROR_CORE, \
    35       TRUE, \
    36       INTERNAL_ERROR_INVALID_WORKSPACE_ADDRESS \
    37     ); \
    38   \
    39   if ( _CPU_Table.do_zero_of_workspace ) { \
    40     for( zero_out_array  = (unsigned32 *) (_starting_address), index = 0 ; \
    41          index < (_size) / 4 ; \
    42          index++ ) \
    43       zero_out_array[ index ] = 0; \
    44   } \
    45   \
    46   memory_available =  _Heap_Initialize( \
    47     &_Workspace_Area, \
    48     (_starting_address), \
    49     (_size), \
    50     CPU_HEAP_ALIGNMENT \
    51   ); \
    52   \
    53   if ( memory_available == 0 ) \
    54     _Internal_error_Occurred( \
    55       INTERNAL_ERROR_CORE, \
    56       TRUE, \
    57       INTERNAL_ERROR_TOO_LITTLE_WORKSPACE \
    58     ); \
    59 }
    60 
    61 /*PAGE
    62  *
    6322 *  _Workspace_Allocate
    6423 *
  • c/src/exec/score/macros/wkspace.inl

    ra155b3c r6365f81  
    2020/*PAGE
    2121 *
    22  *  _Workspace_Handler_initialization
    23  *
    24  */
    25 
    26 #define _Workspace_Handler_initialization( _starting_address, _size ) \
    27 { \
    28   unsigned32 *zero_out_array; \
    29   unsigned32  index; \
    30   unsigned32  memory_available; \
    31   \
    32   if ( !(_starting_address) || !_Addresses_Is_aligned( (_starting_address) ) ) \
    33     _Internal_error_Occurred( \
    34       INTERNAL_ERROR_CORE, \
    35       TRUE, \
    36       INTERNAL_ERROR_INVALID_WORKSPACE_ADDRESS \
    37     ); \
    38   \
    39   if ( _CPU_Table.do_zero_of_workspace ) { \
    40     for( zero_out_array  = (unsigned32 *) (_starting_address), index = 0 ; \
    41          index < (_size) / 4 ; \
    42          index++ ) \
    43       zero_out_array[ index ] = 0; \
    44   } \
    45   \
    46   memory_available =  _Heap_Initialize( \
    47     &_Workspace_Area, \
    48     (_starting_address), \
    49     (_size), \
    50     CPU_HEAP_ALIGNMENT \
    51   ); \
    52   \
    53   if ( memory_available == 0 ) \
    54     _Internal_error_Occurred( \
    55       INTERNAL_ERROR_CORE, \
    56       TRUE, \
    57       INTERNAL_ERROR_TOO_LITTLE_WORKSPACE \
    58     ); \
    59 }
    60 
    61 /*PAGE
    62  *
    6322 *  _Workspace_Allocate
    6423 *
  • cpukit/score/inline/rtems/score/wkspace.inl

    ra155b3c r6365f81  
    1717#ifndef __WORKSPACE_inl
    1818#define __WORKSPACE_inl
    19 
    20 /*PAGE
    21  *
    22  *  _Workspace_Handler_initialization
    23  *
    24  *  DESCRIPTION:
    25  *
    26  *  This routine performs the initialization necessary for this handler.
    27  */
    28 
    29 STATIC INLINE void _Workspace_Handler_initialization(
    30   void       *starting_address,
    31   unsigned32  size
    32 )
    33 {
    34   unsigned32 *zero_out_array;
    35   unsigned32  index;
    36   unsigned32  memory_available;
    37 
    38   if ( !starting_address || !_Addresses_Is_aligned( starting_address ) )
    39     _Internal_error_Occurred(
    40       INTERNAL_ERROR_CORE,
    41       TRUE,
    42       INTERNAL_ERROR_INVALID_WORKSPACE_ADDRESS
    43     );
    44 
    45   if ( _CPU_Table.do_zero_of_workspace ) {
    46     for( zero_out_array  = (unsigned32 *) starting_address, index = 0 ;
    47          index < size / 4 ;
    48          index++ )
    49       zero_out_array[ index ] = 0;
    50   }
    51 
    52   memory_available = _Heap_Initialize(
    53     &_Workspace_Area,
    54     starting_address,
    55     size,
    56     CPU_HEAP_ALIGNMENT
    57   );
    58 
    59   if ( memory_available == 0 )
    60     _Internal_error_Occurred(
    61       INTERNAL_ERROR_CORE,
    62       TRUE,
    63       INTERNAL_ERROR_TOO_LITTLE_WORKSPACE
    64     );
    65 }
    6619
    6720/*PAGE
  • cpukit/score/macros/rtems/score/wkspace.inl

    ra155b3c r6365f81  
    2020/*PAGE
    2121 *
    22  *  _Workspace_Handler_initialization
    23  *
    24  */
    25 
    26 #define _Workspace_Handler_initialization( _starting_address, _size ) \
    27 { \
    28   unsigned32 *zero_out_array; \
    29   unsigned32  index; \
    30   unsigned32  memory_available; \
    31   \
    32   if ( !(_starting_address) || !_Addresses_Is_aligned( (_starting_address) ) ) \
    33     _Internal_error_Occurred( \
    34       INTERNAL_ERROR_CORE, \
    35       TRUE, \
    36       INTERNAL_ERROR_INVALID_WORKSPACE_ADDRESS \
    37     ); \
    38   \
    39   if ( _CPU_Table.do_zero_of_workspace ) { \
    40     for( zero_out_array  = (unsigned32 *) (_starting_address), index = 0 ; \
    41          index < (_size) / 4 ; \
    42          index++ ) \
    43       zero_out_array[ index ] = 0; \
    44   } \
    45   \
    46   memory_available =  _Heap_Initialize( \
    47     &_Workspace_Area, \
    48     (_starting_address), \
    49     (_size), \
    50     CPU_HEAP_ALIGNMENT \
    51   ); \
    52   \
    53   if ( memory_available == 0 ) \
    54     _Internal_error_Occurred( \
    55       INTERNAL_ERROR_CORE, \
    56       TRUE, \
    57       INTERNAL_ERROR_TOO_LITTLE_WORKSPACE \
    58     ); \
    59 }
    60 
    61 /*PAGE
    62  *
    6322 *  _Workspace_Allocate
    6423 *
Note: See TracChangeset for help on using the changeset viewer.