how to use chain in rtems?
ckim at etri.re.kr
Tue Aug 25 08:39:58 UTC 2015
To use chain, I added rtems_chain_control queue; in the host structure.
Also, mrq has rtems_chain_node node; as the first element.
The method I used is
to initialize :
to append mrq to the queue :
to get the first node :
mrq = (struct mmc_request *)host->queue.Chain.Head.fill; (method 1)
mrq = (struct mmc_reequest *)rtems_chain_head(&host->queue); (method 2)
rtems_chain_extract(&mrq->node); (after method1 or method 2 I did this to distroy the node from the chain)
Is this correct method? I put WR mrq and when I was about to extract that, I enqueued RD mrq, then, when I read the first element,
it is RD mrq (using method 1) or some other value (using method 2).
Please someone tell me how to use it.
Thanks in advance.
More information about the users