<ahref="chlists_8c.html">Go to the documentation of this file.</a><divclass="fragment"><preclass="fragment"><aname="l00001"></a>00001 <spanclass="comment">/*</span>
<aname="l00037"></a>00037 <spanclass="preprocessor">#include "<aclass="code"href="ch_8h.html"title="ChibiOS/RT main include file.">ch.h</a>"</span>
<aname="l00049"></a><aclass="code"href="group__internals.html#ga02226b866ae704435baf2ffe259ba0b2">00049</a><spanclass="keywordtype">void</span><aclass="code"href="group__internals.html#ga02226b866ae704435baf2ffe259ba0b2"title="Inserts a thread into a priority ordered queue.">prio_insert</a>(<aclass="code"href="struct_thread.html"title="Structure representing a thread.">Thread</a> *tp, <aclass="code"href="struct_threads_queue.html"title="Generic threads bidirectional linked list header and element.">ThreadsQueue</a> *tqp) {
<aname="l00050"></a>00050
<aname="l00051"></a>00051 <spanclass="comment">/* cp iterates over the queue.*/</span>
<aname="l00052"></a>00052 <aclass="code"href="struct_thread.html"title="Structure representing a thread.">Thread</a> *cp = (<aclass="code"href="struct_thread.html"title="Structure representing a thread.">Thread</a> *)tqp;
<aname="l00054"></a>00054 <spanclass="comment">/* Iterate to next thread in queue.*/</span>
<aname="l00055"></a>00055 cp = cp-><aclass="code"href="struct_thread.html#a49d3270919a6e423a47de20bc57beaa1"title="Next in the list/queue.">p_next</a>;
<aname="l00056"></a>00056 <spanclass="comment">/* Not end of queue? and cp has equal or higher priority than tp?.*/</span>
<aname="l00058"></a>00058 <spanclass="comment">/* Insertion on p_prev.*/</span>
<aname="l00059"></a>00059 tp-><aclass="code"href="struct_thread.html#a49d3270919a6e423a47de20bc57beaa1"title="Next in the list/queue.">p_next</a> = cp;
<aname="l00060"></a>00060 tp-><aclass="code"href="struct_thread.html#a7661cf39bbb29453ce0c48a94708fb69"title="Previous in the queue.">p_prev</a> = cp-><aclass="code"href="struct_thread.html#a7661cf39bbb29453ce0c48a94708fb69"title="Previous in the queue.">p_prev</a>;
<aname="l00061"></a>00061 tp-><aclass="code"href="struct_thread.html#a7661cf39bbb29453ce0c48a94708fb69"title="Previous in the queue.">p_prev</a>-><aclass="code"href="struct_thread.html#a49d3270919a6e423a47de20bc57beaa1"title="Next in the list/queue.">p_next</a> = cp-><aclass="code"href="struct_thread.html#a7661cf39bbb29453ce0c48a94708fb69"title="Previous in the queue.">p_prev</a> = tp;
<aname="l00071"></a><aclass="code"href="group__internals.html#gaf7072f75fdab9dcc5f7b8dcad212965c">00071</a><spanclass="keywordtype">void</span><aclass="code"href="group__internals.html#gaf7072f75fdab9dcc5f7b8dcad212965c"title="Inserts a Thread into a queue.">queue_insert</a>(<aclass="code"href="struct_thread.html"title="Structure representing a thread.">Thread</a> *tp, <aclass="code"href="struct_threads_queue.html"title="Generic threads bidirectional linked list header and element.">ThreadsQueue</a> *tqp) {
<aname="l00073"></a>00073 tp-><aclass="code"href="struct_thread.html#a49d3270919a6e423a47de20bc57beaa1"title="Next in the list/queue.">p_next</a> = (<aclass="code"href="struct_thread.html"title="Structure representing a thread.">Thread</a> *)tqp;
<aname="l00074"></a>00074 tp-><aclass="code"href="struct_thread.html#a7661cf39bbb29453ce0c48a94708fb69"title="Previous in the queue.">p_prev</a> = tqp-><aclass="code"href="struct_threads_queue.html#aefc0a5e3ba3ed03da122337bc13be8fa">p_prev</a>;
<aname="l00075"></a>00075 tp-><aclass="code"href="struct_thread.html#a7661cf39bbb29453ce0c48a94708fb69"title="Previous in the queue.">p_prev</a>-><aclass="code"href="struct_thread.html#a49d3270919a6e423a47de20bc57beaa1"title="Next in the list/queue.">p_next</a> = tqp-><aclass="code"href="struct_threads_queue.html#aefc0a5e3ba3ed03da122337bc13be8fa">p_prev</a> = tp;
<aname="l00087"></a><aclass="code"href="group__internals.html#ga042479f09357fc59befebf4dfe0e9f4a">00087</a><aclass="code"href="struct_thread.html"title="Structure representing a thread.">Thread</a> *<aclass="code"href="group__internals.html#ga042479f09357fc59befebf4dfe0e9f4a"title="Removes the first-out Thread from a queue and returns it.">fifo_remove</a>(<aclass="code"href="struct_threads_queue.html"title="Generic threads bidirectional linked list header and element.">ThreadsQueue</a> *tqp) {
<aname="l00088"></a>00088 <aclass="code"href="struct_thread.html"title="Structure representing a thread.">Thread</a> *tp = tqp-><aclass="code"href="struct_threads_queue.html#af4a099c245d7ceecdf2f9755d05d0ed0">p_next</a>;
<aname="l00089"></a>00089
<aname="l00090"></a>00090 (tqp-><aclass="code"href="struct_threads_queue.html#af4a099c245d7ceecdf2f9755d05d0ed0">p_next</a> = tp-><aclass="code"href="struct_thread.html#a49d3270919a6e423a47de20bc57beaa1"title="Next in the list/queue.">p_next</a>)->p_prev = (<aclass="code"href="struct_thread.html"title="Structure representing a thread.">Thread</a> *)tqp;
<aname="l00103"></a><aclass="code"href="group__internals.html#gacacfe77140cab62948e63d898bf4dfba">00103</a><aclass="code"href="struct_thread.html"title="Structure representing a thread.">Thread</a> *<aclass="code"href="group__internals.html#gacacfe77140cab62948e63d898bf4dfba"title="Removes the last-out Thread from a queue and returns it.">lifo_remove</a>(<aclass="code"href="struct_threads_queue.html"title="Generic threads bidirectional linked list header and element.">ThreadsQueue</a> *tqp) {
<aname="l00104"></a>00104 <aclass="code"href="struct_thread.html"title="Structure representing a thread.">Thread</a> *tp = tqp-><aclass="code"href="struct_threads_queue.html#aefc0a5e3ba3ed03da122337bc13be8fa">p_prev</a>;
<aname="l00105"></a>00105
<aname="l00106"></a>00106 (tqp-><aclass="code"href="struct_threads_queue.html#aefc0a5e3ba3ed03da122337bc13be8fa">p_prev</a> = tp-><aclass="code"href="struct_thread.html#a7661cf39bbb29453ce0c48a94708fb69"title="Previous in the queue.">p_prev</a>)->p_next = (<aclass="code"href="struct_thread.html"title="Structure representing a thread.">Thread</a> *)tqp;
<aname="l00119"></a><aclass="code"href="group__internals.html#gafff11bcd31d7dc3d1a0a6c66f3fc6ec9">00119</a><aclass="code"href="struct_thread.html"title="Structure representing a thread.">Thread</a> *<aclass="code"href="group__internals.html#gafff11bcd31d7dc3d1a0a6c66f3fc6ec9"title="Removes a Thread from a queue and returns it.">dequeue</a>(<aclass="code"href="struct_thread.html"title="Structure representing a thread.">Thread</a> *tp) {
<aname="l00120"></a>00120
<aname="l00121"></a>00121 tp-><aclass="code"href="struct_thread.html#a7661cf39bbb29453ce0c48a94708fb69"title="Previous in the queue.">p_prev</a>-><aclass="code"href="struct_thread.html#a49d3270919a6e423a47de20bc57beaa1"title="Next in the list/queue.">p_next</a> = tp-><aclass="code"href="struct_thread.html#a49d3270919a6e423a47de20bc57beaa1"title="Next in the list/queue.">p_next</a>;
<aname="l00122"></a>00122 tp-><aclass="code"href="struct_thread.html#a49d3270919a6e423a47de20bc57beaa1"title="Next in the list/queue.">p_next</a>-><aclass="code"href="struct_thread.html#a7661cf39bbb29453ce0c48a94708fb69"title="Previous in the queue.">p_prev</a> = tp-><aclass="code"href="struct_thread.html#a7661cf39bbb29453ce0c48a94708fb69"title="Previous in the queue.">p_prev</a>;
<aname="l00133"></a><aclass="code"href="group__internals.html#ga5818ce2d363d36402baece614b06e41b">00133</a><spanclass="keywordtype">void</span><aclass="code"href="group__internals.html#ga5818ce2d363d36402baece614b06e41b"title="Pushes a Thread on top of a stack list.">list_insert</a>(<aclass="code"href="struct_thread.html"title="Structure representing a thread.">Thread</a> *tp, <aclass="code"href="struct_threads_list.html"title="Generic threads single link list, it works like a stack.">ThreadsList</a> *tlp) {
<aname="l00134"></a>00134
<aname="l00135"></a>00135 tp-><aclass="code"href="struct_thread.html#a49d3270919a6e423a47de20bc57beaa1"title="Next in the list/queue.">p_next</a> = tlp-><aclass="code"href="struct_threads_list.html#a9076f9b8ac5d59067adc11faa8998371">p_next</a>;
<aname="l00147"></a><aclass="code"href="group__internals.html#gad9aa523aebdaeefa3cc4a311bc210e8a">00147</a><aclass="code"href="struct_thread.html"title="Structure representing a thread.">Thread</a> *<aclass="code"href="group__internals.html#gad9aa523aebdaeefa3cc4a311bc210e8a"title="Pops a Thread from the top of a stack list and returns it.">list_remove</a>(<aclass="code"href="struct_threads_list.html"title="Generic threads single link list, it works like a stack.">ThreadsList</a> *tlp) {
<aname="l00148"></a>00148
<aname="l00149"></a>00149 <aclass="code"href="struct_thread.html"title="Structure representing a thread.">Thread</a> *tp = tlp-><aclass="code"href="struct_threads_list.html#a9076f9b8ac5d59067adc11faa8998371">p_next</a>;
<aname="l00150"></a>00150 tlp-><aclass="code"href="struct_threads_list.html#a9076f9b8ac5d59067adc11faa8998371">p_next</a> = tp-><aclass="code"href="struct_thread.html#a49d3270919a6e423a47de20bc57beaa1"title="Next in the list/queue.">p_next</a>;
Generated on Sun Nov 28 2010 14:09:48 for ChibiOS/RT by <ahref="http://www.doxygen.org/index.html"><imgsrc="doxygen.png"alt="doxygen"align="middle"border="0"></a> 1.7.1</small></address>