Merged MAP and VIRTMEM/PHYSMEM capabilities into one.

VIRTMEM and PHYSMEM are theoretically separate resources to be
protected than a MAP resource, which is meant to protect the syscall
privileges.

In practice MAP is always used together with a VIRTMEM and a PHYSMEM
resource, therefore reach VIRTMEM/PHYSMEM resource is now merged with
the MAP capability, combining the micro-permission bits.
This commit is contained in:
Bahadir Balban
2009-11-04 15:26:47 +02:00
parent b7e575817d
commit db57c598b0
5 changed files with 51 additions and 47 deletions

View File

@@ -12,12 +12,13 @@
#define CAP_TYPE_MASK 0x0000FFFF
#define CAP_TYPE_TCTRL (1 << 0)
#define CAP_TYPE_EXREGS (1 << 1)
#define CAP_TYPE_MAP (1 << 2)
#define CAP_TYPE_IPC (1 << 3)
#define CAP_TYPE_SCHED (1 << 4)
#define CAP_TYPE_UMUTEX (1 << 5)
#define CAP_TYPE_QUANTITY (1 << 6)
#define CAP_TYPE_CAP (1 << 7)
#define CAP_TYPE_MAP_PHYSMEM (1 << 2)
#define CAP_TYPE_MAP_VIRTMEM (1 << 3)
#define CAP_TYPE_IPC (1 << 4)
#define CAP_TYPE_SCHED (1 << 5)
#define CAP_TYPE_UMUTEX (1 << 6)
#define CAP_TYPE_QUANTITY (1 << 7)
#define CAP_TYPE_CAP (1 << 8)
#define cap_type(c) ((c)->type & CAP_TYPE_MASK)
/*
@@ -29,14 +30,12 @@
#define CAP_RTYPE_SPACE (1 << 18)
#define CAP_RTYPE_CONTAINER (1 << 19)
#define CAP_RTYPE_PGGROUP (1 << 20) /* Group of paged threads */
#define CAP_RTYPE_VIRTMEM (1 << 21)
#define CAP_RTYPE_PHYSMEM (1 << 22)
#define CAP_RTYPE_CPUPOOL (1 << 23)
#define CAP_RTYPE_THREADPOOL (1 << 24)
#define CAP_RTYPE_SPACEPOOL (1 << 25)
#define CAP_RTYPE_MUTEXPOOL (1 << 26)
#define CAP_RTYPE_MAPPOOL (1 << 27) /* For pmd spending */
#define CAP_RTYPE_CAPPOOL (1 << 28) /* For new cap generation */
#define CAP_RTYPE_CPUPOOL (1 << 21)
#define CAP_RTYPE_THREADPOOL (1 << 22)
#define CAP_RTYPE_SPACEPOOL (1 << 23)
#define CAP_RTYPE_MUTEXPOOL (1 << 24)
#define CAP_RTYPE_MAPPOOL (1 << 25) /* For pmd spending */
#define CAP_RTYPE_CAPPOOL (1 << 26) /* For new cap generation */
#define cap_rtype(c) ((c)->type & CAP_RTYPE_MASK)