Add a resource_list_reserved() method that returns true if a resource
list entry contains a reserved resource.
This commit is contained in:
parent
8694ea87f5
commit
144df3a28f
@ -2933,6 +2933,30 @@ resource_list_busy(struct resource_list *rl, int type, int rid)
|
|||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Determine if a resource entry is reserved.
|
||||||
|
*
|
||||||
|
* Returns true if a resource entry is reserved meaning that it has an
|
||||||
|
* associated "reserved" resource. The resource can either be
|
||||||
|
* allocated or unallocated.
|
||||||
|
*
|
||||||
|
* @param rl the resource list to search
|
||||||
|
* @param type the resource entry type (e.g. SYS_RES_MEMORY)
|
||||||
|
* @param rid the resource identifier
|
||||||
|
*
|
||||||
|
* @returns Non-zero if the entry is reserved, zero otherwise.
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
resource_list_reserved(struct resource_list *rl, int type, int rid)
|
||||||
|
{
|
||||||
|
struct resource_list_entry *rle;
|
||||||
|
|
||||||
|
rle = resource_list_find(rl, type, rid);
|
||||||
|
if (rle != NULL && rle->flags & RLE_RESERVED)
|
||||||
|
return (1);
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Find a resource entry by type and rid.
|
* @brief Find a resource entry by type and rid.
|
||||||
*
|
*
|
||||||
|
@ -256,6 +256,7 @@ int resource_list_add_next(struct resource_list *rl,
|
|||||||
u_long start, u_long end, u_long count);
|
u_long start, u_long end, u_long count);
|
||||||
int resource_list_busy(struct resource_list *rl,
|
int resource_list_busy(struct resource_list *rl,
|
||||||
int type, int rid);
|
int type, int rid);
|
||||||
|
int resource_list_reserved(struct resource_list *rl, int type, int rid);
|
||||||
struct resource_list_entry*
|
struct resource_list_entry*
|
||||||
resource_list_find(struct resource_list *rl,
|
resource_list_find(struct resource_list *rl,
|
||||||
int type, int rid);
|
int type, int rid);
|
||||||
|
Loading…
Reference in New Issue
Block a user