[zion] Move capability validation to capability.h
This commit is contained in:
parent
93cf8f2740
commit
172bf51db7
8 changed files with 42 additions and 47 deletions
|
|
@ -1,19 +1,17 @@
|
|||
#include "syscall/address_space.h"
|
||||
|
||||
#include "capability/capability.h"
|
||||
#include "scheduler/scheduler.h"
|
||||
#include "syscall/syscall.h"
|
||||
|
||||
z_err_t AddressSpaceMap(ZAddressSpaceMapReq* req) {
|
||||
auto& curr_proc = gScheduler->CurrentProcess();
|
||||
auto vmas_cap = curr_proc.GetCapability(req->vmas_cap);
|
||||
auto vmmo_cap = curr_proc.GetCapability(req->vmmo_cap);
|
||||
RET_ERR(ValidateCap(vmas_cap, ZC_WRITE));
|
||||
RET_ERR(ValidateCap(vmmo_cap, ZC_WRITE));
|
||||
RET_ERR(ValidateCapability<AddressSpace>(vmas_cap, ZC_WRITE));
|
||||
RET_ERR(ValidateCapability<MemoryObject>(vmmo_cap, ZC_WRITE));
|
||||
|
||||
auto vmas = vmas_cap->obj<AddressSpace>();
|
||||
auto vmmo = vmmo_cap->obj<MemoryObject>();
|
||||
RET_IF_NULL(vmas);
|
||||
RET_IF_NULL(vmmo);
|
||||
|
||||
// FIXME: Validation necessary.
|
||||
if (req->vmas_offset != 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue