tools/ocaml: Drop cpuid helpers

These have no callers, and the underlying infrastructure is about to be
rewritten completely.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Christian Lindig <christian.lindig@citrix.com>
This commit is contained in:
Andrew Cooper committed 2020-02-10 13:09:54 +00:00
1 parent 0a9c44486b
commit 270ff9a835
3 files changed
-76

No files matched your search

-7
View File
@@ -256,13 +256,6 @@ external domain_set_memmap_limit: handle -> domid -> int64 -> unit
external domain_memory_increase_reservation: handle -> domid -> int64 -> unit
= "stub_xc_domain_memory_increase_reservation"
external domain_cpuid_set: handle -> domid -> (int64 * (int64 option))
-> string option array
-> string option array
= "stub_xc_domain_cpuid_set"
external domain_cpuid_apply_policy: handle -> domid -> unit
= "stub_xc_domain_cpuid_apply_policy"
external map_foreign_range: handle -> domid -> int
-> nativeint -> Xenmmap.mmap_interface
= "stub_map_foreign_range"
-7
View File
@@ -219,10 +219,3 @@ external pages_to_kib : int64 -> int64 = "stub_pages_to_kib"
val pages_to_mib : int64 -> int64
external watchdog : handle -> int -> int32 -> int
= "stub_xc_watchdog"
external domain_cpuid_set: handle -> domid -> (int64 * (int64 option))
-> string option array
-> string option array
= "stub_xc_domain_cpuid_set"
external domain_cpuid_apply_policy: handle -> domid -> unit
= "stub_xc_domain_cpuid_apply_policy"
-62
View File
@@ -48,12 +48,6 @@
#define string_of_option_array(array, index) \
((Field(array, index) == Val_none) ? NULL : String_val(Field(Field(array, index), 0)))
/* maybe here we should check the range of the input instead of blindly
* casting it to uint32 */
#define cpuid_input_of_val(i1, i2, input) \
i1 = (uint32_t) Int64_val(Field(input, 0)); \
i2 = ((Field(input, 1) == Val_none) ? 0xffffffff : (uint32_t) Int64_val(Field(Field(input, 1), 0)));
static void Noreturn failwith_xc(xc_interface *xch)
{
char error_str[XC_MAX_ERROR_MSG_LEN + 6];
@@ -826,62 +820,6 @@ CAMLprim value stub_xc_domain_memory_increase_reservation(value xch,
CAMLreturn(Val_unit);
}
CAMLprim value stub_xc_domain_cpuid_set(value xch, value domid,
value input,
value config)
{
CAMLparam4(xch, domid, input, config);
CAMLlocal2(array, tmp);
#if defined(__i386__) || defined(__x86_64__)
int r;
unsigned int c_input[2];
char *c_config[4], *out_config[4];
c_config[0] = string_of_option_array(config, 0);
c_config[1] = string_of_option_array(config, 1);
c_config[2] = string_of_option_array(config, 2);
c_config[3] = string_of_option_array(config, 3);
cpuid_input_of_val(c_input[0], c_input[1], input);
array = caml_alloc(4, 0);
for (r = 0; r < 4; r++) {
tmp = Val_none;
if (c_config[r]) {
tmp = caml_alloc_small(1, 0);
Field(tmp, 0) = caml_alloc_string(32);
}
Store_field(array, r, tmp);
}
for (r = 0; r < 4; r++)
out_config[r] = (c_config[r]) ? String_val(Field(Field(array, r), 0)) : NULL;
r = xc_cpuid_set(_H(xch), _D(domid),
c_input, (const char **)c_config, out_config);
if (r < 0)
failwith_xc(_H(xch));
#else
caml_failwith("xc_domain_cpuid_set: not implemented");
#endif
CAMLreturn(array);
}
CAMLprim value stub_xc_domain_cpuid_apply_policy(value xch, value domid)
{
CAMLparam2(xch, domid);
#if defined(__i386__) || defined(__x86_64__)
int r;
r = xc_cpuid_apply_policy(_H(xch), _D(domid), NULL, 0);
if (r < 0)
failwith_xc(_H(xch));
#else
caml_failwith("xc_domain_cpuid_apply_policy: not implemented");
#endif
CAMLreturn(Val_unit);
}
CAMLprim value stub_xc_version_version(value xch)
{
CAMLparam1(xch);
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.