xen: change HVM functions signature to run it for other domains
This commit adds possibility to call hypervisor HVM parameter functions for specified domain (instead of only DOMID_SELF). It is needed for configuring domains, that were created from Zephyr control domain. Signed-off-by: Dmytro Firsov <dmytro_firsov@epam.com>
This commit is contained in:
parent
3581527b53
commit
74b271bc2a
|
@ -233,14 +233,14 @@ int xen_console_init(const struct device *dev)
|
|||
|
||||
data->dev = dev;
|
||||
|
||||
ret = hvm_get_parameter(HVM_PARAM_CONSOLE_EVTCHN, &data->evtchn);
|
||||
ret = hvm_get_parameter(HVM_PARAM_CONSOLE_EVTCHN, DOMID_SELF, &data->evtchn);
|
||||
if (ret) {
|
||||
LOG_ERR("%s: failed to get Xen console evtchn, ret = %d\n",
|
||||
__func__, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = hvm_get_parameter(HVM_PARAM_CONSOLE_PFN, &console_pfn);
|
||||
ret = hvm_get_parameter(HVM_PARAM_CONSOLE_PFN, DOMID_SELF, &console_pfn);
|
||||
if (ret) {
|
||||
LOG_ERR("%s: failed to get Xen console PFN, ret = %d\n",
|
||||
__func__, ret);
|
||||
|
|
|
@ -11,23 +11,23 @@
|
|||
|
||||
#include <zephyr/kernel.h>
|
||||
|
||||
int hvm_set_parameter(int idx, uint64_t value)
|
||||
int hvm_set_parameter(int idx, int domid, uint64_t value)
|
||||
{
|
||||
struct xen_hvm_param xhv;
|
||||
|
||||
xhv.domid = DOMID_SELF;
|
||||
xhv.domid = domid;
|
||||
xhv.index = idx;
|
||||
xhv.value = value;
|
||||
|
||||
return HYPERVISOR_hvm_op(HVMOP_set_param, &xhv);
|
||||
}
|
||||
|
||||
int hvm_get_parameter(int idx, uint64_t *value)
|
||||
int hvm_get_parameter(int idx, int domid, uint64_t *value)
|
||||
{
|
||||
int ret = 0;
|
||||
struct xen_hvm_param xhv;
|
||||
|
||||
xhv.domid = DOMID_SELF;
|
||||
xhv.domid = domid;
|
||||
xhv.index = idx;
|
||||
|
||||
ret = HYPERVISOR_hvm_op(HVMOP_get_param, &xhv);
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
#include <zephyr/kernel.h>
|
||||
|
||||
int hvm_set_parameter(int idx, uint64_t value);
|
||||
int hvm_get_parameter(int idx, uint64_t *value);
|
||||
int hvm_set_parameter(int idx, int domid, uint64_t value);
|
||||
int hvm_get_parameter(int idx, int domid, uint64_t *value);
|
||||
|
||||
#endif /* __XEN_HVM_H__ */
|
||||
|
|
Loading…
Reference in a new issue