Subversion Repositories HelenOS

Rev

Rev 4731 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4731 Rev 4743
Line 221... Line 221...
221
}
221
}
222
 
222
 
223
void packet_release( packet_t packet ){
223
void packet_release( packet_t packet ){
224
    int index;
224
    int index;
225
 
225
 
-
 
226
    // remove debug dump
-
 
227
//  printf( "packet %d released\n", packet->packet_id );
226
    for( index = 0; ( index < FREE_QUEUES_COUNT - 1 ) && ( packet->length > ps_globals.sizes[ index ] ); ++ index );
228
    for( index = 0; ( index < FREE_QUEUES_COUNT - 1 ) && ( packet->length > ps_globals.sizes[ index ] ); ++ index );
227
    ps_globals.free[ index ] = pq_add( ps_globals.free[ index ], packet, packet->length, packet->length );
229
    ps_globals.free[ index ] = pq_add( ps_globals.free[ index ], packet, packet->length, packet->length );
228
    assert( ps_globals.free[ index ] );
230
    assert( ps_globals.free[ index ] );
229
}
231
}
230
 
232
 
Line 247... Line 249...
247
                }else{
249
                }else{
248
                    pq_detach( packet );
250
                    pq_detach( packet );
249
                }
251
                }
250
                packet_init( packet, addr_len, max_prefix, max_content, max_suffix );
252
                packet_init( packet, addr_len, max_prefix, max_content, max_suffix );
251
                fibril_mutex_unlock( & ps_globals.lock );
253
                fibril_mutex_unlock( & ps_globals.lock );
-
 
254
                // remove debug dump
-
 
255
//              printf( "packet %d got\n", packet->packet_id );
252
                return packet;
256
                return packet;
253
            }
257
            }
254
        }
258
        }
255
    }
259
    }
256
    packet = packet_create( length, addr_len, max_prefix, max_content, max_suffix );
260
    packet = packet_create( length, addr_len, max_prefix, max_content, max_suffix );
257
    fibril_mutex_unlock( & ps_globals.lock );
261
    fibril_mutex_unlock( & ps_globals.lock );
-
 
262
    // remove debug dump
-
 
263
    printf( "packet %d created\n", packet->packet_id );
258
    return packet;
264
    return packet;
259
}
265
}
260
 
266
 
261
packet_t packet_create( size_t length, size_t addr_len, size_t max_prefix, size_t max_content, size_t max_suffix ){
267
packet_t packet_create( size_t length, size_t addr_len, size_t max_prefix, size_t max_content, size_t max_suffix ){
262
    ERROR_DECLARE;
268
    ERROR_DECLARE;