mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
memory: introduce memory_region_present
This new API will avoid having too many memory_region_ref/unref in paths that currently use memory_region_find. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
46637be269
commit
3ce10901ca
4 changed files with 28 additions and 7 deletions
|
@ -481,19 +481,19 @@ static void ich9_lpc_machine_ready(Notifier *n, void *opaque)
|
|||
uint8_t *pci_conf;
|
||||
|
||||
pci_conf = s->d.config;
|
||||
if (memory_region_find(io_as, 0x3f8, 1).mr) {
|
||||
if (memory_region_present(io_as, 0x3f8)) {
|
||||
/* com1 */
|
||||
pci_conf[0x82] |= 0x01;
|
||||
}
|
||||
if (memory_region_find(io_as, 0x2f8, 1).mr) {
|
||||
if (memory_region_present(io_as, 0x2f8)) {
|
||||
/* com2 */
|
||||
pci_conf[0x82] |= 0x02;
|
||||
}
|
||||
if (memory_region_find(io_as, 0x378, 1).mr) {
|
||||
if (memory_region_present(io_as, 0x378)) {
|
||||
/* lpt */
|
||||
pci_conf[0x82] |= 0x04;
|
||||
}
|
||||
if (memory_region_find(io_as, 0x3f0, 1).mr) {
|
||||
if (memory_region_present(io_as, 0x3f0)) {
|
||||
/* floppy */
|
||||
pci_conf[0x82] |= 0x08;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue