Few more fixes.

Boot files and tasks are now initialised together. Theads can ask for particular
space and thread ids, if they're unused. This enables us to get predefined ids for
known tasks such as the VFS task.

Fixes to README
Other minor fixes.
This commit is contained in:
Bahadir Balban
2008-02-09 14:24:49 +00:00
parent 4aa26af61d
commit ba0e3ada21
14 changed files with 134 additions and 64 deletions

View File

@@ -50,3 +50,15 @@ int check_and_clear_bit(u32 *word, int bit)
}
}
int check_and_set_bit(u32 *word, int bit)
{
/* Check that bit was clear */
if (!(word[BITWISE_GETWORD(bit)] & BITWISE_GETBIT(bit))) {
word[BITWISE_GETWORD(bit)] |= BITWISE_GETBIT(bit);
return 0;
} else {
//printf("Trying to set already set bit\n");
return -1;
}
}

View File

@@ -33,3 +33,14 @@ int id_del(struct id_pool *pool, int id)
return ret;
}
/* Return a specific id, if available */
int id_get(struct id_pool *pool, int id)
{
int ret = check_and_set_bit(pool->bitmap, id);
if (ret < 0)
return ret;
else
return id;
}