mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43:55 -06:00
hw/avr/atmega: Fix wrong initial value of stack pointer
The current implementation initializes the stack pointer of AVR devices to 0. Although older AVR devices used to be like that, newer ones set it to RAMEND. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1525 Signed-off-by: Gihun Nam <gihun.nam@outlook.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <PH0P222MB0010877445B594724D40C924DEBDA@PH0P222MB0010.NAMP222.PROD.OUTLOOK.COM> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
parent
0ed083a1bc
commit
235948bf53
3 changed files with 16 additions and 1 deletions
|
@ -233,6 +233,10 @@ static void atmega_realize(DeviceState *dev, Error **errp)
|
|||
|
||||
/* CPU */
|
||||
object_initialize_child(OBJECT(dev), "cpu", &s->cpu, mc->cpu_type);
|
||||
|
||||
object_property_set_uint(OBJECT(&s->cpu), "init-sp",
|
||||
mc->io_size + mc->sram_size - 1, &error_abort);
|
||||
|
||||
qdev_realize(DEVICE(&s->cpu), NULL, &error_abort);
|
||||
cpudev = DEVICE(&s->cpu);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue