Rev 4743 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4743 | Rev 4754 | ||
---|---|---|---|
Line 83... | Line 83... | ||
83 | size_t sizes[ FREE_QUEUES_COUNT ]; |
83 | size_t sizes[ FREE_QUEUES_COUNT ]; |
84 | /** Total packets allocated. |
84 | /** Total packets allocated. |
85 | */ |
85 | */ |
86 | unsigned int count; |
86 | unsigned int count; |
87 | } ps_globals = { |
87 | } ps_globals = { |
- | 88 | .lock = { |
|
- | 89 | .counter = 1, |
|
- | 90 | .waiters = { |
|
- | 91 | .prev = & ps_globals.lock.waiters, |
|
88 | { .counter = 1, .waiters = { .prev = & ps_globals.lock.waiters, .next = & ps_globals.lock.waiters, }}, |
92 | .next = & ps_globals.lock.waiters, |
- | 93 | } |
|
- | 94 | }, |
|
89 | { NULL, NULL, NULL, NULL, NULL, NULL, NULL }, |
95 | .free = { NULL, NULL, NULL, NULL, NULL, NULL, NULL }, |
90 | { PAGE_SIZE, PAGE_SIZE * 2, PAGE_SIZE * 4, PAGE_SIZE * 8, PAGE_SIZE * 16, PAGE_SIZE * 32, PAGE_SIZE * 64 }, |
96 | .sizes = { PAGE_SIZE, PAGE_SIZE * 2, PAGE_SIZE * 4, PAGE_SIZE * 8, PAGE_SIZE * 16, PAGE_SIZE * 32, PAGE_SIZE * 64 }, |
91 | 0 |
97 | .count = 0 |
92 | }; |
98 | }; |
93 | 99 | ||
94 | /** @name Packet server support functions |
100 | /** @name Packet server support functions |
95 | */ |
101 | */ |
96 | /*@{*/ |
102 | /*@{*/ |
Line 258... | Line 264... | ||
258 | } |
264 | } |
259 | } |
265 | } |
260 | packet = packet_create( length, addr_len, max_prefix, max_content, max_suffix ); |
266 | packet = packet_create( length, addr_len, max_prefix, max_content, max_suffix ); |
261 | fibril_mutex_unlock( & ps_globals.lock ); |
267 | fibril_mutex_unlock( & ps_globals.lock ); |
262 | // remove debug dump |
268 | // remove debug dump |
263 | printf( "packet %d created\n", packet->packet_id ); |
269 | // printf( "packet %d created\n", packet->packet_id ); |
264 | return packet; |
270 | return packet; |
265 | } |
271 | } |
266 | 272 | ||
267 | packet_t packet_create( size_t length, size_t addr_len, size_t max_prefix, size_t max_content, size_t max_suffix ){ |
273 | packet_t packet_create( size_t length, size_t addr_len, size_t max_prefix, size_t max_content, size_t max_suffix ){ |
268 | ERROR_DECLARE; |
274 | ERROR_DECLARE; |