<!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="namespaces.html"><span>Namespaces</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="include_2sys_2device_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> <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="include_2sys_2device_8h-source.html#l00038">device_node::devInfo</a>, <a class="el" href="structdevice__interface.html#92620413c2580ea3cf01e121bb54c254">device_interface::init</a>, <a class="el" href="include_2sys_2device_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="include_2sys_2device_8h-source.html#l00041">device_node::minor</a>, <a class="el" href="include_2sys_2device_8h-source.html#l00037">device_node::next</a>, <a class="el" href="def_8h-source.html#l00041">NULL</a>, <a class="el" href="include_2sys_2device_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="include_2sys_2device_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>. </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="include_2sys_2device_8h-source.html#l00038">device_node::devInfo</a>, <a class="el" href="include_2sys_2device_8h-source.html#l00051">device_interface::major</a>, <a class="el" href="include_2sys_2device_8h-source.html#l00041">device_node::minor</a>, <a class="el" href="include_2sys_2device_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>. </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="include_2sys_2device_8h-source.html#l00037">device_node::next</a>, <a class="el" href="def_8h-source.html#l00041">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>. </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 Tue Dec 5 23:35:02 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>