leon3: Store SPARCCPU in ResetData
Allows us to use cpu_reset() in place of cpu_state_reset() in main_cpu_reset(). Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
parent
60ad073356
commit
c537d79cc5
@ -42,16 +42,16 @@
|
|||||||
#define MAX_PILS 16
|
#define MAX_PILS 16
|
||||||
|
|
||||||
typedef struct ResetData {
|
typedef struct ResetData {
|
||||||
CPUSPARCState *env;
|
SPARCCPU *cpu;
|
||||||
uint32_t entry; /* save kernel entry in case of reset */
|
uint32_t entry; /* save kernel entry in case of reset */
|
||||||
} ResetData;
|
} ResetData;
|
||||||
|
|
||||||
static void main_cpu_reset(void *opaque)
|
static void main_cpu_reset(void *opaque)
|
||||||
{
|
{
|
||||||
ResetData *s = (ResetData *)opaque;
|
ResetData *s = (ResetData *)opaque;
|
||||||
CPUSPARCState *env = s->env;
|
CPUSPARCState *env = &s->cpu->env;
|
||||||
|
|
||||||
cpu_state_reset(env);
|
cpu_reset(CPU(s->cpu));
|
||||||
|
|
||||||
env->halted = 0;
|
env->halted = 0;
|
||||||
env->pc = s->entry;
|
env->pc = s->entry;
|
||||||
@ -129,7 +129,7 @@ static void leon3_generic_hw_init(ram_addr_t ram_size,
|
|||||||
|
|
||||||
/* Reset data */
|
/* Reset data */
|
||||||
reset_info = g_malloc0(sizeof(ResetData));
|
reset_info = g_malloc0(sizeof(ResetData));
|
||||||
reset_info->env = env;
|
reset_info->cpu = cpu;
|
||||||
qemu_register_reset(main_cpu_reset, reset_info);
|
qemu_register_reset(main_cpu_reset, reset_info);
|
||||||
|
|
||||||
/* Allocate IRQ manager */
|
/* Allocate IRQ manager */
|
||||||
|
Loading…
Reference in New Issue
Block a user