mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 21:59:12 -04:00
haven: rm: Add HH_SELF_VM name
RM accepts "VMID 0" as meaning "self." Thus, add a vm_name "HH_SELF_VM" which means the same. Haven RM console operates on vm_names and can use HH_SELF_VM to talk to RM about this VM's console. Change-Id: I7663db28497ad86a94d4a8c98f3b7068f5644915 Signed-off-by: Elliot Berman <eberman@codeaurora.org>
This commit is contained in:
parent
91553bb268
commit
73eacbb2f3
3 changed files with 8 additions and 3 deletions
|
|
@ -205,7 +205,7 @@ static int __init hvc_hh_console_init(void)
|
|||
{
|
||||
int ret;
|
||||
|
||||
ret = hvc_instantiate(hh_vm_name_to_vtermno(HH_PRIMARY_VM), 0,
|
||||
ret = hvc_instantiate(hh_vm_name_to_vtermno(HH_SELF_VM), 0,
|
||||
&hh_hv_ops);
|
||||
|
||||
return ret < 0 ? -ENODEV : 0;
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ int hh_rm_get_vmid(enum hh_vm_names vm_name, hh_vmid_t *vmid)
|
|||
{
|
||||
hh_vmid_t _vmid = hh_vm_table[vm_name].vmid;
|
||||
|
||||
if (!_vmid) {
|
||||
if (!_vmid && vm_name != HH_SELF_VM) {
|
||||
pr_err("%s: No vmid associated with the vm\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -346,7 +346,7 @@ int hh_rm_vm_alloc_vmid(enum hh_vm_names vm_name)
|
|||
/* Look up for the vm_name<->vmid pair if already present.
|
||||
* If so, return.
|
||||
*/
|
||||
if (!hh_vm_table[vm_name].vmid) {
|
||||
if (hh_vm_table[vm_name].vmid || vm_name == HH_SELF_VM) {
|
||||
pr_err("%s: VM_ALLOCATE already called for this VM\n",
|
||||
__func__);
|
||||
return -EINVAL;
|
||||
|
|
|
|||
|
|
@ -22,6 +22,11 @@ typedef u64 hh_dbl_flags_t;
|
|||
#define HH_CAPID_INVAL U64_MAX
|
||||
|
||||
enum hh_vm_names {
|
||||
/*
|
||||
* HH_SELF_VM is an alias for VMID 0. Useful for RM APIs which allow
|
||||
* operations on current VM such as console
|
||||
*/
|
||||
HH_SELF_VM,
|
||||
HH_PRIMARY_VM,
|
||||
HH_TRUSTED_VM,
|
||||
HH_VM_MAX
|
||||
|
|
|
|||
Loading…
Reference in a new issue