aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64/vmm/vmm.c
diff options
context:
space:
mode:
authorTycho Nightingale <tychon@FreeBSD.org>2014-03-11 16:56:00 +0000
committerTycho Nightingale <tychon@FreeBSD.org>2014-03-11 16:56:00 +0000
commit762fd2080408a6bb2d0ea29cc427c7390da8e21b (patch)
tree88da83839b43667193b4f76775f5154fa48167aa /sys/amd64/vmm/vmm.c
parentb77b13a20e5116db0837160978467f7e56f02e9c (diff)
downloadsrc-762fd2080408a6bb2d0ea29cc427c7390da8e21b.tar.gz
src-762fd2080408a6bb2d0ea29cc427c7390da8e21b.zip
Replace the userspace atpic stub with a more functional vmm.ko model.
New ioctls VM_ISA_ASSERT_IRQ, VM_ISA_DEASSERT_IRQ and VM_ISA_PULSE_IRQ can be used to manipulate the pic, and optionally the ioapic, pin state. Reviewed by: jhb, neel Approved by: neel (co-mentor)
Notes
Notes: svn path=/head/; revision=263035
Diffstat (limited to 'sys/amd64/vmm/vmm.c')
-rw-r--r--sys/amd64/vmm/vmm.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c
index 241eb6c9e7d7..e34d8e21735d 100644
--- a/sys/amd64/vmm/vmm.c
+++ b/sys/amd64/vmm/vmm.c
@@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$");
#include "vmm_host.h"
#include "vmm_mem.h"
#include "vmm_util.h"
+#include "vatpic.h"
#include "vhpet.h"
#include "vioapic.h"
#include "vlapic.h"
@@ -116,6 +117,7 @@ struct vm {
void *iommu; /* iommu-specific data */
struct vhpet *vhpet; /* virtual HPET */
struct vioapic *vioapic; /* virtual ioapic */
+ struct vatpic *vatpic; /* virtual atpic */
struct vmspace *vmspace; /* guest's address space */
struct vcpu vcpu[VM_MAXCPU];
int num_mem_segs;
@@ -345,6 +347,7 @@ vm_create(const char *name, struct vm **retvm)
vm->cookie = VMINIT(vm, vmspace_pmap(vmspace));
vm->vioapic = vioapic_init(vm);
vm->vhpet = vhpet_init(vm);
+ vm->vatpic = vatpic_init(vm);
for (i = 0; i < VM_MAXCPU; i++) {
vcpu_init(vm, i);
@@ -378,6 +381,7 @@ vm_destroy(struct vm *vm)
iommu_destroy_domain(vm->iommu);
vhpet_cleanup(vm->vhpet);
+ vatpic_cleanup(vm->vatpic);
vioapic_cleanup(vm->vioapic);
for (i = 0; i < vm->num_mem_segs; i++)
@@ -1637,3 +1641,9 @@ restart:
vm_handle_rendezvous(vm, vcpuid);
}
+
+struct vatpic *
+vm_atpic(struct vm *vm)
+{
+ return (vm->vatpic);
+}