~ubuntu-branches/ubuntu/trusty/qemu/trusty

« back to all changes in this revision

Viewing changes to hw/i386/kvm/i8259.c

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2013-10-22 22:47:07 UTC
  • mfrom: (1.8.3) (10.1.42 sid)
  • Revision ID: package-import@ubuntu.com-20131022224707-1lya34fw3k3f24tv
Tags: 1.6.0+dfsg-2ubuntu1
* Merge 1.6.0~rc0+dfsg-2exp from debian experimental.  Remaining changes:
  - debian/control
    * update maintainer
    * remove libiscsi, usb-redir, vde, vnc-jpeg, and libssh2-1-dev
      from build-deps
    * enable rbd
    * add qemu-system and qemu-common B/R to qemu-keymaps
    * add D:udev, R:qemu, R:qemu-common and B:qemu-common to
      qemu-system-common
    * qemu-system-arm, qemu-system-ppc, qemu-system-sparc:
      - add qemu-kvm to Provides
      - add qemu-common, qemu-kvm, kvm to B/R
      - remove openbios-sparc from qemu-system-sparc D
      - drop openbios-ppc and openhackware Depends to Suggests (for now)
    * qemu-system-x86:
      - add qemu-common to Breaks/Replaces.
      - add cpu-checker to Recommends.
    * qemu-user: add B/R:qemu-kvm
    * qemu-kvm:
      - add armhf armel powerpc sparc to Architecture
      - C/R/P: qemu-kvm-spice
    * add qemu-common package
    * drop qemu-slof which is not packaged in ubuntu
  - add qemu-system-common.links for tap ifup/down scripts and OVMF link.
  - qemu-system-x86.links:
    * remove pxe rom links which are in kvm-ipxe
    * add symlink for kvm.1 manpage
  - debian/rules
    * add kvm-spice symlink to qemu-kvm
    * call dh_installmodules for qemu-system-x86
    * update dh_installinit to install upstart script
    * run dh_installman (Closes: #709241) (cherrypicked from 1.5.0+dfsg-2)
  - Add qemu-utils.links for kvm-* symlinks.
  - Add qemu-system-x86.qemu-kvm.upstart and .default
  - Add qemu-system-x86.modprobe to set nesting=1
  - Add qemu-system-common.preinst to add kvm group
  - qemu-system-common.postinst: remove bad group acl if there, then have
    udev relabel /dev/kvm.
  - New linaro patches from qemu-linaro rebasing branch
  - Dropped patches:
    * xen-simplify-xen_enabled.patch
    * sparc-linux-user-fix-missing-symbols-in-.rel-.rela.plt-sections.patch
    * main_loop-do-not-set-nonblocking-if-xen_enabled.patch
    * xen_machine_pv-do-not-create-a-dummy-CPU-in-machine-.patch
    * virtio-rng-fix-crash
  - Kept patches:
    * expose_vms_qemu64cpu.patch - updated
    * linaro arm patches from qemu-linaro rebasing branch
  - New patches:
    * fix-pci-add: change CONFIG variable in ifdef to make sure that
      pci_add is defined.
* Add linaro patches
* Add experimental mach-virt patches for arm virtualization.
* qemu-system-common.install: add debian/tmp/usr/lib to install the
  qemu-bridge-helper

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
#include "hw/i386/apic_internal.h"
14
14
#include "sysemu/kvm.h"
15
15
 
 
16
#define TYPE_KVM_I8259 "kvm-i8259"
 
17
#define KVM_PIC_CLASS(class) \
 
18
    OBJECT_CLASS_CHECK(KVMPICClass, (class), TYPE_KVM_I8259)
 
19
#define KVM_PIC_GET_CLASS(obj) \
 
20
    OBJECT_GET_CLASS(KVMPICClass, (obj), TYPE_KVM_I8259)
 
21
 
 
22
/**
 
23
 * KVMPICClass:
 
24
 * @parent_realize: The parent's realizefn.
 
25
 */
 
26
typedef struct KVMPICClass {
 
27
    PICCommonClass parent_class;
 
28
 
 
29
    DeviceRealize parent_realize;
 
30
} KVMPICClass;
 
31
 
16
32
static void kvm_pic_get(PICCommonState *s)
17
33
{
18
34
    struct kvm_irqchip chip;
98
114
    apic_report_irq_delivered(delivered);
99
115
}
100
116
 
101
 
static void kvm_pic_init(PICCommonState *s)
 
117
static void kvm_pic_realize(DeviceState *dev, Error **errp)
102
118
{
103
 
    memory_region_init_reservation(&s->base_io, "kvm-pic", 2);
104
 
    memory_region_init_reservation(&s->elcr_io, "kvm-elcr", 1);
 
119
    PICCommonState *s = PIC_COMMON(dev);
 
120
    KVMPICClass *kpc = KVM_PIC_GET_CLASS(dev);
 
121
 
 
122
    memory_region_init_reservation(&s->base_io, NULL, "kvm-pic", 2);
 
123
    memory_region_init_reservation(&s->elcr_io, NULL, "kvm-elcr", 1);
 
124
 
 
125
    kpc->parent_realize(dev, errp);
105
126
}
106
127
 
107
128
qemu_irq *kvm_i8259_init(ISABus *bus)
108
129
{
109
 
    i8259_init_chip("kvm-i8259", bus, true);
110
 
    i8259_init_chip("kvm-i8259", bus, false);
 
130
    i8259_init_chip(TYPE_KVM_I8259, bus, true);
 
131
    i8259_init_chip(TYPE_KVM_I8259, bus, false);
111
132
 
112
133
    return qemu_allocate_irqs(kvm_pic_set_irq, NULL, ISA_NUM_IRQS);
113
134
}
114
135
 
115
136
static void kvm_i8259_class_init(ObjectClass *klass, void *data)
116
137
{
 
138
    KVMPICClass *kpc = KVM_PIC_CLASS(klass);
117
139
    PICCommonClass *k = PIC_COMMON_CLASS(klass);
118
140
    DeviceClass *dc = DEVICE_CLASS(klass);
119
141
 
120
142
    dc->reset     = kvm_pic_reset;
121
 
    k->init       = kvm_pic_init;
 
143
    kpc->parent_realize = dc->realize;
 
144
    dc->realize   = kvm_pic_realize;
122
145
    k->pre_save   = kvm_pic_get;
123
146
    k->post_load  = kvm_pic_put;
124
147
}
125
148
 
126
149
static const TypeInfo kvm_i8259_info = {
127
 
    .name  = "kvm-i8259",
 
150
    .name = TYPE_KVM_I8259,
128
151
    .parent = TYPE_PIC_COMMON,
129
152
    .instance_size = sizeof(PICCommonState),
130
153
    .class_init = kvm_i8259_class_init,
 
154
    .class_size = sizeof(KVMPICClass),
131
155
};
132
156
 
133
157
static void kvm_pic_register_types(void)