This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: HAL_READ_XXX_VECTOR and HAL_WRITE_XXX_VECTOR ?


Fabrice Gautier <Fabrice_Gautier@sdesigns.com> writes:

> > -----Original Message-----
> > From: Nick Garnett [mailto:nickg@cygnus.co.uk]
> > Subject: Re: [ECOS] HAL_READ_XXX_VECTOR and HAL_WRITE_XXX_VECTOR ?
> > 
> > > Hi,
> > > 
> > > What are those two macros supposed to do?
> > > 
> > 
> > > Read/Write _count_ values from _register_  ?
> > 
> > > while(i<_count_) outb(_register_,_value_[i]);
> > 
> > This is the more useful definition for this since it will support
> > things like program IO on IDE.
> 
> Yes, I agree, but strangely, it seems that the ARM implementation (wich is
> exactly the same for current i386) is otherwise. And what should the _step_
> argument in those macro be used for?

I suspect that the ARM and current i386 versions are just whatever the
default implementation turned out to be. 

The idea of the _step_ argument is to account for any gaps between
registers caused by bus or addressing alignment. For example, with a
64 bit bus registers may be mapped only every 8 bytes and not
consecutively. So we would set _step_ to 8. In the i386 case, this it
probably irrelevant and should just be ignored.

What we probably really need is two versions of the vector macros, one
that steps through an array of registers and one that just
reads/writes a single register repeatedly.

-- 
Nick Garnett, eCos Kernel Architect
Red Hat, Cambridge, UK

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]