RCS file: /usr1/CVS/rtems/cpukit/score/src/objectallocate.c,v
retrieving revision 1.7
diff -u -r1.7 objectallocate.c
|
|
|
46 | 46 | (Objects_Control *) _Chain_Get( &information->Inactive ); |
47 | 47 | |
48 | 48 | 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 | ); |
53 | 53 | |
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 | | } |
69 | 54 | } |
70 | 55 | |
71 | 56 | return the_object; |
RCS file: /usr1/CVS/rtems/cpukit/score/src/objectextendinformation.c,v
retrieving revision 1.9
diff -u -r1.9 objectextendinformation.c
|
|
|
124 | 124 | object_blocks = (void**) |
125 | 125 | _Workspace_Allocate( |
126 | 126 | block_count * |
127 | | (sizeof(void *) + sizeof(uint32_t ) + sizeof(Objects_Name *)) + |
| 127 | (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + |
128 | 128 | ((maximum + minimum_index) * sizeof(Objects_Control *)) |
129 | 129 | ); |
130 | 130 | |
… |
… |
|
135 | 135 | object_blocks = (void**) |
136 | 136 | _Workspace_Allocate_or_fatal_error( |
137 | 137 | block_count * |
138 | | (sizeof(void *) + sizeof(uint32_t ) + sizeof(Objects_Name *)) + |
| 138 | (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + |
139 | 139 | ((maximum + minimum_index) * sizeof(Objects_Control *)) |
140 | 140 | ); |
141 | 141 | } |
… |
… |
|
148 | 148 | inactive_per_block = (uint32_t *) _Addresses_Add_offset( |
149 | 149 | object_blocks, block_count * sizeof(void*) ); |
150 | 150 | 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) ); |
152 | 152 | local_table = (Objects_Control **) _Addresses_Add_offset( |
153 | 153 | name_table, block_count * sizeof(Objects_Name *) ); |
154 | 154 | |
… |
… |
|
171 | 171 | block_count * sizeof(void*) ); |
172 | 172 | memcpy( inactive_per_block, |
173 | 173 | information->inactive_per_block, |
174 | | block_count * sizeof(uint32_t ) ); |
| 174 | block_count * sizeof(uint32_t) ); |
175 | 175 | memcpy( name_table, |
176 | 176 | information->name_table, |
177 | 177 | block_count * sizeof(Objects_Name *) ); |
RCS file: /usr1/CVS/rtems/cpukit/score/src/objectinitializeinformation.c,v
retrieving revision 1.11
diff -u -r1.11 objectinitializeinformation.c
|
|
|
96 | 96 | * Are we operating in unlimited, or auto-extend mode |
97 | 97 | */ |
98 | 98 | |
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; |
101 | 102 | |
102 | 103 | /* |
103 | 104 | * The allocation unit is the maximum value |
RCS file: /usr1/CVS/rtems/cpukit/score/src/threadchangepriority.c,v
retrieving revision 1.8
diff -u -r1.8 threadchangepriority.c
|
|
|
95 | 95 | */ |
96 | 96 | state = the_thread->current_state; |
97 | 97 | if ( state != STATES_TRANSIENT ) { |
| 98 | the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); |
| 99 | _ISR_Enable( level ); |
98 | 100 | if ( _States_Is_waiting_on_thread_queue( state ) ) { |
99 | | _ISR_Enable( level ); |
100 | 101 | _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); |
101 | | _ISR_Disable( level ); /* redisable so state is cleared with ISR off */ |
102 | 102 | } |
103 | | the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); |
104 | | _ISR_Enable( level ); |
105 | 103 | return; |
106 | 104 | } |
107 | 105 | |
RCS file: /usr1/CVS/rtems/cpukit/score/src/threadqdequeuepriority.c,v
retrieving revision 1.7
diff -u -r1.7 threadqdequeuepriority.c
|
|
|
75 | 75 | |
76 | 76 | case THREAD_QUEUE_NOTHING_HAPPENED: |
77 | 77 | case THREAD_QUEUE_TIMEOUT: |
| 78 | printk( "BUMP\n"); |
78 | 79 | the_thread_queue->sync_state = THREAD_QUEUE_SATISFIED; |
79 | 80 | _ISR_Enable( level ); |
80 | 81 | return _Thread_Executing; |
RCS file: /usr1/CVS/rtems/cpukit/score/src/threadqenqueuepriority.c,v
retrieving revision 1.9
diff -u -r1.9 threadqenqueuepriority.c
|
|
|
75 | 75 | _ISR_Disable( level ); |
76 | 76 | search_thread = (Thread_Control *) header->first; |
77 | 77 | while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { |
| 78 | if ( the_thread_queue->sync_state != THREAD_QUEUE_NOTHING_HAPPENED ) |
| 79 | goto synchronize; |
78 | 80 | search_priority = search_thread->current_priority; |
79 | 81 | if ( priority <= search_priority ) |
80 | 82 | break; |
… |
… |
|
122 | 124 | _ISR_Disable( level ); |
123 | 125 | search_thread = (Thread_Control *) header->last; |
124 | 126 | while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { |
| 127 | if ( the_thread_queue->sync_state != THREAD_QUEUE_NOTHING_HAPPENED ) |
| 128 | goto synchronize; |
125 | 129 | search_priority = search_thread->current_priority; |
126 | 130 | if ( priority >= search_priority ) |
127 | 131 | break; |
… |
… |
|
163 | 167 | return; |
164 | 168 | |
165 | 169 | equal_priority: /* add at end of priority group */ |
| 170 | if ( the_thread_queue->sync_state != THREAD_QUEUE_NOTHING_HAPPENED ) |
| 171 | goto synchronize; |
166 | 172 | search_node = _Chain_Tail( &search_thread->Wait.Block2n ); |
167 | 173 | previous_node = search_node->previous; |
168 | 174 | the_node = (Chain_Node *) the_thread; |
… |
… |
|
177 | 183 | |
178 | 184 | synchronize: |
179 | 185 | |
| 186 | printk("\nSYNC\n"); |
180 | 187 | sync_state = the_thread_queue->sync_state; |
181 | 188 | the_thread_queue->sync_state = THREAD_QUEUE_SYNCHRONIZED; |
182 | 189 | |
RCS file: /usr1/CVS/rtems/cpukit/score/src/threadqrequeue.c,v
retrieving revision 1.2
diff -u -r1.2 threadqrequeue.c
|
|
|
43 | 43 | ) |
44 | 44 | { |
45 | 45 | /* just in case the thread really wasn't blocked here */ |
46 | | if ( !the_thread_queue ) |
| 46 | if ( !the_thread_queue ) { |
47 | 47 | return; |
| 48 | } |
48 | 49 | |
49 | 50 | switch ( the_thread_queue->discipline ) { |
50 | 51 | case THREAD_QUEUE_DISCIPLINE_FIFO: |
… |
… |
|
52 | 53 | break; |
53 | 54 | case THREAD_QUEUE_DISCIPLINE_PRIORITY: { |
54 | 55 | Thread_queue_Control *tq = the_thread_queue; |
| 56 | ISR_Level level; |
55 | 57 | |
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 ); |
57 | 61 | _Thread_queue_Extract_priority_helper( tq, the_thread, TRUE ); |
58 | 62 | _Thread_queue_Enqueue_priority( tq, the_thread ); |
59 | 63 | } |
| 64 | _ISR_Enable( level ); |
60 | 65 | break; |
61 | | } |
| 66 | } |
| 67 | } |
62 | 68 | } |
63 | 69 | |