Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / docs / mmi / mmi_register_asi_action.html
<!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<title>SPARC Architectural Model: Device and Utility API</title>
</head>
<body bgcolor="#ffffff" lang="en-US">
<h2>mmi_register_asi_action</h2>
<h4>NAME</h4>
<ul>
<i>mmi_register_asi_action()</i> - Register specific ASI read/write
handlers for module <br>
</ul>
<h4>SYNOPSIS</h4>
<ul>
<tt><font color="#0000ff">#include "mmi.h"</font></tt><span
style="font-family: monospace;"><br>
<br>
/* for non-peripheral "devices" that implement ASIs */<br>
/* register call back functions for asi load/store for a particular asi.
*/<br>
typedef int&nbsp; (*mmi_ld_asi_action)&nbsp;&nbsp;&nbsp; (void *cbd,
uint32_t asi, uint64_t vaddr, uint64_t *buf, int size,uint32_t cpuid);<br>
typedef int&nbsp; (*mmi_st_asi_action)&nbsp;&nbsp;&nbsp; (void *cbd,
uint32_t asi, uint64_t vaddr, uint64_t buf, int size,uint32_t cpuid);<br>
void mmi_register_asi_action (mmi_instance_t instance, uint32_t asi,
mmi_ld_asi_action ld_handler, mmi_st_asi_action st_handler); <br>
<br>
</span>
</ul>
<h4>
DESCRIPTION</h4>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Registers read (<big><span
style="font-family: monospace; font-style: italic;">ld_handler) </span><span
style="font-family: monospace;">and write(</span></big><span
style="font-family: monospace;"><big><span style="font-style: italic;">st_handler</span></big>)<big><big style="font-style: italic;"><small> </small></big><big><small>call back functions for a particular</small></big><big
style="font-style: italic;"><small> </small>asi<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;</big></big></span>The call back object data (<span
style="font-style: italic;">cbd</span>) which has been registered&nbsp;
through&nbsp; <span style="font-style: italic;">mmi_
register_asi_cb_data</span> API and the <span
style="font-style: italic;">vaddr&nbsp; </span>will also be&nbsp;
passed to the <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; asi read/write
handlers along with the other parameters.<span
style="font-family: monospace;"><big><big><br>
</big></big></span>
<ul>
</ul>
<h4>RETURN VALUES</h4>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; No return value.<br>
<h4> USAGE EXAMPLE</h4>
<ul>
<pre>extern "C" int rock_siu_asi_read_handler(void *cbd, uint32_t asi, uint64_t vaddr, uint64_t *buf, int size,uint32_t strandId){<br> return Rock_Siu::asiReadHandler(cbd,asi,vaddr,buf,size,strandId);<br>}<br>extern "C" int rock_siu_asi_write_handler(void *cbd, uint32_t asi, uint64_t vaddr, uint64_t buf,int size, uint32_t strandId){<br> return Rock_Siu::asiWriteHandler(cbd,asi,vaddr,buf,size,strandId);<br>}<br><br><br>bool<br>Rock_Siu::check_args() {<br> mmi_register_asi_cb_data(instance, this);<br> mmi_register_asi_action(instance, Rock_Imu::ASI_QUEUE,rock_siu_asi_read_handler,rock_siu_asi_write_handler);<br>}<br><br></pre>
</ul>
<h4 style="text-decoration: underline;">SEE ALSO</h4>
<ul>
<a href="mmi_register_asi_cb_data.html"><span
style="color: rgb(51, 51, 255); text-decoration: underline;">mmi_register_asi_cb_data</span></a><br>
<a href="intro.html">Introduction<br>
</a>
</ul>
<p>
</p>
</body>
</html>