Added a device attribute to capabilities - In progress

Followed the kernel physical memory reservation convention
with devices. Devices that are possessable by userspace
are created as boot-time capabilities and placed under the kernel
resources devmem_free capability list. Any userspace container
that is defined with the possession of the device would delete the
device capability making it unavailable to further requests.
This commit is contained in:
Bahadir Balban
2009-11-21 23:45:58 +02:00
parent d826de2eea
commit a3cfa2ac9b
5 changed files with 173 additions and 72 deletions

View File

@@ -40,6 +40,8 @@
{(c)->type &= ~CAP_RTYPE_MASK; \
(c)->type |= CAP_RTYPE_MASK & rtype;}
#define cap_devmem(c) (c)->uattr
/*
* User-defined device-types
* (Kept in the user field)

View File

@@ -71,8 +71,11 @@ struct capability {
unsigned long end; /* Resource end value */
unsigned long size; /* Resource size */
/* Used amount on resource _or_ user-defined attributes */
unsigned long user;
/* Use count of resource */
unsigned long used;
/* User-defined attributes on capability (like devtypes) */
unsigned int uattr;
};
struct cap_list {

View File

@@ -60,6 +60,7 @@ struct cap_info {
unsigned long start;
unsigned long end;
unsigned long size;
unsigned int uattr; /* User-level attributes (like device types) */
};