apm.c (2c9b15cab12c21e32dffb67c5e18f3dc407ca224) | apm.c (1437c94b2689c2010362f84d14f14feaa1d8dba3) |
---|---|
1/* 2 * QEMU PC APM controller Emulation 3 * This is split out from acpi.c 4 * 5 * Copyright (c) 2006 Fabrice Bellard 6 * 7 * This library is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU Lesser General Public --- 82 unchanged lines hidden (view full) --- 91 92void apm_init(PCIDevice *dev, APMState *apm, apm_ctrl_changed_t callback, 93 void *arg) 94{ 95 apm->callback = callback; 96 apm->arg = arg; 97 98 /* ioport 0xb2, 0xb3 */ | 1/* 2 * QEMU PC APM controller Emulation 3 * This is split out from acpi.c 4 * 5 * Copyright (c) 2006 Fabrice Bellard 6 * 7 * This library is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU Lesser General Public --- 82 unchanged lines hidden (view full) --- 91 92void apm_init(PCIDevice *dev, APMState *apm, apm_ctrl_changed_t callback, 93 void *arg) 94{ 95 apm->callback = callback; 96 apm->arg = arg; 97 98 /* ioport 0xb2, 0xb3 */ |
99 memory_region_init_io(&apm->io, NULL, &apm_ops, apm, "apm-io", 2); | 99 memory_region_init_io(&apm->io, OBJECT(dev), &apm_ops, apm, "apm-io", 2); |
100 memory_region_add_subregion(pci_address_space_io(dev), APM_CNT_IOPORT, 101 &apm->io); 102} | 100 memory_region_add_subregion(pci_address_space_io(dev), APM_CNT_IOPORT, 101 &apm->io); 102} |