tools/ocaml: Expose arch_config in domaininfo

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
Andrew Cooper authored and Wei Liu committed 2018-01-16 18:34:04 +00:00
1 parent 7e98f196bc
commit 9d683b5e37
3 files changed
+81 -2

No files matched your search

+29
View File
@@ -28,6 +28,34 @@ type vcpuinfo =
cpumap: int32;
}
type xen_arm_arch_domainconfig =
{
gic_version: int;
nr_spis: int;
clock_frequency: int32;
}
type x86_arch_emulation_flags =
| X86_EMU_LAPIC
| X86_EMU_HPET
| X86_EMU_PM
| X86_EMU_RTC
| X86_EMU_IOAPIC
| X86_EMU_PIC
| X86_EMU_VGA
| X86_EMU_IOMMU
| X86_EMU_PIT
| X86_EMU_USE_PIRQ
type xen_x86_arch_domainconfig =
{
emulation_flags: x86_arch_emulation_flags list;
}
type arch_domainconfig =
| ARM of xen_arm_arch_domainconfig
| X86 of xen_x86_arch_domainconfig
type domaininfo =
{
domid : domid;
@@ -46,6 +74,7 @@ type domaininfo =
max_vcpu_id : int;
ssidref : int32;
handle : int array;
arch_config : arch_domainconfig;
}
type sched_control =
+28
View File
@@ -22,6 +22,33 @@ type vcpuinfo = {
cputime : int64;
cpumap : int32;
}
type xen_arm_arch_domainconfig = {
gic_version: int;
nr_spis: int;
clock_frequency: int32;
}
type x86_arch_emulation_flags =
| X86_EMU_LAPIC
| X86_EMU_HPET
| X86_EMU_PM
| X86_EMU_RTC
| X86_EMU_IOAPIC
| X86_EMU_PIC
| X86_EMU_VGA
| X86_EMU_IOMMU
| X86_EMU_PIT
| X86_EMU_USE_PIRQ
type xen_x86_arch_domainconfig = {
emulation_flags: x86_arch_emulation_flags list;
}
type arch_domainconfig =
| ARM of xen_arm_arch_domainconfig
| X86 of xen_x86_arch_domainconfig
type domaininfo = {
domid : domid;
dying : bool;
@@ -39,6 +66,7 @@ type domaininfo = {
max_vcpu_id : int;
ssidref : int32;
handle : int array;
arch_config : arch_domainconfig;
}
type sched_control = { weight : int; cap : int; }
type physinfo_cap_flag = CAP_HVM | CAP_DirectIO
+24 -2
View File
@@ -273,10 +273,10 @@ CAMLprim value stub_xc_domain_shutdown(value xch, value domid, value reason)
static value alloc_domaininfo(xc_domaininfo_t * info)
{
CAMLparam0();
CAMLlocal2(result, tmp);
CAMLlocal5(result, tmp, arch_config, x86_arch_config, emul_list);
int i;
result = caml_alloc_tuple(16);
result = caml_alloc_tuple(17);
Store_field(result, 0, Val_int(info->domain));
Store_field(result, 1, Val_bool(info->flags & XEN_DOMINF_dying));
@@ -302,6 +302,28 @@ static value alloc_domaininfo(xc_domaininfo_t * info)
Store_field(result, 15, tmp);
/* emulation_flags: x86_arch_emulation_flags list; */
tmp = emul_list = Val_emptylist;
for (i = 0; i < 10; i++) {
if ((info->arch_config.emulation_flags >> i) & 1) {
tmp = caml_alloc_small(2, Tag_cons);
Field(tmp, 0) = Val_int(i);
Field(tmp, 1) = emul_list;
emul_list = tmp;
}
}
/* xen_x86_arch_domainconfig */
x86_arch_config = caml_alloc_tuple(1);
Store_field(x86_arch_config, 0, emul_list);
/* arch_config: arch_domainconfig */
arch_config = caml_alloc_small(1, 1);
Store_field(arch_config, 0, x86_arch_config);
Store_field(result, 16, arch_config);
CAMLreturn(result);
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.