Fennix/docs/de/d40/block_8h.html

265 lines
14 KiB
HTML

<!-- HTML header for doxygen 1.9.1-->
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=9" />
<meta name="generator" content="Doxygen 1.9.8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Fennix: Kernel/include/interface/block.h File Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../navtreedata.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
<link href="../../doxygen-awesome.css" rel="stylesheet" type="text/css"/>
<link href="../../custom.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../doxygen-awesome-darkmode-toggle.js"></script>
<script type="text/javascript" src="../../doxygen-awesome-fragment-copy-button.js"></script>
<script type="text/javascript" src="../../doxygen-awesome-paragraph-link.js"></script>
<script type="text/javascript" src="../../doxygen-awesome-interactive-toc.js"></script>
<script type="text/javascript" src="../../doxygen-awesome-tabs.js"></script>
<script type="text/javascript">
DoxygenAwesomeDarkModeToggle.init()
DoxygenAwesomeFragmentCopyButton.init()
DoxygenAwesomeParagraphLink.init()
DoxygenAwesomeInteractiveToc.init()
DoxygenAwesomeTabs.init()
</script>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="../../favicon.ico" /></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Fennix
&#160;<span
id="projectnumber">1.0.0</span>
</div>
<div id="projectbrief">Full Documentation</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part --><!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('../../',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('de/d40/block_8h.html','../../'); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle"><div class="title">block.h File Reference</div></div>
</div><!--header-->
<div class="contents">
<p><a href="../../de/d40/block_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:da/df6/structBlockDevice" id="r_da/df6/structBlockDevice"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d40/block_8h.html#da/df6/structBlockDevice">BlockDevice</a></td></tr>
<tr class="separator:da/df6/structBlockDevice"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a09eca2dff18d5b57780c356d331db570" id="r_a09eca2dff18d5b57780c356d331db570"><td class="memItemLeft" align="right" valign="top">dev_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d40/block_8h.html#a09eca2dff18d5b57780c356d331db570">RegisterBlockDevice</a> (struct <a class="el" href="../../de/d40/block_8h.html#da/df6/structBlockDevice">BlockDevice</a> *Device)</td></tr>
<tr class="memdesc:a09eca2dff18d5b57780c356d331db570"><td class="mdescLeft">&#160;</td><td class="mdescRight">Registers a block device with the kernel block subsystem. <br /></td></tr>
<tr class="separator:a09eca2dff18d5b57780c356d331db570"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa2fbd9e6d3f42f3c7f94c48795acddad" id="r_aa2fbd9e6d3f42f3c7f94c48795acddad"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d40/block_8h.html#aa2fbd9e6d3f42f3c7f94c48795acddad">UnregisterBlockDevice</a> (dev_t DeviceID)</td></tr>
<tr class="memdesc:aa2fbd9e6d3f42f3c7f94c48795acddad"><td class="mdescLeft">&#160;</td><td class="mdescRight">Unregisters a block device from the kernel block subsystem. <br /></td></tr>
<tr class="separator:aa2fbd9e6d3f42f3c7f94c48795acddad"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<hr/><h2 class="groupheader">Data Structure Documentation</h2>
<a name="da/df6/structBlockDevice" id="da/df6/structBlockDevice"></a>
<h2 class="memtitle"><span class="permalink"><a href="#da/df6/structBlockDevice">&#9670;&#160;</a></span>BlockDevice</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">struct BlockDevice</td>
</tr>
</table>
</div><div class="memdoc">
<div class="textblock">
<p class="definition">Definition at line <a class="el" href="../../de/d40/block_8h_source.html#l00029">29</a> of file <a class="el" href="../../de/d40/block_8h_source.html">block.h</a>.</p>
</div><table class="fieldtable">
<tr><th colspan="3">Data Fields</th></tr>
<tr><td class="fieldtype">
<a id="a0f27ac20f77368f3847ca934c3449239" name="a0f27ac20f77368f3847ca934c3449239"></a>size_t</td>
<td class="fieldname">
BlockCount</td>
<td class="fielddoc">
Number of blocks in the device. <p>This value is calculated as Size / BlockSize. It represents the total number of addressable blocks on the device. </p>
</td></tr>
<tr><td class="fieldtype">
<a id="a04a25b932f09124e40b427312bb51437" name="a04a25b932f09124e40b427312bb51437"></a>uint32_t</td>
<td class="fieldname">
BlockSize</td>
<td class="fielddoc">
Size of a single block in bytes. <p>All read and write operations are performed in multiples of this block size. Typical values are 512 or 4096 bytes. </p>
</td></tr>
<tr><td class="fieldtype">
<a id="ac89f7fabb9b61c6adaff880b4d300a8f" name="ac89f7fabb9b61c6adaff880b4d300a8f"></a>const char *</td>
<td class="fieldname">
Name</td>
<td class="fielddoc">
Base name of the device. <p>This name is used to identify the device in the system. It should be unique across all block devices. The kernel may append a number to this name to create a unique device name (e.g., "ahci0", "ahci1"). </p>
</td></tr>
<tr><td class="fieldtype">
<a id="a00ca2ebbf46a93847c9c56f1d9c79772" name="a00ca2ebbf46a93847c9c56f1d9c79772"></a>const <a class="el" href="../../db/de6/structInodeOperations.html">InodeOperations</a> *</td>
<td class="fieldname">
Ops</td>
<td class="fielddoc">
Pointer to the block device operations structure. <p>This structure contains function pointers for various operations that can be performed on the block device, such as read, write, and ioctl.</p>
<p>Yea, inode operations are used for block devices too. </p>
</td></tr>
<tr><td class="fieldtype">
<a id="a76a65f2f7a85cd15fff4f1a9859ca508" name="a76a65f2f7a85cd15fff4f1a9859ca508"></a>void *</td>
<td class="fieldname">
PrivateData</td>
<td class="fielddoc">
Opaque pointer to driver-specific or hardware-specific data. <p>This field allows the driver to associate private context or state with the device, such as controller registers or internal buffers. </p>
</td></tr>
<tr><td class="fieldtype">
<a id="a5c99e12972a959e55d35667b073f0338" name="a5c99e12972a959e55d35667b073f0338"></a>size_t</td>
<td class="fieldname">
Size</td>
<td class="fielddoc">
Total size of the device in bytes. <p>This value represents the total addressable storage capacity of the device. It is used for bounds checking and partitioning. </p>
</td></tr>
</table>
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="a09eca2dff18d5b57780c356d331db570" name="a09eca2dff18d5b57780c356d331db570"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a09eca2dff18d5b57780c356d331db570">&#9670;&#160;</a></span>RegisterBlockDevice()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">dev_t RegisterBlockDevice </td>
<td>(</td>
<td class="paramtype">struct <a class="el" href="../../de/d40/block_8h.html#da/df6/structBlockDevice">BlockDevice</a> *&#160;</td>
<td class="paramname"><em>Device</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Registers a block device with the kernel block subsystem. </p>
<p>This function should be called by block device drivers after initializing a device. The kernel will take ownership of the device structure and assign it a unique device ID. The device will then be accessible for filesystem mounting and I/O operations.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">Device</td><td>Pointer to a fully initialized <a class="el" href="../../de/d40/block_8h.html#da/df6/structBlockDevice">BlockDevice</a> structure. All required fields must be set and valid for the lifetime of the device. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Device ID (dev_t) assigned by the kernel on success, or an error code on failure. </dd></dl>
</div>
</div>
<a id="aa2fbd9e6d3f42f3c7f94c48795acddad" name="aa2fbd9e6d3f42f3c7f94c48795acddad"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa2fbd9e6d3f42f3c7f94c48795acddad">&#9670;&#160;</a></span>UnregisterBlockDevice()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int UnregisterBlockDevice </td>
<td>(</td>
<td class="paramtype">dev_t&#160;</td>
<td class="paramname"><em>DeviceID</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Unregisters a block device from the kernel block subsystem. </p>
<p>This function should be called by drivers when a device is being removed or is no longer available. The kernel will release any resources associated with the device and invalidate its device ID.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">DeviceID</td><td>The device ID (dev_t) previously returned by <a class="el" href="../../de/d40/block_8h.html#a09eca2dff18d5b57780c356d331db570" title="Registers a block device with the kernel block subsystem.">RegisterBlockDevice()</a>. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success, or an error code. </dd></dl>
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_52bed8acfaac088d5968cb2c84d7645d.html">Kernel</a></li><li class="navelem"><a class="el" href="../../dir_2c335c1ccbf6ef7c89cc08c9ed88be2e.html">include</a></li><li class="navelem"><a class="el" href="../../dir_811a06ffcfc34bd0f88967f0406a39f5.html">interface</a></li><li class="navelem"><a class="el" href="../../de/d40/block_8h.html">block.h</a></li>
<li class="footer">Generated on Sun May 18 2025 20:18:23 for Fennix by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8 </li>
</ul>
</div>
</body>
</html>