diff options
author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2020-06-24 11:27:37 +0000 |
---|---|---|
committer | Jerry Jelinek <jerry.jelinek@joyent.com> | 2020-06-24 11:27:37 +0000 |
commit | 2a60785665a571597ad245604f125a60b3d1277e (patch) | |
tree | 92e63dcff5cd0c5509a3e60e44c9cd31427ab2ed /usr/src/lib/libvmmapi/common/vmmapi.c | |
parent | 220080cf98234dae4756754274ff9d34f5ea7668 (diff) | |
parent | 2ca761b0b92364bea5ec829f3ac6187c20057a0a (diff) | |
download | illumos-joyent-2a60785665a571597ad245604f125a60b3d1277e.tar.gz |
[illumos-gate merge]
commit 2ca761b0b92364bea5ec829f3ac6187c20057a0a
12880 sparc: pkglint errors
commit e386029b3dc09ced91c6806c9767572be25b584b
12879 sparc: unresolved dependencies
commit e156a47b6ebcf79f0515365c32a22c7ed38dc19b
12871 bhyve ioctls needn't the struct size
commit b58b977e8fdb738e19dfe72999e4f57a62e9d05f
12869 bhyve kernel/user split should be clearer
Diffstat (limited to 'usr/src/lib/libvmmapi/common/vmmapi.c')
-rw-r--r-- | usr/src/lib/libvmmapi/common/vmmapi.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/usr/src/lib/libvmmapi/common/vmmapi.c b/usr/src/lib/libvmmapi/common/vmmapi.c index b4c96d5455..9589d09ae1 100644 --- a/usr/src/lib/libvmmapi/common/vmmapi.c +++ b/usr/src/lib/libvmmapi/common/vmmapi.c @@ -70,9 +70,6 @@ __FBSDID("$FreeBSD$"); #include <machine/vmm.h> #include <machine/vmm_dev.h> -#ifndef __FreeBSD__ -#include <sys/vmm_impl.h> -#endif #include "vmmapi.h" @@ -819,6 +816,25 @@ vm_inject_exception(struct vmctx *ctx, int vcpu, int vector, int errcode_valid, return (ioctl(ctx->fd, VM_INJECT_EXCEPTION, &exc)); } +#ifndef __FreeBSD__ +void +vm_inject_fault(struct vmctx *ctx, int vcpu, int vector, int errcode_valid, + int errcode) +{ + int error; + struct vm_exception exc; + + exc.cpuid = vcpu; + exc.vector = vector; + exc.error_code = errcode; + exc.error_code_valid = errcode_valid; + exc.restart_instruction = 1; + error = ioctl(ctx->fd, VM_INJECT_EXCEPTION, &exc); + + assert(error == 0); +} +#endif /* __FreeBSD__ */ + int vm_apicid2vcpu(struct vmctx *ctx, int apicid) { |