A fix and a helper macro for the thread library.

The fix solves the problem of giving the last slice from a pool.

The helper macro makes utcb space creation easy for the user because we have to
consider a few things like alignment and total allocated space.
This commit is contained in:
Bora Sahin
2009-11-16 21:49:37 +02:00
parent 7fb923cd35
commit 682c62f8bb
2 changed files with 5 additions and 2 deletions

View File

@@ -49,8 +49,7 @@ int find_and_set_first_free_contig_bits(u32 *word, unsigned int limit,
return -1;
/* This is a state machine that checks n contiguous free bits. */
/* FIXME: It should be <= instead of <. Fix & test in a single patch */
while (i + nbits < limit) {
while (i + nbits <= limit) {
first = i;
last = i;
while (!(word[BITWISE_GETWORD(last)] & BITWISE_GETBIT(last))) {