On Monday 09 November 2009, Øyvind Harboe wrote:
> > My issue with that patch is that it should not be needed!
> >
> > If there is no mmu() method ... that's sufficient to
> > know that has_mmu() == false.  Etc.
> 
> So all CPUs that have an MMU should implement this fn?
> 
> OK.

Yes.

 
> That would be just about all targets...

Most non-microcontroller targets.


> >> What does virt2phys translation mean when no MMU
> >> is present or MMU is disabled?
> >
> > Simplest answer:  it's an identity mapping.  If there
> > is *ever* a question, treat a no-MMU target as if it's
> > an MMU-enabled target with a permanently installed
> > memory mapping equating virtual and physical addresses.
>
> Why should virt2phys not fail on CPUs with no MMU?

Because we want to avoid needing complete parallel
stacks for the MMU and no-MMU cases ... and that means
not creating needless failure modes.


> Are we sure that *all* higher level code would do the right
> thing when we treat virt2phys as an identity mapping?
>
> Clearly the answer to that question is obvious, it just
> makes me wonder...

All non-buggy code does the right thing, by definition.

As you say, obvious:  an identity mapping could be
installed into an MMU, ergo that "higher level" code must
handle it.  Q.E.D.


> Minimally we have to document that virt2phys MUST
> implement *only* a successful identity mapping when no
> MMU is supported for that target.

That function can be trivially defaulted; no need
to document it for target implementors.


_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to