X-Git-Url: https://repo.jachan.dev/qemu.git/blobdiff_plain/818c2e1b9777599d333855330d94050b3432c8b7..93f43c48887a4e5b651965955eedd8e838e53db3:/hw/omap_uart.c diff --git a/hw/omap_uart.c b/hw/omap_uart.c index 9cee81d7c9..19f8e6eec9 100644 --- a/hw/omap_uart.c +++ b/hw/omap_uart.c @@ -22,6 +22,7 @@ #include "omap.h" /* We use pc-style serial ports. */ #include "pc.h" +#include "exec-memory.h" /* UARTs */ struct omap_uart_s { @@ -55,20 +56,15 @@ struct omap_uart_s *omap_uart_init(target_phys_addr_t base, const char *label, CharDriverState *chr) { struct omap_uart_s *s = (struct omap_uart_s *) - qemu_mallocz(sizeof(struct omap_uart_s)); + g_malloc0(sizeof(struct omap_uart_s)); s->base = base; s->fclk = fclk; s->irq = irq; -#ifdef TARGET_WORDS_BIGENDIAN - s->serial = serial_mm_init(base, 2, irq, omap_clk_getrate(fclk)/16, - chr ?: qemu_chr_open(label, "null", NULL), 1, - 1); -#else - s->serial = serial_mm_init(base, 2, irq, omap_clk_getrate(fclk)/16, - chr ?: qemu_chr_open(label, "null", NULL), 1, - 0); -#endif + s->serial = serial_mm_init(get_system_memory(), base, 2, irq, + omap_clk_getrate(fclk)/16, + chr ?: qemu_chr_new(label, "null", NULL), + DEVICE_NATIVE_ENDIAN); return s; } @@ -182,15 +178,8 @@ struct omap_uart_s *omap2_uart_init(struct omap_target_agent_s *ta, void omap_uart_attach(struct omap_uart_s *s, CharDriverState *chr) { /* TODO: Should reuse or destroy current s->serial */ -#ifdef TARGET_WORDS_BIGENDIAN - s->serial = serial_mm_init(s->base, 2, s->irq, + s->serial = serial_mm_init(get_system_memory(), s->base, 2, s->irq, omap_clk_getrate(s->fclk) / 16, - chr ?: qemu_chr_open("null", "null", NULL), 1, - 1); -#else - s->serial = serial_mm_init(s->base, 2, s->irq, - omap_clk_getrate(s->fclk) / 16, - chr ?: qemu_chr_open("null", "null", NULL), 1, - 0); -#endif + chr ?: qemu_chr_new("null", "null", NULL), + DEVICE_NATIVE_ENDIAN); }