Started code to manage kernel resource table
This commit is contained in:
13
src/resource.c
Normal file
13
src/resource.c
Normal file
@@ -0,0 +1,13 @@
|
||||
#include "resource.h"
|
||||
|
||||
int find_resource_slot(struct resource_table_t *table)
|
||||
{
|
||||
for(int i = 0; i < table->capacity; i++)
|
||||
{
|
||||
if(table->array[i].type == RESOURCE_UNAVAILABLE)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
Reference in New Issue
Block a user