I am writing a spibus driver.  One can have N number of spibusses (i.e. one
for some displays and perhaps another with IO on it).  Each spibus can have
multiple chips hanging off it.  Each spibus allocates a buffer for each
chip.

I am adding an exported function that will return a pointer to spibus[N],
buffer[Y].  How can I traverse the list of components that live in hal to
find a pointer to the first intance of the spibus,  __comp_first_inst?  My
component is called spibus.comp.  Please try to use that in any examples.

The reason I plan to traverse some list is that I would expect the function
to have no context when it gets called from another component.

spibuffer * get_spibus_handle (int instance, int chipnumber)
{
  // magically obtain the spibus comp_first_inst pointer. (how, what name?)
  // follow singly linked list of instances until I get to instance
instance.
  // return the address of spibuffer[chipnumber];
  return (spibuffer *) 0;
}
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to