Skip to content

Commit

Permalink
[vmar][mx] Get rid of pre-VMAR compatibility interface
Browse files Browse the repository at this point in the history
Change-Id: I0c07f028aa557ade3243187b882ed799c714aa67
  • Loading branch information
Todd Eisenberger committed Dec 16, 2016
1 parent a502131 commit 134d59b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 28 deletions.
19 changes: 1 addition & 18 deletions system/ulib/mx/include/mx/process.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,32 +28,15 @@ class process : public task<process> {
return *this;
}

// TODO(MG-417): Remove default value for root_vmar after callers migrated
static mx_status_t create(const job& job, const char* name, uint32_t name_len,
uint32_t flags, process* proc, vmar* root_vmar = nullptr);
uint32_t flags, process* proc, vmar* root_vmar);

static inline const process& self() {
return *reinterpret_cast<process*>(&__magenta_process_self);
}

mx_status_t start(const thread& thread_handle, uintptr_t entry,
uintptr_t stack, handle arg_handle, uintptr_t arg2) const;

// TODO(MG-417): Remove these 3 functions after callers are migrated
mx_status_t map_vm(const vmo& vmo_handle, uint64_t offset, size_t len,
uintptr_t* ptr, uint32_t flags) const {
return mx_process_map_vm(get(), vmo_handle.get(), offset, len, ptr,
flags);
}

mx_status_t unmap_vm(uintptr_t address, size_t len) const {
return mx_process_unmap_vm(get(), address, len);
}

mx_status_t protect_vm(uintptr_t address, size_t len,
uint32_t prot) const {
return mx_process_protect_vm(get(), address, len, prot);
}
};

} // namespace mx
12 changes: 2 additions & 10 deletions system/ulib/mx/process.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,10 @@ mx_status_t process::create(const job& job, const char* name, uint32_t name_len,
mx_status_t status = mx_process_create(job.get(), name, name_len, flags, &proc_h, &vmar_h);
if (status < 0) {
proc->reset(MX_HANDLE_INVALID);
// TODO(teisenbe): Change this to assume vmar is non-null once we no
// longer need compat with old interface.
if (vmar) {
vmar->reset(MX_HANDLE_INVALID);
}
vmar->reset(MX_HANDLE_INVALID);
} else {
proc->reset(proc_h);
if (vmar) {
vmar->reset(vmar_h);
} else {
mx_handle_close(vmar_h);
}
vmar->reset(vmar_h);
}
return status;
}
Expand Down

0 comments on commit 134d59b

Please sign in to comment.