Ticket #1241: pr1241.diff

File pr1241.diff, 7.9 KB (added by Joel Sherrill, on 05/02/07 at 15:37:35)

Patch for CVS head

  • objectallocate.c

    RCS file: /usr1/CVS/rtems/cpukit/score/src/objectallocate.c,v
    retrieving revision 1.7
    diff -u -r1.7 objectallocate.c
     
    4646    (Objects_Control *) _Chain_Get( &information->Inactive );
    4747
    4848  if ( information->auto_extend ) {
    49     /*
    50      *  If the list is empty then we are out of objects and need to
    51      *  extend information base.
    52      */
     49    the_object = _Objects_Allocate_extended_helper(
     50      information,
     51      the_object
     52    );
    5353
    54     if ( !the_object ) {
    55       _Objects_Extend_information( information );
    56       the_object =  (Objects_Control *) _Chain_Get( &information->Inactive );
    57     }
    58 
    59     if ( the_object ) {
    60       uint32_t   block;
    61 
    62       block = _Objects_Get_index( the_object->id ) -
    63               _Objects_Get_index( information->minimum_id );
    64       block /= information->allocation_size;
    65 
    66       information->inactive_per_block[ block ]--;
    67       information->inactive--;
    68     }
    6954  }
    7055
    7156  return the_object;
  • objectextendinformation.c

    RCS file: /usr1/CVS/rtems/cpukit/score/src/objectextendinformation.c,v
    retrieving revision 1.9
    diff -u -r1.9 objectextendinformation.c
     
    124124      object_blocks = (void**)
    125125        _Workspace_Allocate(
    126126          block_count *
    127              (sizeof(void *) + sizeof(uint32_t  ) + sizeof(Objects_Name *)) +
     127             (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) +
    128128          ((maximum + minimum_index) * sizeof(Objects_Control *))
    129129          );
    130130
     
    135135      object_blocks = (void**)
    136136        _Workspace_Allocate_or_fatal_error(
    137137          block_count *
    138              (sizeof(void *) + sizeof(uint32_t  ) + sizeof(Objects_Name *)) +
     138             (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) +
    139139          ((maximum + minimum_index) * sizeof(Objects_Control *))
    140140        );
    141141    }
     
    148148    inactive_per_block = (uint32_t   *) _Addresses_Add_offset(
    149149        object_blocks, block_count * sizeof(void*) );
    150150    name_table = (Objects_Name *) _Addresses_Add_offset(
    151         inactive_per_block, block_count * sizeof(uint32_t  ) );
     151        inactive_per_block, block_count * sizeof(uint32_t) );
    152152    local_table = (Objects_Control **) _Addresses_Add_offset(
    153153        name_table, block_count * sizeof(Objects_Name *) );
    154154
     
    171171              block_count * sizeof(void*) );
    172172      memcpy( inactive_per_block,
    173173              information->inactive_per_block,
    174               block_count * sizeof(uint32_t  ) );
     174              block_count * sizeof(uint32_t) );
    175175      memcpy( name_table,
    176176              information->name_table,
    177177              block_count * sizeof(Objects_Name *) );
  • objectinitializeinformation.c

    RCS file: /usr1/CVS/rtems/cpukit/score/src/objectinitializeinformation.c,v
    retrieving revision 1.11
    diff -u -r1.11 objectinitializeinformation.c
     
    9696   *  Are we operating in unlimited, or auto-extend mode
    9797   */
    9898
    99   information->auto_extend = (maximum & OBJECTS_UNLIMITED_OBJECTS) ? TRUE : FALSE;
    100   maximum                 &= ~OBJECTS_UNLIMITED_OBJECTS;
     99  information->auto_extend =
     100      (maximum & OBJECTS_UNLIMITED_OBJECTS) ? TRUE : FALSE;
     101  maximum &= ~OBJECTS_UNLIMITED_OBJECTS;
    101102
    102103  /*
    103104   *  The allocation unit is the maximum value
  • threadchangepriority.c

    RCS file: /usr1/CVS/rtems/cpukit/score/src/threadchangepriority.c,v
    retrieving revision 1.8
    diff -u -r1.8 threadchangepriority.c
     
    9595   */
    9696  state = the_thread->current_state;
    9797  if ( state != STATES_TRANSIENT ) {
     98    the_thread->current_state = _States_Clear( STATES_TRANSIENT, state );
     99    _ISR_Enable( level );
    98100    if ( _States_Is_waiting_on_thread_queue( state ) ) {
    99        _ISR_Enable( level );
    100101      _Thread_queue_Requeue( the_thread->Wait.queue, the_thread );
    101       _ISR_Disable( level );  /* redisable so state is cleared with ISR off */
    102102    }
    103     the_thread->current_state = _States_Clear( STATES_TRANSIENT, state );
    104     _ISR_Enable( level );
    105103    return;
    106104  }
    107105
  • threadqdequeuepriority.c

    RCS file: /usr1/CVS/rtems/cpukit/score/src/threadqdequeuepriority.c,v
    retrieving revision 1.7
    diff -u -r1.7 threadqdequeuepriority.c
     
    7575
    7676    case THREAD_QUEUE_NOTHING_HAPPENED:
    7777    case THREAD_QUEUE_TIMEOUT:
     78printk( "BUMP\n");
    7879      the_thread_queue->sync_state = THREAD_QUEUE_SATISFIED;
    7980      _ISR_Enable( level );
    8081      return _Thread_Executing;
  • threadqenqueuepriority.c

    RCS file: /usr1/CVS/rtems/cpukit/score/src/threadqenqueuepriority.c,v
    retrieving revision 1.9
    diff -u -r1.9 threadqenqueuepriority.c
     
    7575  _ISR_Disable( level );
    7676  search_thread = (Thread_Control *) header->first;
    7777  while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) {
     78    if ( the_thread_queue->sync_state != THREAD_QUEUE_NOTHING_HAPPENED )
     79      goto synchronize;
    7880    search_priority = search_thread->current_priority;
    7981    if ( priority <= search_priority )
    8082      break;
     
    122124  _ISR_Disable( level );
    123125  search_thread = (Thread_Control *) header->last;
    124126  while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) {
     127    if ( the_thread_queue->sync_state != THREAD_QUEUE_NOTHING_HAPPENED )
     128      goto synchronize;
    125129    search_priority = search_thread->current_priority;
    126130    if ( priority >= search_priority )
    127131      break;
     
    163167  return;
    164168
    165169equal_priority:               /* add at end of priority group */
     170    if ( the_thread_queue->sync_state != THREAD_QUEUE_NOTHING_HAPPENED )
     171      goto synchronize;
    166172  search_node   = _Chain_Tail( &search_thread->Wait.Block2n );
    167173  previous_node = search_node->previous;
    168174  the_node      = (Chain_Node *) the_thread;
     
    177183
    178184synchronize:
    179185
     186printk("\nSYNC\n");
    180187  sync_state = the_thread_queue->sync_state;
    181188  the_thread_queue->sync_state = THREAD_QUEUE_SYNCHRONIZED;
    182189
  • threadqrequeue.c

    RCS file: /usr1/CVS/rtems/cpukit/score/src/threadqrequeue.c,v
    retrieving revision 1.2
    diff -u -r1.2 threadqrequeue.c
     
    4343)
    4444{
    4545  /* just in case the thread really wasn't blocked here */
    46   if ( !the_thread_queue )
     46  if ( !the_thread_queue ) {
    4747    return;
     48  }
    4849
    4950  switch ( the_thread_queue->discipline ) {
    5051    case THREAD_QUEUE_DISCIPLINE_FIFO:
     
    5253      break;
    5354    case THREAD_QUEUE_DISCIPLINE_PRIORITY: {
    5455      Thread_queue_Control *tq = the_thread_queue;
     56      ISR_Level             level;
    5557
    56       _Thread_queue_Enter_critical_section( tq );
     58      _ISR_Disable( level );
     59      if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) {
     60        _Thread_queue_Enter_critical_section( tq );
    5761        _Thread_queue_Extract_priority_helper( tq, the_thread, TRUE );
    5862        _Thread_queue_Enqueue_priority( tq, the_thread );
    5963      }
     64      _ISR_Enable( level );
    6065      break;
    61    }
     66    }
     67  }
    6268}
    6369