Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | <!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en"> |
2 | <html> | |
3 | <head> | |
4 | <title>SPARC Architectural Model: Device and Utility API</title> | |
5 | </head> | |
6 | <body bgcolor="#ffffff" lang="en-US"> | |
7 | <h2>mmi_register_asi_action</h2> | |
8 | <h4>NAME</h4> | |
9 | <ul> | |
10 | <i>mmi_register_asi_action()</i> - Register specific ASI read/write | |
11 | handlers for module <br> | |
12 | </ul> | |
13 | <h4>SYNOPSIS</h4> | |
14 | <ul> | |
15 | <tt><font color="#0000ff">#include "mmi.h"</font></tt><span | |
16 | style="font-family: monospace;"><br> | |
17 | <br> | |
18 | /* for non-peripheral "devices" that implement ASIs */<br> | |
19 | /* register call back functions for asi load/store for a particular asi. | |
20 | */<br> | |
21 | typedef int (*mmi_ld_asi_action) (void *cbd, | |
22 | uint32_t asi, uint64_t vaddr, uint64_t *buf, int size,uint32_t cpuid);<br> | |
23 | typedef int (*mmi_st_asi_action) (void *cbd, | |
24 | uint32_t asi, uint64_t vaddr, uint64_t buf, int size,uint32_t cpuid);<br> | |
25 | void mmi_register_asi_action (mmi_instance_t instance, uint32_t asi, | |
26 | mmi_ld_asi_action ld_handler, mmi_st_asi_action st_handler); <br> | |
27 | <br> | |
28 | </span> | |
29 | </ul> | |
30 | <h4> | |
31 | DESCRIPTION</h4> | |
32 | Registers read (<big><span | |
33 | style="font-family: monospace; font-style: italic;">ld_handler) </span><span | |
34 | style="font-family: monospace;">and write(</span></big><span | |
35 | 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 | |
36 | style="font-style: italic;"><small> </small>asi<br> | |
37 | <br> | |
38 | </big></big></span>The call back object data (<span | |
39 | style="font-style: italic;">cbd</span>) which has been registered | |
40 | through <span style="font-style: italic;">mmi_ | |
41 | register_asi_cb_data</span> API and the <span | |
42 | style="font-style: italic;">vaddr </span>will also be | |
43 | passed to the <br> | |
44 | asi read/write | |
45 | handlers along with the other parameters.<span | |
46 | style="font-family: monospace;"><big><big><br> | |
47 | </big></big></span> | |
48 | <ul> | |
49 | </ul> | |
50 | <h4>RETURN VALUES</h4> | |
51 | No return value.<br> | |
52 | <h4> USAGE EXAMPLE</h4> | |
53 | <ul> | |
54 | <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> | |
55 | </ul> | |
56 | <h4 style="text-decoration: underline;">SEE ALSO</h4> | |
57 | <ul> | |
58 | <a href="mmi_register_asi_cb_data.html"><span | |
59 | style="color: rgb(51, 51, 255); text-decoration: underline;">mmi_register_asi_cb_data</span></a><br> | |
60 | <a href="intro.html">Introduction<br> | |
61 | </a> | |
62 | </ul> | |
63 | <p> | |
64 | </p> | |
65 | </body> | |
66 | </html> |