Re: Small doubt in how chain works in RTEMS

2020-07-24 Thread Richi Dubey
Yes, it makes perfect sense. Thank you for the clarification. On Fri, Jul 24, 2020 at 11:29 PM Gedare Bloom wrote: > On Fri, Jul 24, 2020 at 8:27 AM Richi Dubey wrote: > > > > Hi, > > > > I have a doubt regarding this. > > > > We do > > rtems_chain_append( &chain1, &node1.Node ); > > > > And

Re: Small doubt in how chain works in RTEMS

2020-07-24 Thread Gedare Bloom
On Fri, Jul 24, 2020 at 8:27 AM Richi Dubey wrote: > > Hi, > > I have a doubt regarding this. > > We do > rtems_chain_append( &chain1, &node1.Node ); > > And get the node pointer when we use: > rtems_chain_node*p= rtems_chain_first(&chain1), > > After this, Do we really need to use the CON

Re: Small doubt in how chain works in RTEMS

2020-07-24 Thread Richi Dubey
Hi, I have a doubt regarding this. We do rtems_chain_append( &chain1, &node1.Node ); And get the node pointer when we use: rtems_chain_node*p= rtems_chain_first(&chain1), After this, Do we really need to use the CONTAINER_OF and other such methods? Can we not simply do: test_node nod

Re: Small doubt in how chain works in RTEMS

2020-06-13 Thread Richi Dubey
Hi Dr. Bloom, Thanks for the link, The article has another link to an article( http://www.kroah.com/log/linux/container_of.html) by one of the maintainers of Linux and both the articles are really well written. The idea is, we have the size of the structure and the size of the pointer(for our chai

Re: Small doubt in how chain works in RTEMS

2020-06-12 Thread Gedare Bloom
On Fri, Jun 12, 2020 at 7:50 AM Richi Dubey wrote: > > Hi everyone, > > While going through testsuites/sptests/spchain/init.c, I noticed the > following code: > > --- > rtems_task Init( > rtems_task_argument ignored > ) > { > rtems_chain_control ch