[zion] Move to default permissions being supplied by KernelObjects
This commit is contained in:
parent
48c6e5b3a4
commit
1364fbed9f
16 changed files with 91 additions and 54 deletions
|
|
@ -20,6 +20,10 @@ class Capability : public glcr::RefCounted<Capability> {
|
|||
Capability(const glcr::RefPtr<T>& obj, uint64_t permissions)
|
||||
: Capability(StaticCastRefPtr<KernelObject>(obj), permissions) {}
|
||||
|
||||
template <typename T>
|
||||
Capability(const glcr::RefPtr<T>& obj)
|
||||
: Capability(obj, T::DefaultPermissions()) {}
|
||||
|
||||
template <typename T>
|
||||
glcr::RefPtr<T> obj();
|
||||
|
||||
|
|
|
|||
|
|
@ -14,9 +14,12 @@ class CapabilityTable {
|
|||
CapabilityTable& operator=(CapabilityTable&) = delete;
|
||||
|
||||
template <typename T>
|
||||
uint64_t AddNewCapability(const glcr::RefPtr<T>& object,
|
||||
uint64_t permissions);
|
||||
uint64_t AddExistingCapability(const glcr::RefPtr<Capability>& cap);
|
||||
z_cap_t AddNewCapability(const glcr::RefPtr<T>& object, uint64_t permissions);
|
||||
template <typename T>
|
||||
z_cap_t AddNewCapability(const glcr::RefPtr<T>& object) {
|
||||
return AddNewCapability<T>(object, T::DefaultPermissions());
|
||||
}
|
||||
z_cap_t AddExistingCapability(const glcr::RefPtr<Capability>& cap);
|
||||
|
||||
glcr::RefPtr<Capability> GetCapability(uint64_t id);
|
||||
glcr::RefPtr<Capability> ReleaseCapability(uint64_t id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue