• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
3<title>oscl_scheduler_readyq.h Source File</title>
4<link href="doxygen.css" rel="stylesheet" type="text/css">
5</head><body>
6<!-- Generated by Doxygen 1.2.18 -->
7<center>
8<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="modules.html">Modules</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Data Structures</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Data Fields</a> &nbsp; <a class="qindex" href="globals.html">Globals</a> &nbsp; </center>
9<hr><h1>oscl_scheduler_readyq.h</h1><a href="oscl__scheduler__readyq_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001
1000013 <span class="preprocessor">#ifndef OSCL_SCHEDULER_READYQ_H_INCLUDED</span>
1100014 <span class="preprocessor"></span><span class="preprocessor">#define OSCL_SCHEDULER_READYQ_H_INCLUDED</span>
1200015 <span class="preprocessor"></span>
1300016 <span class="preprocessor">#ifndef OSCL_SCHEDULER_TYPES_H_INCLUDED</span>
1400017 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__scheduler__types_8h.html">oscl_scheduler_types.h</a>"</span>
1500018 <span class="preprocessor">#endif</span>
1600019 <span class="preprocessor"></span><span class="preprocessor">#ifndef OSCL_SCHEDULER_TUNEABLES_H_INCLUDED</span>
1700020 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__scheduler__tuneables_8h.html">oscl_scheduler_tuneables.h</a>"</span>
1800021 <span class="preprocessor">#endif</span>
1900022 <span class="preprocessor"></span>
2000023
2100024 <span class="preprocessor">#ifndef OSCL_PRIQUEUE_H_INCLUDED</span>
2200025 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__priqueue_8h.html">oscl_priqueue.h</a>"</span>
2300026 <span class="preprocessor">#endif</span>
2400027 <span class="preprocessor"></span><span class="preprocessor">#ifndef OSCL_BASE_ALLOC_H_INCLUDED</span>
2500028 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__base__alloc_8h.html">oscl_base_alloc.h</a>"</span>
2600029 <span class="preprocessor">#endif</span>
2700030 <span class="preprocessor"></span><span class="preprocessor">#ifndef OSCL_SEMAPHORE_H_INCLUDED</span>
2800031 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__semaphore_8h.html">oscl_semaphore.h</a>"</span>
2900032 <span class="preprocessor">#endif</span>
3000033 <span class="preprocessor"></span><span class="preprocessor">#ifndef OSCL_MEM_H_INCLUDED</span>
3100034 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__mem_8h.html">oscl_mem.h</a>"</span>
3200035 <span class="preprocessor">#endif</span>
3300036 <span class="preprocessor"></span><span class="preprocessor">#ifndef OSCL_MUTEX_H_INCLUDED</span>
3400037 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__mutex_8h.html">oscl_mutex.h</a>"</span>
3500038 <span class="preprocessor">#endif</span>
3600039 <span class="preprocessor"></span><span class="preprocessor">#ifndef OSCL_STRING_CONTAINERS_H_INCLUDED</span>
3700040 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__string__containers_8h.html">oscl_string_containers.h</a>"</span>
3800041 <span class="preprocessor">#endif</span>
3900042 <span class="preprocessor"></span>
4000043 <span class="keyword">class </span><a class="code" href="classPVActiveBase.html">PVActiveBase</a>;
4100044
42<a name="l00045"></a><a class="code" href="classOsclReadyAlloc.html">00045</a> <span class="keyword">class </span><a class="code" href="classOsclReadyAlloc.html">OsclReadyAlloc</a>: <span class="keyword">public</span> <a class="code" href="classOscl__DefAlloc.html">Oscl_DefAlloc</a>
4300046 {
4400047     <span class="keyword">public</span>:
4500048         <a class="code" href="group__osclbase.html#a25">OsclAny</a>* <a class="code" href="classOsclReadyAlloc.html#a0">allocate</a>(<span class="keyword">const</span> uint32 size) ;
4600049         <a class="code" href="group__osclbase.html#a25">OsclAny</a>* <a class="code" href="classOsclReadyAlloc.html#a1">allocate_fl</a>(<span class="keyword">const</span> uint32 size, <span class="keyword">const</span> <span class="keywordtype">char</span> * file_name, <span class="keyword">const</span> <span class="keywordtype">int</span> line_num);
4700050         <span class="keywordtype">void</span> <a class="code" href="classOsclReadyAlloc.html#a2">deallocate</a>(<a class="code" href="group__osclbase.html#a25">OsclAny</a>* p) ;
4800051     <span class="keyword">private</span>:
4900052         <a class="code" href="classOsclMemAllocator.html">OsclMemAllocator</a> iBasicAlloc;
5000053 };
5100054
52<a name="l00055"></a><a class="code" href="group__osclproc.html#a4">00055</a> <span class="keyword">typedef</span> <a class="code" href="classPVActiveBase.html">PVActiveBase</a>* <a class="code" href="classPVActiveBase.html">TOsclReady</a>;
5300056
54<a name="l00057"></a><a class="code" href="classOsclReadyCompare.html">00057</a> <span class="keyword">class </span><a class="code" href="classOsclReadyCompare.html">OsclReadyCompare</a>
5500058 {
5600059     <span class="keyword">public</span>:
5700060         <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="classOsclReadyCompare.html#d0">compare</a>(TOsclReady&amp; a, TOsclReady&amp; b) ;
5800061 };
59<a name="l00062"></a><a class="code" href="classOsclTimerCompare.html">00062</a> <span class="keyword">class </span><a class="code" href="classOsclTimerCompare.html">OsclTimerCompare</a>
6000063 {
6100064     <span class="keyword">public</span>:
6200065         <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="classOsclTimerCompare.html#d0">compare</a>(TOsclReady&amp; a, TOsclReady&amp; b) ;
6300066 };
6400067
6500073 <span class="keyword">class </span><a class="code" href="classPVLogger.html">PVLogger</a>;
6600074 <span class="keyword">class </span><a class="code" href="classOsclSchedulerObserver.html">OsclSchedulerObserver</a>;
67<a name="l00075"></a><a class="code" href="classOsclReadyQ.html">00075</a> <span class="keyword">class </span><a class="code" href="classOsclReadyQ.html">OsclReadyQ</a>
6800076             : <span class="keyword">public</span> <a class="code" href="classOsclPriorityQueue.html">OsclPriorityQueue</a>&lt;TOsclReady, OsclReadyAlloc, Oscl_Vector&lt;TOsclReady, OsclReadyAlloc&gt;, OsclReadyCompare&gt;
6900077 {
7000078     <span class="keyword">public</span>:
7100079         <span class="keywordtype">void</span> <a class="code" href="classOsclReadyQ.html#a0">Construct</a>(<span class="keywordtype">int</span>);
7200080         <span class="keywordtype">void</span> <a class="code" href="classOsclReadyQ.html#a1">ThreadLogon</a>();
7300081         <span class="keywordtype">void</span> <a class="code" href="classOsclReadyQ.html#a2">ThreadLogoff</a>();
7400082
7500083         <span class="keywordtype">void</span> <a class="code" href="classOsclReadyQ.html#a3">Remove</a>(TOsclReady);
7600084
7700085         <span class="keywordtype">bool</span> <a class="code" href="classOsclReadyQ.html#a4">IsIn</a>(TOsclReady);
7800086
79<a name="l00087"></a><a class="code" href="classOsclReadyQ.html#a5">00087</a>         uint32 <a class="code" href="classOsclReadyQ.html#a5">Depth</a>()
8000088         {
8100089             <span class="keywordflow">return</span> <a class="code" href="classOsclPriorityQueue.html#a1">size</a>();
8200090         }
8300091
8400092         TOsclReady <a class="code" href="classOsclReadyQ.html#a6">PopTop</a>();
8500093         TOsclReady <a class="code" href="classOsclReadyQ.html#a7">Top</a>();
8600094
8700095         TOsclReady <a class="code" href="classOsclReadyQ.html#a8">WaitAndPopTop</a>();
8800096         TOsclReady <a class="code" href="classOsclReadyQ.html#a8">WaitAndPopTop</a>(uint32);
8900097
9000098         int32 <a class="code" href="classOsclReadyQ.html#a10">PendComplete</a>(<a class="code" href="classPVActiveBase.html">PVActiveBase</a> *pvbase, int32 aReason);
9100099         int32 <a class="code" href="classOsclReadyQ.html#a11">WaitForRequestComplete</a>(<a class="code" href="classPVActiveBase.html">PVActiveBase</a>*);
9200100
9300101         <span class="comment">//For non-blocking scheduler observer support</span>
9400102         <span class="keywordtype">void</span> <a class="code" href="classOsclReadyQ.html#a12">RegisterForCallback</a>(<a class="code" href="classOsclSchedulerObserver.html">OsclSchedulerObserver</a>* aCallback, <a class="code" href="group__osclbase.html#a25">OsclAny</a>* aCallbackContext);
9500103         <span class="keywordtype">void</span> <a class="code" href="classOsclReadyQ.html#a13">TimerCallback</a>(uint32 aDelayMicrosec);
96<a name="l00104"></a><a class="code" href="classOsclReadyQ.html#a14">00104</a>         <a class="code" href="classOsclSchedulerObserver.html">OsclSchedulerObserver</a>* <a class="code" href="classOsclReadyQ.html#a14">Callback</a>()
9700105         {
9800106             <span class="keywordflow">return</span> iCallback;
9900107         }
10000108
10100109     <span class="keyword">private</span>:
10200110         TOsclReady PopTopAfterWait();
10300111
10400112         <span class="comment">//mutex for thread protection</span>
10500113         <a class="code" href="classOsclMutex.html">OsclNoYieldMutex</a> iCrit;
10600114
10700115         <span class="comment">//this semaphore tracks the queue size.  it is used to</span>
10800116         <span class="comment">//regulate the scheduling loop when running in blocking mode.</span>
10900117         <a class="code" href="classOsclSemaphore.html">OsclSemaphore</a> iSem;
11000118
11100119         <span class="comment">//a sequence number needed to maintain FIFO sorting order in oscl pri queue.</span>
11200120         uint32 iSeqNumCounter;
11300121
11400122         <span class="comment">//For non-blocking scheduler observer support</span>
11500123         <a class="code" href="classOsclSchedulerObserver.html">OsclSchedulerObserver</a>* iCallback;
11600124         <a class="code" href="group__osclbase.html#a25">OsclAny</a>* iCallbackContext;
11700125 };
11800126
11900127 <span class="comment">/*</span>
12000128 <span class="comment">** A non-thread-safe queue for holding pending timers.</span>
12100129 <span class="comment">*/</span>
122<a name="l00130"></a><a class="code" href="classOsclTimerQ.html">00130</a> <span class="keyword">class </span><a class="code" href="classOsclTimerQ.html">OsclTimerQ</a>
12300131             : <span class="keyword">public</span> <a class="code" href="classOsclPriorityQueue.html">OsclPriorityQueue</a>&lt;TOsclReady, OsclReadyAlloc, Oscl_Vector&lt;TOsclReady, OsclReadyAlloc&gt;, OsclTimerCompare&gt;
12400132 {
12500133     <span class="keyword">public</span>:
12600134         <span class="keywordtype">void</span> <a class="code" href="classOsclTimerQ.html#a0">Construct</a>(<span class="keywordtype">int</span>);
12700135         <span class="keywordtype">void</span> <a class="code" href="classOsclTimerQ.html#a1">Add</a>(TOsclReady);
12800136         <span class="keywordtype">void</span> <a class="code" href="classOsclTimerQ.html#a2">Remove</a>(TOsclReady);
12900137         TOsclReady <a class="code" href="classOsclTimerQ.html#a3">PopTop</a>();
13000138         TOsclReady <a class="code" href="classOsclTimerQ.html#a4">Top</a>();
13100139         <span class="keywordtype">void</span> <a class="code" href="classOsclTimerQ.html#a5">Pop</a>(TOsclReady);
13200140         <span class="keywordtype">bool</span> <a class="code" href="classOsclTimerQ.html#a6">IsIn</a>(TOsclReady);
13300141     <span class="keyword">private</span>:
13400142         <span class="comment">//a sequence number needed to maintain FIFO sorting order in oscl pri queue.</span>
13500143         uint32 iSeqNumCounter;
13600144 };
13700145
138<a name="l00149"></a><a class="code" href="classTReadyQueLink.html">00149</a> <span class="keyword">class </span><a class="code" href="classTReadyQueLink.html">TReadyQueLink</a>
13900150 {
14000151     <span class="keyword">public</span>:
141<a name="l00152"></a><a class="code" href="classTReadyQueLink.html#a0">00152</a>         <a class="code" href="classTReadyQueLink.html#a0">TReadyQueLink</a>()
14200153         {
14300154             <a class="code" href="classTReadyQueLink.html#m0">iAOPriority</a> = 0;
14400155             <a class="code" href="classTReadyQueLink.html#m1">iTimeToRunTicks</a> = 0;
14500156             <a class="code" href="classTReadyQueLink.html#m3">iSeqNum</a> = 0;
14600157             <a class="code" href="classTReadyQueLink.html#m4">iIsIn</a> = <a class="code" href="group__osclbase.html#a81">NULL</a>;
14700158         }
14800159
149<a name="l00160"></a><a class="code" href="classTReadyQueLink.html#m0">00160</a>         int32 <a class="code" href="classTReadyQueLink.html#m0">iAOPriority</a>;<span class="comment">//scheduling priority</span>
150<a name="l00161"></a><a class="code" href="classTReadyQueLink.html#m1">00161</a>         uint32 <a class="code" href="classTReadyQueLink.html#m1">iTimeToRunTicks</a>;<span class="comment">//for timers, this is the time to run in ticks.</span>
151<a name="l00162"></a><a class="code" href="classTReadyQueLink.html#m2">00162</a>         uint32 <a class="code" href="classTReadyQueLink.html#m2">iTimeQueuedTicks</a>;<span class="comment">//the time when the AO was queued, in ticks.</span>
152<a name="l00163"></a><a class="code" href="classTReadyQueLink.html#m3">00163</a>         uint32 <a class="code" href="classTReadyQueLink.html#m3">iSeqNum</a>;<span class="comment">//sequence number for oscl pri queue.</span>
153<a name="l00164"></a><a class="code" href="classTReadyQueLink.html#m4">00164</a>         <a class="code" href="group__osclbase.html#a25">OsclAny</a>* <a class="code" href="classTReadyQueLink.html#m4">iIsIn</a>;<span class="comment">//pointer to the queue we're in, cast as a void*</span>
15400165
15500166 };
15600167
15700168 <span class="preprocessor">#endif</span>
15800169 <span class="preprocessor"></span>
15900170
160</pre></div><hr size="1"><img src="pvlogo_small.jpg"><address style="align: right;"><small>OSCL API</small>
161<address style="align: left;"><small>Posting Version: OPENCORE_20090310 </small>
162</small></address>
163</body>
164</html>
165