diff options
Diffstat (limited to 'hw')
-rw-r--r-- | hw/char/serial.c | 2 | ||||
-rw-r--r-- | hw/sparc/leon3.c | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/hw/char/serial.c b/hw/char/serial.c index 27dab7d..6d3b5af 100644 --- a/hw/char/serial.c +++ b/hw/char/serial.c @@ -225,7 +225,7 @@ static gboolean serial_xmit(GIOChannel *chan, GIOCondition cond, void *opaque) if (s->tsr_retry <= 0) { if (s->fcr & UART_FCR_FE) { - s->tsr = fifo8_is_full(&s->xmit_fifo) ? + s->tsr = fifo8_is_empty(&s->xmit_fifo) ? 0 : fifo8_pop(&s->xmit_fifo); if (!s->xmit_fifo.num) { s->lsr |= UART_LSR_THRE; diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c index c583c3d..c16e9e4 100644 --- a/hw/sparc/leon3.c +++ b/hw/sparc/leon3.c @@ -45,6 +45,7 @@ typedef struct ResetData { SPARCCPU *cpu; uint32_t entry; /* save kernel entry in case of reset */ + target_ulong sp; /* initial stack pointer */ } ResetData; static void main_cpu_reset(void *opaque) @@ -58,6 +59,7 @@ static void main_cpu_reset(void *opaque) cpu->halted = 0; env->pc = s->entry; env->npc = s->entry + 4; + env->regbase[6] = s->sp; } void leon3_irq_ack(void *irq_manager, int intno) @@ -133,6 +135,7 @@ static void leon3_generic_hw_init(QEMUMachineInitArgs *args) /* Reset data */ reset_info = g_malloc0(sizeof(ResetData)); reset_info->cpu = cpu; + reset_info->sp = 0x40000000 + ram_size; qemu_register_reset(main_cpu_reset, reset_info); /* Allocate IRQ manager */ |