mirror of
https://github.com/drasko/codezero.git
synced 2026-01-12 02:43:15 +01:00
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:
@@ -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)
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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) */
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user