<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>UbixOS V2: src/sys/sys/device.c File Reference</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.7 --> <div class="tabs"> <ul> <li><a href="main.html"><span>Main Page</span></a></li> <li><a href="classes.html"><span>Data Structures</span></a></li> <li id="current"><a href="files.html"><span>Files</span></a></li> <li><a href="dirs.html"><span>Directories</span></a></li> <li> <form action="search.php" method="get"> <table cellspacing="0" cellpadding="0" border="0"> <tr> <td><label> <u>S</u>earch for </label></td> <td><input type="text" name="query" value="" size="20" accesskey="s"/></td> </tr> </table> </form> </li> </ul></div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>Globals</span></a></li> </ul></div> <div class="nav"> <a class="el" href="dir_897b6a2d7bab147dd1db58381aad3984.html">src</a> » <a class="el" href="dir_832905b1f7f5feaf61a306b40c0ac817.html">sys</a> » <a class="el" href="dir_7b0469299ccbf4a3a403496996173710.html">sys</a></div> <h1>device.c File Reference</h1><code>#include <<a class="el" href="device_8h-source.html">sys/device.h</a>></code><br> <code>#include <<a class="el" href="spinlock_8h-source.html">ubixos/spinlock.h</a>></code><br> <code>#include <<a class="el" href="kmalloc_8h-source.html">lib/kmalloc.h</a>></code><br> <code>#include <<a class="el" href="kprintf_8h-source.html">lib/kprintf.h</a>></code><br> <code>#include <<a class="el" href="assert_8h-source.html">assert.h</a>></code><br> <p> Include dependency graph for device.c:<p><center><img src="device_8c__incl.png" border="0" usemap="#src/sys/sys/device.c_map" alt=""></center> <map name="src/sys/sys/device.c_map"> <area href="device_8h.html" shape="rect" coords="224,5,331,32" alt=""> <area href="spinlock_8h.html" shape="rect" coords="208,56,347,83" alt=""> <area href="kmalloc_8h.html" shape="rect" coords="224,107,331,133" alt=""> <area href="kprintf_8h.html" shape="rect" coords="228,157,327,184" alt=""> <area href="assert_8h.html" shape="rect" coords="240,208,315,235" alt=""> <area href="types_8h.html" shape="rect" coords="396,81,516,108" alt=""> <area href="__types_8h.html" shape="rect" coords="567,81,671,108" alt=""> </map> <p> <a href="device_8c-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0"> <tr><td></td></tr> <tr><td colspan="2"><br><h2>Functions</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="device_8c.html#24bac04b529afec40daa960bd7e7b8ee">device_add</a> (int minor, char type, struct <a class="el" href="structdevice__interface.html">device_interface</a> *devInfo)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structdevice__node.html">device_node</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="device_8c.html#0002a4ec01ee11597c6751602f3e4c3d">device_find</a> (int major, int minor)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="device_8c.html#b6cc746d95021f087eb5aef767050e71">device_remove</a> (struct <a class="el" href="structdevice__node.html">device_node</a> *deviceToDelete)</td></tr> <tr><td colspan="2"><br><h2>Variables</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">static struct <a class="el" href="structdevice__node.html">device_node</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="device_8c.html#90d9a2a00434982169ff5710b19a4c1c">devices</a> = 0x0</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="spinlock_8h.html#a240e9404b4ede1e0d714610080d1176">spinLock_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="device_8c.html#9c7fbb38f0fb266ba997f51da7cf8a50">deviceSpinLock</a> = SPIN_LOCK_INITIALIZER</td></tr> </table> <hr><h2>Function Documentation</h2> <a class="anchor" name="24bac04b529afec40daa960bd7e7b8ee"></a><!-- doxytag: member="device.c::device_add" ref="24bac04b529afec40daa960bd7e7b8ee" args="(int minor, char type, struct device_interface *devInfo)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int device_add </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"> <em>minor</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">char </td> <td class="paramname"> <em>type</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">struct <a class="el" href="structdevice__interface.html">device_interface</a> * </td> <td class="paramname"> <em>devInfo</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> <p> Definition at line <a class="el" href="device_8c-source.html#l00051">51</a> of file <a class="el" href="device_8c-source.html">device.c</a>. <p> References <a class="el" href="device_8c-source.html#l00037">devices</a>, <a class="el" href="device_8c-source.html#l00038">deviceSpinLock</a>, <a class="el" href="device_8h-source.html#l00038">device_node::devInfo</a>, <a class="el" href="structdevice__interface.html#92620413c2580ea3cf01e121bb54c254">device_interface::init</a>, <a class="el" href="device_8h-source.html#l00049">device_interface::initialized</a>, <a class="el" href="kmalloc_8c-source.html#l00247">kmalloc()</a>, <a class="el" href="kprintf_8c-source.html#l00038">kprintf()</a>, <a class="el" href="device_8h-source.html#l00041">device_node::minor</a>, <a class="el" href="device_8h-source.html#l00037">device_node::next</a>, <a class="el" href="types_8h-source.html#l00036">NULL</a>, <a class="el" href="device_8h-source.html#l00036">device_node::prev</a>, <a class="el" href="spinlock_8c-source.html#l00056">spinLock()</a>, <a class="el" href="spinlock_8c-source.html#l00037">spinUnlock()</a>, and <a class="el" href="device_8h-source.html#l00040">device_node::type</a>. <p> Referenced by <a class="el" href="fdc_8c-source.html#l00063">fdc_init()</a>, and <a class="el" href="hd_8c-source.html#l00039">initHardDisk()</a>. <p> Here is the call graph for this function:<p><center><img src="device_8c_24bac04b529afec40daa960bd7e7b8ee_cgraph.png" border="0" usemap="#device_8c_24bac04b529afec40daa960bd7e7b8ee_cgraph_map" alt=""></center> <map name="device_8c_24bac04b529afec40daa960bd7e7b8ee_cgraph_map"> <area href="kmalloc_8h.html#150eab2ac4ce4553e21ca10e7f441762" shape="rect" coords="152,335,227,362" alt=""> <area href="kprint_8h.html#b2761bdf0cca73ad0fb5880895210cd8" shape="rect" coords="697,411,764,438" alt=""> <area href="spinlock_8h.html#2cd9a4502680fb8e7f0fe6b029e558b1" shape="rect" coords="691,284,771,311" alt=""> <area href="spinlock_8h.html#dd996cbbb3b9826dd9c8cf02b66a4c65" shape="rect" coords="683,82,779,108" alt=""> <area href="kmalloc_8c.html#f6c4ea5cb961c72548d92ff65d7e33a4" shape="rect" coords="276,234,396,260" alt=""> <area href="kmalloc_8c.html#eb1c3f1ef8eb9063c2e5c4af488dd2d0" shape="rect" coords="275,360,397,387" alt=""> <area href="kpanic_8h.html#db9a182aa071791a306163d50d653deb" shape="rect" coords="507,360,573,387" alt=""> <area href="lib_2string_8h.html#ce4b911463887af5e748326323e99a23" shape="rect" coords="501,208,579,235" alt=""> <area href="paging_8h.html#541f0b43826a40b9e978f5479080bb0e" shape="rect" coords="445,158,635,184" alt=""> </map> </div> </div><p> <a class="anchor" name="0002a4ec01ee11597c6751602f3e4c3d"></a><!-- doxytag: member="device.c::device_find" ref="0002a4ec01ee11597c6751602f3e4c3d" args="(int major, int minor)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">struct <a class="el" href="structdevice__node.html">device_node</a>* device_find </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"> <em>major</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"> <em>minor</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> <p> Definition at line <a class="el" href="device_8c-source.html#l00086">86</a> of file <a class="el" href="device_8c-source.html">device.c</a>. <p> References <a class="el" href="device_8c-source.html#l00037">devices</a>, <a class="el" href="device_8c-source.html#l00038">deviceSpinLock</a>, <a class="el" href="device_8h-source.html#l00038">device_node::devInfo</a>, <a class="el" href="device_8h-source.html#l00051">device_interface::major</a>, <a class="el" href="device_8h-source.html#l00041">device_node::minor</a>, <a class="el" href="device_8h-source.html#l00037">device_node::next</a>, <a class="el" href="spinlock_8c-source.html#l00056">spinLock()</a>, and <a class="el" href="spinlock_8c-source.html#l00037">spinUnlock()</a>. <p> Referenced by <a class="el" href="devfs_8c-source.html#l00071">devfs_open()</a>, <a class="el" href="devfs_8c-source.html#l00114">devfs_read()</a>, <a class="el" href="devfs_8c-source.html#l00160">devfs_write()</a>, and <a class="el" href="mount_8c-source.html#l00047">vfs_mount()</a>. <p> Here is the call graph for this function:<p><center><img src="device_8c_0002a4ec01ee11597c6751602f3e4c3d_cgraph.png" border="0" usemap="#device_8c_0002a4ec01ee11597c6751602f3e4c3d_cgraph_map" alt=""></center> <map name="device_8c_0002a4ec01ee11597c6751602f3e4c3d_cgraph_map"> <area href="spinlock_8h.html#2cd9a4502680fb8e7f0fe6b029e558b1" shape="rect" coords="160,81,240,108" alt=""> <area href="spinlock_8h.html#dd996cbbb3b9826dd9c8cf02b66a4c65" shape="rect" coords="152,132,248,159" alt=""> <area href="sched_8h.html#08933fe6d593a1c78b9080359f15a0b7" shape="rect" coords="296,56,397,83" alt=""> <area href="spinlock_8h.html#8f9173fadeddafa01754d6cbcc630198" shape="rect" coords="581,107,680,133" alt=""> <area href="sched_8h.html#549a0c1cc47933fa045b200690965cbd" shape="rect" coords="447,56,508,83" alt=""> <area href="sched_8h.html#e969273d772018d111e1f0344eb550f8" shape="rect" coords="557,5,704,32" alt=""> <area href="sched_8h.html#086cc0adc0b6a3860ceeeb5bc5ea94ea" shape="rect" coords="561,56,700,83" alt=""> </map> </div> </div><p> <a class="anchor" name="b6cc746d95021f087eb5aef767050e71"></a><!-- doxytag: member="device.c::device_remove" ref="b6cc746d95021f087eb5aef767050e71" args="(struct device_node *deviceToDelete)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int device_remove </td> <td>(</td> <td class="paramtype">struct <a class="el" href="structdevice__node.html">device_node</a> * </td> <td class="paramname"> <em>deviceToDelete</em> </td> <td> ) </td> <td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> <p> Definition at line <a class="el" href="device_8c-source.html#l00110">110</a> of file <a class="el" href="device_8c-source.html">device.c</a>. <p> References <a class="el" href="device_8c-source.html#l00037">devices</a>, <a class="el" href="device_8c-source.html#l00038">deviceSpinLock</a>, <a class="el" href="kmalloc_8c-source.html#l00351">kfree()</a>, <a class="el" href="device_8h-source.html#l00037">device_node::next</a>, <a class="el" href="types_8h-source.html#l00036">NULL</a>, <a class="el" href="spinlock_8c-source.html#l00056">spinLock()</a>, and <a class="el" href="spinlock_8c-source.html#l00037">spinUnlock()</a>. <p> Here is the call graph for this function:<p><center><img src="device_8c_b6cc746d95021f087eb5aef767050e71_cgraph.png" border="0" usemap="#device_8c_b6cc746d95021f087eb5aef767050e71_cgraph_map" alt=""></center> <map name="device_8c_b6cc746d95021f087eb5aef767050e71_cgraph_map"> <area href="kmalloc_8h.html#aa9ed6886459604cf73ccdbf6410e487" shape="rect" coords="179,158,235,184" alt=""> <area href="spinlock_8h.html#2cd9a4502680fb8e7f0fe6b029e558b1" shape="rect" coords="304,208,384,235" alt=""> <area href="spinlock_8h.html#dd996cbbb3b9826dd9c8cf02b66a4c65" shape="rect" coords="296,259,392,286" alt=""> <area href="kmalloc_8c.html#eb1c3f1ef8eb9063c2e5c4af488dd2d0" shape="rect" coords="283,56,405,83" alt=""> <area href="kprint_8h.html#b2761bdf0cca73ad0fb5880895210cd8" shape="rect" coords="615,107,681,134" alt=""> <area href="lib_2string_8h.html#ce4b911463887af5e748326323e99a23" shape="rect" coords="305,158,383,184" alt=""> <area href="kpanic_8h.html#db9a182aa071791a306163d50d653deb" shape="rect" coords="471,56,537,83" alt=""> <area href="8259_8h.html#2b9ec30943ddb0a2ef3bd7ccfd2026c0" shape="rect" coords="603,6,693,32" alt=""> <area href="stdarg_8h.html#621577c2df0ad5faa281223c56eeb7a5" shape="rect" coords="612,56,684,83" alt=""> <area href="vsprintf_8c.html#c2f4c669c6f6aa6caa5ab8adb1b07dd0" shape="rect" coords="777,70,852,96" alt=""> <area href="vsprintf_8c.html#3fa7c8ef8597579301cb4b5c59bc6d9a" shape="rect" coords="775,19,855,46" alt=""> <area href="sched_8h.html#08933fe6d593a1c78b9080359f15a0b7" shape="rect" coords="453,183,555,210" alt=""> <area href="spinlock_8h.html#8f9173fadeddafa01754d6cbcc630198" shape="rect" coords="765,234,864,260" alt=""> <area href="sched_8h.html#549a0c1cc47933fa045b200690965cbd" shape="rect" coords="617,183,679,210" alt=""> <area href="sched_8h.html#e969273d772018d111e1f0344eb550f8" shape="rect" coords="741,183,888,210" alt=""> <area href="sched_8h.html#086cc0adc0b6a3860ceeeb5bc5ea94ea" shape="rect" coords="745,132,884,159" alt=""> </map> </div> </div><p> <hr><h2>Variable Documentation</h2> <a class="anchor" name="90d9a2a00434982169ff5710b19a4c1c"></a><!-- doxytag: member="device.c::devices" ref="90d9a2a00434982169ff5710b19a4c1c" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">struct <a class="el" href="structdevice__node.html">device_node</a>* <a class="el" href="device_8c.html#90d9a2a00434982169ff5710b19a4c1c">devices</a> = 0x0<code> [static]</code> </td> </tr> </table> </div> <div class="memdoc"> <p> <p> Definition at line <a class="el" href="device_8c-source.html#l00037">37</a> of file <a class="el" href="device_8c-source.html">device.c</a>. <p> Referenced by <a class="el" href="device_8c-source.html#l00051">device_add()</a>, <a class="el" href="device_8c-source.html#l00086">device_find()</a>, and <a class="el" href="device_8c-source.html#l00110">device_remove()</a>. </div> </div><p> <a class="anchor" name="9c7fbb38f0fb266ba997f51da7cf8a50"></a><!-- doxytag: member="device.c::deviceSpinLock" ref="9c7fbb38f0fb266ba997f51da7cf8a50" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="spinlock_8h.html#a240e9404b4ede1e0d714610080d1176">spinLock_t</a> <a class="el" href="device_8c.html#9c7fbb38f0fb266ba997f51da7cf8a50">deviceSpinLock</a> = SPIN_LOCK_INITIALIZER<code> [static]</code> </td> </tr> </table> </div> <div class="memdoc"> <p> <p> Definition at line <a class="el" href="device_8c-source.html#l00038">38</a> of file <a class="el" href="device_8c-source.html">device.c</a>. <p> Referenced by <a class="el" href="device_8c-source.html#l00051">device_add()</a>, <a class="el" href="device_8c-source.html#l00086">device_find()</a>, and <a class="el" href="device_8c-source.html#l00110">device_remove()</a>. </div> </div><p> <hr size="1"><address style="align: right;"><small>Generated on Fri Dec 15 11:25:23 2006 for UbixOS V2 by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> </body> </html>