Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
xcap
xcap-capability-linux
Commits
fa7aec8c
Commit
fa7aec8c
authored
Mar 10, 2014
by
Muktesh Khole
Committed by
Vikram Narayanan
Oct 25, 2016
Browse files
start implementing lcd_update_cdt
parent
8fa32a9b
Changes
2
Hide whitespace changes
Inline
Side-by-side
xcap/capability.c
View file @
fa7aec8c
...
...
@@ -263,6 +263,8 @@ cap_id lcd_create_cap(void * ptcb, void * hobject, lcd_cap_rights crights)
cap
->
cap
.
crights
=
crights
;
cap
->
cap
.
hobject
=
hobject
;
cap
->
cap
.
cdt_list
=
NULL
;
cap
->
cap
.
parent_cid
=
0
;
cap
->
cap
.
parent_tcb
=
NULL
;
up
(
&
(
cspace
->
sem_cspace
));
return
cid
;
}
...
...
@@ -300,15 +302,16 @@ cap_id lcd_cap_grant(void *src_tcb, cap_id src_cid, void * dst_tcb, lcd_cap_righ
dst_cte
->
cap
.
crights
=
crights
;
dst_cte
->
cap
.
hobject
=
src_cte
->
cap
.
hobject
;
dst_cte
->
cap
.
cdt_list
=
NULL
;
dst_cte
->
cap
.
parent_cid
=
src_cid
;
dst_cte
->
cap
.
parent_tcb
=
src_tcb
;
// update the CDT of source
cdt_node
=
kmalloc
(
sizeof
(
struct
cap_derivation_list
),
GFP_KERNEL
);
if
(
cdt_node
!=
NULL
)
{
cdt_node
->
next
=
src_cte
->
cap
.
cdt_list
;
src_cte
->
cap
.
cdt_list
=
cdt_node
;
cdt_node
->
remote
_cid
=
cid
;
cdt_node
->
remote
_TCB
=
dst_tcb
;
cdt_node
->
child
_cid
=
cid
;
cdt_node
->
child
_TCB
=
dst_tcb
;
}
else
{
...
...
xcap/capability.h
View file @
fa7aec8c
...
...
@@ -77,8 +77,8 @@ enum {
struct
cap_derivation_list
{
void
*
remote
_TCB
;
// reference to the thread which was granted this capability
cap_id
remote
_cid
;
// address in the remote threads capability space where this
void
*
child
_TCB
;
// reference to the thread which was granted this capability
cap_id
child
_cid
;
// address in the remote threads capability space where this
// capability is stored.
struct
cap_derivation_list
*
next
;
};
...
...
@@ -93,6 +93,8 @@ struct capability_internal
void
*
hobject
;
// a pointer to a kernel object
struct
cap_derivation_list
*
cdt_list
;
// list of domain ids to whom this capability is granted
lcd_cap_rights
crights
;
// specifies the rights the domain has over this capability
void
*
parent_tcb
;
cap_id
parent_cid
;
};
struct
cte
;
...
...
@@ -213,6 +215,11 @@ uint32_t lcd_cap_delete(void * ptcb, cap_id cid);
// a capability which is its child or was derieved from it.
uint32_t
lcd_cap_revoke
(
void
*
ptcb
,
cap_id
cid
);
// should be called when the thread exits.
// this is extremely heavy function which updates the CDT for all capabilities present
// in the cspace of the exiting thread.
void
lcd_update_cdt
(
void
*
ptcb
);
// will be used to get the rights available with a capability.
uint32_t
lcd_get_cap_rights
(
void
*
ptcb
,
cap_id
cid
,
lcd_cap_rights
*
rights
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment