Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / docs / mmi / mmi_register_instance_creator.html
CommitLineData
920dae64
AT
1<html>
2<head>
3 <title>SPARC Architectural Model: Device and Utility API</title>
4</head>
5<body bgcolor="#FFFFFF" LANG="en-US">
6
7<div STYLE="margin-bottom: 0cm"></div>&nbsp;
8
9<h2>
10mmi_register_instance_creator
11</h2>
12
13<h4>
14NAME</h4>
15
16<ul>
17mmi_register_instance_creator - Register function to instantiate a module
18</ul>
19
20<h4>SYNOPSIS</h4>
21<tt>
22<ul><font color="#0000FF">#include "mmi.h"</font>
23<p>typedef int (*mmi_instance_creator)(const char* module_name, const char* instance_name)
24<p>mmi_bool_t mmi_register_instance_creator (const char* module_name, mmi_instance_creator creator)
25</ul>
26</tt>
27
28<h4>
29DESCRIPTION</h4>
30
31<ul><i>mmi_register_instance_creator()</i> registers
32with SAM the function that is to be called to instantiate a module.
33The call to <i>mmi_register_instance_creator</i> typically occurs from the
34<i>_init()</i> function when a shared library
35is loaded or from an initalization sequence for statically linked libraries.
36
37<p>
38The instance creator function that is registered is called by SAM whenever
39a new instance of the module is instantiated (for example, upon a <tt>sysconf</tt> directive)
40
41<p>
42<i>module_name</i> is the name of the module, and
43<i>creator</i> is a pointer to the instance creator function defined within the
44module.
45</ul>
46
47<h4>
48RETURN VALUES</h4>
49
50<ul><i>mmi_register_instance_creator()</i> returns true when successful
51and false when there is an error.</ul>
52
53<h4>ERRORS</h4>
54
55<ul><i>mmi_register_instance_creator()</i> will fail if the module_name is not recognized.</ul>
56
57<h4>SEE ALSO</h4>
58<ul><a href="intro.html">Introduction</a></ul>
59<ul><a href="mmi_register_instance.html">mmi_register_instance</a></ul>
60<p>
61
62<p>
63<hr>
64
65</body>
66</html>