Re: [Qemu-devel] [PATCH 01/15] Openrisc: add target stub

2012-05-20 Thread Jia Liu
Hi Blue, On Sat, May 19, 2012 at 4:51 PM, Blue Swirl wrote: > On Thu, May 17, 2012 at 8:35 AM, Jia Liu wrote: >> add the openrisc target stub and basic implementation. >> >> Signed-off-by: Jia Liu >> --- >>  Makefile.target                  |    3 + >>  arch_init.c                      |    2 +

Re: [Qemu-devel] [PATCH 01/15] Openrisc: add target stub

2012-05-20 Thread Jia Liu
Hi Andreas, Thanks, I'm trying fix them all. On Thu, May 17, 2012 at 10:14 PM, Andreas Färber wrote: > Am 17.05.2012 10:35, schrieb Jia Liu: >> add the openrisc target stub and basic implementation. >> >> Signed-off-by: Jia Liu >> --- >> diff --git a/target-openrisc/cpu-qom.h b/target-openrisc/

Re: [Qemu-devel] [PATCH 01/15] Openrisc: add target stub

2012-05-20 Thread Andreas Färber
Am 18.05.2012 04:56, schrieb 陳韋任: >>> This is a mix of two ways of doing the same thing. You should only use >>> VMState for new code. >>> >> >> did you mean I should not use QEMUFile? > > I guess what Andreas means is there are two ways to do cpu_save/cpu_load, > the one you wrote is the old st

Re: [Qemu-devel] [PATCH 01/15] Openrisc: add target stub

2012-05-20 Thread Andreas Färber
Am 19.05.2012 10:51, schrieb Blue Swirl: > On Thu, May 17, 2012 at 8:35 AM, Jia Liu wrote: >> + >> +typedef struct CPUOPENRISCState CPUOPENRISCState; >> +struct CPUOPENRISCState { >> +target_ulong gpr[32]; /* General registers */ >> +uint32_t sr;/* Supervisor register */ >> +

Re: [Qemu-devel] [PATCH 01/15] Openrisc: add target stub

2012-05-19 Thread Blue Swirl
On Thu, May 17, 2012 at 8:35 AM, Jia Liu wrote: > add the openrisc target stub and basic implementation. > > Signed-off-by: Jia Liu > --- >  Makefile.target                  |    3 + >  arch_init.c                      |    2 + >  arch_init.h                      |    1 + >  configure            

Re: [Qemu-devel] [PATCH 01/15] Openrisc: add target stub

2012-05-17 Thread 陳韋任
> > This is a mix of two ways of doing the same thing. You should only use > > VMState for new code. > > > > did you mean I should not use QEMUFile? I guess what Andreas means is there are two ways to do cpu_save/cpu_load, the one you wrote is the old style. For the brand new target, you should

Re: [Qemu-devel] [PATCH 01/15] Openrisc: add target stub

2012-05-17 Thread 陳韋任
> > Pleave avoid unnecessary uppercase spelling: OpenRISCCPUClass? That > > distinguishes it from the all-uppercase cast macros. > > > > Or OpenriscCPUClass as you spell it elsewhere? > > > > I used OPENRISCCPU in the code, if it is not good, I can change it > into OpenriscCPU. I think OpenRISC

Re: [Qemu-devel] [PATCH 01/15] Openrisc: add target stub

2012-05-17 Thread Jia Liu
Hi Andreas, Thanks for your comment. On Thu, May 17, 2012 at 10:14 PM, Andreas Färber wrote: > Am 17.05.2012 10:35, schrieb Jia Liu: >> add the openrisc target stub and basic implementation. >> >> Signed-off-by: Jia Liu >> --- >> diff --git a/target-openrisc/cpu-qom.h b/target-openrisc/cpu-qom.

Re: [Qemu-devel] [PATCH 01/15] Openrisc: add target stub

2012-05-17 Thread Andreas Färber
Am 17.05.2012 10:35, schrieb Jia Liu: > add the openrisc target stub and basic implementation. > > Signed-off-by: Jia Liu > --- > diff --git a/target-openrisc/cpu-qom.h b/target-openrisc/cpu-qom.h > new file mode 100644 > index 000..8c936df > --- /dev/null > +++ b/target-openrisc/cpu-qom.h F

[Qemu-devel] [PATCH 01/15] Openrisc: add target stub

2012-05-17 Thread Jia Liu
add the openrisc target stub and basic implementation. Signed-off-by: Jia Liu --- Makefile.target |3 + arch_init.c |2 + arch_init.h |1 + configure|8 +- cpu-exec.c |2 +

Re: [Qemu-devel] [PATCH 01/15] Openrisc: add target stub

2012-05-17 Thread 陳韋任
> +CPUOPENRISCState *cpu_openrisc_init(const char *cpu_model) > +{ > +CPUOPENRISCState *env; > +static int tcg_inited; > + > +env = g_malloc0(sizeof(*env)); > +memset(env, 0, sizeof(*env)); ^^ No need to memset env to zero, since g_malloc0 already did it for you. > dif