diff mbox

[v2,20/22] target-microblaze: Add address-space property

Message ID 1387432293-17711-21-git-send-email-edgar.iglesias@gmail.com
State New
Headers show

Commit Message

Edgar E. Iglesias Dec. 19, 2013, 5:51 a.m. UTC
From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
---
 target-microblaze/cpu.c |    6 ++++++
 1 file changed, 6 insertions(+)

Comments

Peter Crosthwaite Dec. 19, 2013, 6:22 a.m. UTC | #1
On Thu, Dec 19, 2013 at 3:51 PM,  <edgar.iglesias@gmail.com> wrote:
> From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
>
> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
> ---
>  target-microblaze/cpu.c |    6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/target-microblaze/cpu.c b/target-microblaze/cpu.c
> index 0ef9aa4..6d39d3d 100644
> --- a/target-microblaze/cpu.c
> +++ b/target-microblaze/cpu.c
> @@ -93,6 +93,9 @@ static void mb_cpu_realizefn(DeviceState *dev, Error **errp)
>      CPUState *cs = CPU(dev);
>      MicroBlazeCPUClass *mcc = MICROBLAZE_CPU_GET_CLASS(dev);
>
> +#ifndef CONFIG_USER_ONLY
> +    cpu_address_space_init(cs, cs->as);
> +#endif
>      cpu_reset(cs);
>      qemu_init_vcpu(cs);
>
> @@ -123,6 +126,9 @@ static const VMStateDescription vmstate_mb_cpu = {
>  };
>
>  static Property mb_properties[] = {
> +#ifndef CONFIG_USER_ONLY
> +    DEFINE_PROP_ADDRESS_SPACE("address-space", CPUState, as),
> +#endif

Why not add it as a property on the base CPU level?

Regards,
Peter

>      DEFINE_PROP_UINT32("xlnx.base-vectors", MicroBlazeCPU, base_vectors, 0),
>      DEFINE_PROP_END_OF_LIST(),
>  };
> --
> 1.7.10.4
>
>
Edgar E. Iglesias Dec. 19, 2013, 7:05 a.m. UTC | #2
On Thu, Dec 19, 2013 at 04:22:47PM +1000, Peter Crosthwaite wrote:
> On Thu, Dec 19, 2013 at 3:51 PM,  <edgar.iglesias@gmail.com> wrote:
> > From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
> >
> > Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
> > ---
> >  target-microblaze/cpu.c |    6 ++++++
> >  1 file changed, 6 insertions(+)
> >
> > diff --git a/target-microblaze/cpu.c b/target-microblaze/cpu.c
> > index 0ef9aa4..6d39d3d 100644
> > --- a/target-microblaze/cpu.c
> > +++ b/target-microblaze/cpu.c
> > @@ -93,6 +93,9 @@ static void mb_cpu_realizefn(DeviceState *dev, Error **errp)
> >      CPUState *cs = CPU(dev);
> >      MicroBlazeCPUClass *mcc = MICROBLAZE_CPU_GET_CLASS(dev);
> >
> > +#ifndef CONFIG_USER_ONLY
> > +    cpu_address_space_init(cs, cs->as);
> > +#endif
> >      cpu_reset(cs);
> >      qemu_init_vcpu(cs);
> >
> > @@ -123,6 +126,9 @@ static const VMStateDescription vmstate_mb_cpu = {
> >  };
> >
> >  static Property mb_properties[] = {
> > +#ifndef CONFIG_USER_ONLY
> > +    DEFINE_PROP_ADDRESS_SPACE("address-space", CPUState, as),
> > +#endif
> 
> Why not add it as a property on the base CPU level?
> 

Hi,

Yes, I can have a look at doing that. It will probably involve having some
kind of implementation of the AS prop for user emulation as qom/cpu.o is
supposed to be common for both. Andreas, do you have any preferences on how
this should be done?

Thanks,
Edgar
diff mbox

Patch

diff --git a/target-microblaze/cpu.c b/target-microblaze/cpu.c
index 0ef9aa4..6d39d3d 100644
--- a/target-microblaze/cpu.c
+++ b/target-microblaze/cpu.c
@@ -93,6 +93,9 @@  static void mb_cpu_realizefn(DeviceState *dev, Error **errp)
     CPUState *cs = CPU(dev);
     MicroBlazeCPUClass *mcc = MICROBLAZE_CPU_GET_CLASS(dev);
 
+#ifndef CONFIG_USER_ONLY
+    cpu_address_space_init(cs, cs->as);
+#endif
     cpu_reset(cs);
     qemu_init_vcpu(cs);
 
@@ -123,6 +126,9 @@  static const VMStateDescription vmstate_mb_cpu = {
 };
 
 static Property mb_properties[] = {
+#ifndef CONFIG_USER_ONLY
+    DEFINE_PROP_ADDRESS_SPACE("address-space", CPUState, as),
+#endif
     DEFINE_PROP_UINT32("xlnx.base-vectors", MicroBlazeCPU, base_vectors, 0),
     DEFINE_PROP_END_OF_LIST(),
 };