xref: /freebsd/usr.sbin/bhyvectl/aarch64/bhyvectl_machdep.c (revision c1b37d909e59829ec1234fb9dbdcc8e545b37585)
1*c1b37d90SMark Johnston /*-
2*c1b37d90SMark Johnston  * SPDX-License-Identifier: BSD-2-Clause
3*c1b37d90SMark Johnston  *
4*c1b37d90SMark Johnston  * Copyright (c) 2024 Mark Johnston <markj@FreeBSD.org>
5*c1b37d90SMark Johnston  *
6*c1b37d90SMark Johnston  * This software was developed by the University of Cambridge Computer
7*c1b37d90SMark Johnston  * Laboratory (Department of Computer Science and Technology) under Innovate
8*c1b37d90SMark Johnston  * UK project 105694, "Digital Security by Design (DSbD) Technology Platform
9*c1b37d90SMark Johnston  * Prototype".
10*c1b37d90SMark Johnston  *
11*c1b37d90SMark Johnston  * Redistribution and use in source and binary forms, with or without
12*c1b37d90SMark Johnston  * modification, are permitted provided that the following conditions
13*c1b37d90SMark Johnston  * are met:
14*c1b37d90SMark Johnston  * 1. Redistributions of source code must retain the above copyright
15*c1b37d90SMark Johnston  *    notice, this list of conditions and the following disclaimer.
16*c1b37d90SMark Johnston  * 2. Redistributions in binary form must reproduce the above copyright
17*c1b37d90SMark Johnston  *    notice, this list of conditions and the following disclaimer in the
18*c1b37d90SMark Johnston  *    documentation and/or other materials provided with the distribution.
19*c1b37d90SMark Johnston  *
20*c1b37d90SMark Johnston  * THIS SOFTWARE IS PROVIDED BY NETAPP, INC ``AS IS'' AND
21*c1b37d90SMark Johnston  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22*c1b37d90SMark Johnston  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23*c1b37d90SMark Johnston  * ARE DISCLAIMED.  IN NO EVENT SHALL NETAPP, INC OR CONTRIBUTORS BE LIABLE
24*c1b37d90SMark Johnston  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25*c1b37d90SMark Johnston  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26*c1b37d90SMark Johnston  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27*c1b37d90SMark Johnston  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28*c1b37d90SMark Johnston  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29*c1b37d90SMark Johnston  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30*c1b37d90SMark Johnston  * SUCH DAMAGE.
31*c1b37d90SMark Johnston  */
32*c1b37d90SMark Johnston 
33*c1b37d90SMark Johnston #include <sys/types.h>
34*c1b37d90SMark Johnston 
35*c1b37d90SMark Johnston #include <err.h>
36*c1b37d90SMark Johnston #include <fcntl.h>
37*c1b37d90SMark Johnston #include <getopt.h>
38*c1b37d90SMark Johnston #include <stdbool.h>
39*c1b37d90SMark Johnston #include <stdio.h>
40*c1b37d90SMark Johnston #include <stdlib.h>
41*c1b37d90SMark Johnston #include <string.h>
42*c1b37d90SMark Johnston #include <unistd.h>
43*c1b37d90SMark Johnston 
44*c1b37d90SMark Johnston #include <vmmapi.h>
45*c1b37d90SMark Johnston 
46*c1b37d90SMark Johnston #include "bhyvectl.h"
47*c1b37d90SMark Johnston 
48*c1b37d90SMark Johnston void
49*c1b37d90SMark Johnston bhyvectl_dump_vm_run_exitcode(struct vm_exit *vmexit __unused,
50*c1b37d90SMark Johnston     int vcpu __unused)
51*c1b37d90SMark Johnston {
52*c1b37d90SMark Johnston }
53*c1b37d90SMark Johnston 
54*c1b37d90SMark Johnston struct option *
55*c1b37d90SMark Johnston bhyvectl_opts(const struct option *options, size_t count)
56*c1b37d90SMark Johnston {
57*c1b37d90SMark Johnston 	struct option *all_opts;
58*c1b37d90SMark Johnston 
59*c1b37d90SMark Johnston 	all_opts = calloc(count + 1, sizeof(struct option));
60*c1b37d90SMark Johnston 	if (all_opts == NULL)
61*c1b37d90SMark Johnston 		err(1, "calloc");
62*c1b37d90SMark Johnston 	memcpy(all_opts, options, count * sizeof(struct option));
63*c1b37d90SMark Johnston 	return (all_opts);
64*c1b37d90SMark Johnston }
65*c1b37d90SMark Johnston 
66*c1b37d90SMark Johnston void
67*c1b37d90SMark Johnston bhyvectl_handle_opt(const struct option *opts __unused, int opt __unused)
68*c1b37d90SMark Johnston {
69*c1b37d90SMark Johnston }
70*c1b37d90SMark Johnston 
71*c1b37d90SMark Johnston const char *
72*c1b37d90SMark Johnston bhyvectl_opt_desc(int opt __unused)
73*c1b37d90SMark Johnston {
74*c1b37d90SMark Johnston 	/* No arm64-specific options yet. */
75*c1b37d90SMark Johnston 	return ("???");
76*c1b37d90SMark Johnston }
77*c1b37d90SMark Johnston 
78*c1b37d90SMark Johnston void
79*c1b37d90SMark Johnston bhyvectl_md_main(struct vmctx *ctx __unused, struct vcpu *vcpu __unused,
80*c1b37d90SMark Johnston     int vcpuid __unused, bool get_all __unused)
81*c1b37d90SMark Johnston {
82*c1b37d90SMark Johnston }
83