mirror of
https://github.com/drasko/codezero.git
synced 2026-02-28 09:43:14 +01:00
Few minor userspace polishes on caps for kernel changes
This commit is contained in:
@@ -119,9 +119,6 @@ void cap_print(struct capability *cap)
|
|||||||
case CAP_RTYPE_CONTAINER:
|
case CAP_RTYPE_CONTAINER:
|
||||||
printf("Capability resource type:\t%s\n", "Container");
|
printf("Capability resource type:\t%s\n", "Container");
|
||||||
break;
|
break;
|
||||||
case CAP_RTYPE_UMUTEX:
|
|
||||||
printf("Capability resource type:\t%s\n", "Mutex");
|
|
||||||
break;
|
|
||||||
case CAP_RTYPE_VIRTMEM:
|
case CAP_RTYPE_VIRTMEM:
|
||||||
printf("Capability resource type:\t%s\n", "Virtual Memory");
|
printf("Capability resource type:\t%s\n", "Virtual Memory");
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ int capability_test(void)
|
|||||||
* group
|
* group
|
||||||
*/
|
*/
|
||||||
if ((err = l4_capability_control(CAP_CONTROL_SHARE,
|
if ((err = l4_capability_control(CAP_CONTROL_SHARE,
|
||||||
CAP_SHARE_GROUP, 0)) < 0) {
|
CAP_SHARE_CONTAINER, 0)) < 0) {
|
||||||
printf("Sharing capability with thread group failed.\n");
|
printf("Sharing capability with thread group failed.\n");
|
||||||
goto out_err;
|
goto out_err;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -245,10 +245,8 @@ int sys_mutex_control(unsigned long mutex_address, int mutex_op)
|
|||||||
/*
|
/*
|
||||||
* Find and check physical address for virtual mutex address
|
* Find and check physical address for virtual mutex address
|
||||||
*
|
*
|
||||||
* FIXME: Could we check this as a capability? Perhaps not
|
* NOTE: This is a shortcut to capability checking on memory
|
||||||
* since not always the caller but its pager possesses
|
* capabilities of current task.
|
||||||
* relevant memory capability. Maybe check on behalf of
|
|
||||||
* its pager?
|
|
||||||
*/
|
*/
|
||||||
if (!(mutex_physical =
|
if (!(mutex_physical =
|
||||||
virt_to_phys_by_pgd(mutex_address,
|
virt_to_phys_by_pgd(mutex_address,
|
||||||
|
|||||||
Reference in New Issue
Block a user