~ubuntu-branches/ubuntu/vivid/qemu/vivid

« back to all changes in this revision

Viewing changes to hw/acpi/ich9.c

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2014-02-25 22:31:43 UTC
  • mfrom: (1.8.5)
  • Revision ID: package-import@ubuntu.com-20140225223143-odhqxfc60wxrjl15
Tags: 2.0.0~rc1+dfsg-0ubuntu1
* Merge 2.0.0-rc1
* debian/rules: consolidate ppc filter entries.
* Move qemu-system-arch64 into qemu-system-arm
* debian/patches/define-trusty-machine-type.patch: define a trusty machine
  type, currently the same as pc-i440fx-2.0, to put is in a better position
  to enable live migrations from trusty onward.  (LP: #1294823)
* debian/control: build-dep on libfdt >= 1.4.0  (LP: #1295072)
* Merge latest upstream git to commit dc9528f
* Debian/rules:
  - remove -enable-uname-release=2.6.32
  - don't make the aarch64 target Ubuntu-specific.
* Remove patches which are now upstream:
  - fix-smb-security-share.patch
  - slirp-smb-redirect-port-445-too.patch 
  - linux-user-Implement-sendmmsg-syscall.patch (better version is upstream)
  - signal-added-a-wrapper-for-sigprocmask-function.patch
  - ubuntu/signal-sigsegv-protection-on-do_sigprocmask.patch
  - ubuntu/Don-t-block-SIGSEGV-at-more-places.patch
  - ubuntu/ppc-force-cpu-threads-count-to-be-power-of-2.patch
* add link for /usr/share/qemu/bios-256k.bin
* Remove all linaro patches.
* Remove all arm64/ patches.  Many but not all are upstream.
* Remove CVE-2013-4377.patch which is upstream.
* debian/control-in: don't make qemu-system-aarch64 ubuntu-specific

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
#define ICH9_DEBUG(fmt, ...)    do { } while (0)
45
45
#endif
46
46
 
47
 
static void pm_update_sci(ICH9LPCPMRegs *pm)
48
 
{
49
 
    int sci_level, pm1a_sts;
50
 
 
51
 
    pm1a_sts = acpi_pm1_evt_get_sts(&pm->acpi_regs);
52
 
 
53
 
    sci_level = (((pm1a_sts & pm->acpi_regs.pm1.evt.en) &
54
 
                  (ACPI_BITMASK_RT_CLOCK_ENABLE |
55
 
                   ACPI_BITMASK_POWER_BUTTON_ENABLE |
56
 
                   ACPI_BITMASK_GLOBAL_LOCK_ENABLE |
57
 
                   ACPI_BITMASK_TIMER_ENABLE)) != 0);
58
 
    qemu_set_irq(pm->irq, sci_level);
59
 
 
60
 
    /* schedule a timer interruption if needed */
61
 
    acpi_pm_tmr_update(&pm->acpi_regs,
62
 
                       (pm->acpi_regs.pm1.evt.en & ACPI_BITMASK_TIMER_ENABLE) &&
63
 
                       !(pm1a_sts & ACPI_BITMASK_TIMER_STATUS));
64
 
}
65
 
 
66
47
static void ich9_pm_update_sci_fn(ACPIREGS *regs)
67
48
{
68
49
    ICH9LPCPMRegs *pm = container_of(regs, ICH9LPCPMRegs, acpi_regs);
69
 
    pm_update_sci(pm);
 
50
    acpi_update_sci(&pm->acpi_regs, pm->irq);
70
51
}
71
52
 
72
53
static uint64_t ich9_gpe_readb(void *opaque, hwaddr addr, unsigned width)
80
61
{
81
62
    ICH9LPCPMRegs *pm = opaque;
82
63
    acpi_gpe_ioport_writeb(&pm->acpi_regs, addr, val);
 
64
    acpi_update_sci(&pm->acpi_regs, pm->irq);
83
65
}
84
66
 
85
67
static const MemoryRegionOps ich9_gpe_ops = {
193
175
        pm->smi_en |= ICH9_PMIO_SMI_EN_APMC_EN;
194
176
    }
195
177
 
196
 
    pm_update_sci(pm);
 
178
    acpi_update_sci(&pm->acpi_regs, pm->irq);
197
179
}
198
180
 
199
181
static void pm_powerdown_req(Notifier *n, void *opaque)
203
185
    acpi_pm1_evt_power_down(&pm->acpi_regs);
204
186
}
205
187
 
 
188
static void ich9_cpu_added_req(Notifier *n, void *opaque)
 
189
{
 
190
    ICH9LPCPMRegs *pm = container_of(n, ICH9LPCPMRegs, cpu_added_notifier);
 
191
 
 
192
    assert(pm != NULL);
 
193
    AcpiCpuHotplug_add(&pm->acpi_regs.gpe, &pm->gpe_cpu, CPU(opaque));
 
194
    acpi_update_sci(&pm->acpi_regs, pm->irq);
 
195
}
 
196
 
206
197
void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm,
207
198
                  qemu_irq sci_irq)
208
199
{
228
219
    qemu_register_reset(pm_reset, pm);
229
220
    pm->powerdown_notifier.notify = pm_powerdown_req;
230
221
    qemu_register_powerdown_notifier(&pm->powerdown_notifier);
 
222
 
 
223
    AcpiCpuHotplug_init(pci_address_space_io(lpc_pci), OBJECT(lpc_pci),
 
224
                        &pm->gpe_cpu, ICH9_CPU_HOTPLUG_IO_BASE);
 
225
    pm->cpu_added_notifier.notify = ich9_cpu_added_req;
 
226
    qemu_register_cpu_added_notifier(&pm->cpu_added_notifier);
231
227
}
232
228
 
233
229
static void ich9_pm_get_gpe0_blk(Object *obj, Visitor *v,