mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2025-01-02 18:56:32 +00:00
1b75d91002
Add arg to SATARep to specify drive types to show. Add checks in AHCIPortInit to verify port signatures, add helper method to get signatures from port.
100 lines
6.6 KiB
HTML
Executable file
100 lines
6.6 KiB
HTML
Executable file
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html;charset=US-ASCII">
|
|
<meta name="generator" content="ZealOS V0.13">
|
|
<style type="text/css">
|
|
body {background-color:#fef1f0;}
|
|
.cF0{color:#000000;background-color:#fef1f0;}
|
|
.cF1{color:#0148a4;background-color:#fef1f0;}
|
|
.cF2{color:#3b7901;background-color:#fef1f0;}
|
|
.cF3{color:#057c7e;background-color:#fef1f0;}
|
|
.cF4{color:#bb2020;background-color:#fef1f0;}
|
|
.cF5{color:#9e42ae;background-color:#fef1f0;}
|
|
.cF6{color:#b57901;background-color:#fef1f0;}
|
|
.cF7{color:#b2b6af;background-color:#fef1f0;}
|
|
.cF8{color:#555753;background-color:#fef1f0;}
|
|
.cF9{color:#678fbb;background-color:#fef1f0;}
|
|
.cFA{color:#82bc49;background-color:#fef1f0;}
|
|
.cFB{color:#0097a2;background-color:#fef1f0;}
|
|
.cFC{color:#e26a6a;background-color:#fef1f0;}
|
|
.cFD{color:#c671bc;background-color:#fef1f0;}
|
|
.cFE{color:#c7ab00;background-color:#fef1f0;}
|
|
.cFF{color:#fef1f0;background-color:#fef1f0;}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<pre style="font-family:monospace;font-size:12pt">
|
|
<a name="l1"></a><span class=cF2>/*</span><span class=cF0> </span><span class=cF2>Shrine mentions possibly using two FIFOs</span><span class=cF0>
|
|
<a name="l2"></a> </span><span class=cF2>(in our case, Queues) for pending and</span><span class=cF0>
|
|
<a name="l3"></a> </span><span class=cF2>empty frames. If logical to implement,</span><span class=cF0>
|
|
<a name="l4"></a> </span><span class=cF2>perhaps Zeal NetQueue code should</span><span class=cF0>
|
|
<a name="l5"></a> </span><span class=cF2>do something similar to that idea.</span><span class=cF0>
|
|
<a name="l6"></a>
|
|
<a name="l7"></a> </span><span class=cF2>Each Ethernet Frame will be represented</span><span class=cF0>
|
|
<a name="l8"></a> </span><span class=cF2>as an entry in a CQueue. */</span><span class=cF0>
|
|
<a name="l9"></a>
|
|
<a name="l10"></a></span><span class=cF1>class</span><span class=cF0> CNetQueueEntry:</span><span class=cF9>CQueue</span><span class=cF0>
|
|
<a name="l11"></a>{
|
|
<a name="l12"></a> </span><span class=cF9>I64</span><span class=cF0> packet_length;
|
|
<a name="l13"></a> </span><span class=cF1>U8</span><span class=cF0> frame[ETHERNET_FRAME_SIZE];
|
|
<a name="l14"></a>};
|
|
<a name="l15"></a>
|
|
<a name="l16"></a>
|
|
<a name="l17"></a></span><span class=cF2>/*</span><span class=cF0> </span><span class=cF2>global variable, holds pointer of Ethernet Queue.</span><span class=cF0>
|
|
<a name="l18"></a> </span><span class=cF2>This acts as the Head of the Queue, Entries act</span><span class=cF0>
|
|
<a name="l19"></a> </span><span class=cF2>as the Tail of the Queue. </span><span class=cF0>
|
|
<a name="l20"></a> </span><span class=cF2>Upon QueueInit, ->next and ->last are set to</span><span class=cF0>
|
|
<a name="l21"></a> </span><span class=cF2>itself, the Head. */</span><span class=cF0>
|
|
<a name="l22"></a>
|
|
<a name="l23"></a></span><span class=cF9>CQueue</span><span class=cF0> *net_queue; </span><span class=cF2>// no QueueRemove the Head! only Entries!</span><span class=cF0>
|
|
<a name="l24"></a>
|
|
<a name="l25"></a></span><span class=cF1>U0</span><span class=cF0> NetQueueInit()
|
|
<a name="l26"></a>{
|
|
<a name="l27"></a> net_queue = </span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CQueue</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l28"></a> </span><span class=cF5>QueueInit</span><span class=cF0>(net_queue);
|
|
<a name="l29"></a>}
|
|
<a name="l30"></a>
|
|
<a name="l31"></a>CNetQueueEntry *NetQueuePull()
|
|
<a name="l32"></a>{</span><span class=cF2>/*</span><span class=cF0> </span><span class=cF2>Returns a pointer to a CNetQueueEntry,</span><span class=cF0>
|
|
<a name="l33"></a> </span><span class=cF2>or NULL pointer if Net Queue is empty. */</span><span class=cF0>
|
|
<a name="l34"></a>
|
|
<a name="l35"></a> CNetQueueEntry *entry;
|
|
<a name="l36"></a>
|
|
<a name="l37"></a> </span><span class=cF1>if</span><span class=cF0> (net_queue->next != net_queue)
|
|
<a name="l38"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l39"></a> entry = net_queue->next;
|
|
<a name="l40"></a>
|
|
<a name="l41"></a> NetLog(</span><span class=cF6>"NETQUEUE PULL: Removing entry from queue."</span><span class=cF0>);
|
|
<a name="l42"></a> </span><span class=cF5>QueueRemove</span><span class=cF0>(entry);
|
|
<a name="l43"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l44"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF2>// Queue is empty if head->next is head itself.</span><span class=cF0>
|
|
<a name="l45"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l46"></a> entry = </span><span class=cF3>NULL</span><span class=cF0>;
|
|
<a name="l47"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l48"></a>
|
|
<a name="l49"></a> </span><span class=cF1>return</span><span class=cF0> entry;
|
|
<a name="l50"></a>}
|
|
<a name="l51"></a>
|
|
<a name="l52"></a></span><span class=cF1>U0</span><span class=cF0> NetQueuePush(</span><span class=cF1>U8</span><span class=cF0> *data, </span><span class=cF9>I64</span><span class=cF0> length)
|
|
<a name="l53"></a>{</span><span class=cF2>/*</span><span class=cF0> </span><span class=cF2>Pushes a copy of the packet data and length</span><span class=cF0>
|
|
<a name="l54"></a> </span><span class=cF2>into the Net Queue. The NetQueueEntry is inserted</span><span class=cF0>
|
|
<a name="l55"></a> </span><span class=cF2>after the last entry of net_queue to keep new</span><span class=cF0>
|
|
<a name="l56"></a> </span><span class=cF2>items in the back of the Queue, old in front. */</span><span class=cF0>
|
|
<a name="l57"></a>
|
|
<a name="l58"></a> CNetQueueEntry *entry = </span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF0>CNetQueueEntry</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l59"></a>
|
|
<a name="l60"></a> entry->packet_length = length;
|
|
<a name="l61"></a>
|
|
<a name="l62"></a> </span><span class=cF5>MemCopy</span><span class=cF0>(entry->frame, data, length);
|
|
<a name="l63"></a>
|
|
<a name="l64"></a> </span><span class=cF5>QueueInsert</span><span class=cF0>(entry, net_queue->last);
|
|
<a name="l65"></a>
|
|
<a name="l66"></a> </span><span class=cF2>// Generate Net Handler interrupt.</span><span class=cF0>
|
|
<a name="l67"></a> NetLog(</span><span class=cF6>"NETQUEUE PUSH COPY: Generating NetHandler interrupt."</span><span class=cF0>);
|
|
<a name="l68"></a> </span><span class=cF5>MPInt</span><span class=cF0>(I_NETHANDLER, INT_DEST_CPU);
|
|
<a name="l69"></a>}
|
|
<a name="l70"></a>
|
|
<a name="l71"></a>
|
|
<a name="l72"></a>NetQueueInit;</span></pre></body>
|
|
</html>
|