mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13:55 -06:00
serial: Add MemoryRegion parameter to serial_mm_init
Remove the get_system_memory() call from serial_mm_init, pushing it back into the callers. In many cases we already have the system memory region available. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:
parent
2ff0c7c3c2
commit
39186d8ab8
14 changed files with 63 additions and 43 deletions
10
hw/serial.c
10
hw/serial.c
|
@ -28,7 +28,6 @@
|
|||
#include "pc.h"
|
||||
#include "qemu-timer.h"
|
||||
#include "sysemu.h"
|
||||
#include "exec-memory.h"
|
||||
|
||||
//#define DEBUG_SERIAL
|
||||
|
||||
|
@ -855,9 +854,10 @@ static const MemoryRegionOps serial_mm_ops[3] = {
|
|||
},
|
||||
};
|
||||
|
||||
SerialState *serial_mm_init (target_phys_addr_t base, int it_shift,
|
||||
qemu_irq irq, int baudbase,
|
||||
CharDriverState *chr, enum device_endian end)
|
||||
SerialState *serial_mm_init(MemoryRegion *address_space,
|
||||
target_phys_addr_t base, int it_shift,
|
||||
qemu_irq irq, int baudbase,
|
||||
CharDriverState *chr, enum device_endian end)
|
||||
{
|
||||
SerialState *s;
|
||||
|
||||
|
@ -873,7 +873,7 @@ SerialState *serial_mm_init (target_phys_addr_t base, int it_shift,
|
|||
|
||||
memory_region_init_io(&s->io, &serial_mm_ops[end], s,
|
||||
"serial", 8 << it_shift);
|
||||
memory_region_add_subregion(get_system_memory(), base, &s->io);
|
||||
memory_region_add_subregion(address_space, base, &s->io);
|
||||
|
||||
serial_update_msl(s);
|
||||
return s;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue