Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / docs / mmi / mmi_register_instance_creator.html
<html>
<head>
<title>SPARC Architectural Model: Device and Utility API</title>
</head>
<body bgcolor="#FFFFFF" LANG="en-US">
<div STYLE="margin-bottom: 0cm"></div>&nbsp;
<h2>
mmi_register_instance_creator
</h2>
<h4>
NAME</h4>
<ul>
mmi_register_instance_creator - Register function to instantiate a module
</ul>
<h4>SYNOPSIS</h4>
<tt>
<ul><font color="#0000FF">#include "mmi.h"</font>
<p>typedef int (*mmi_instance_creator)(const char* module_name, const char* instance_name)
<p>mmi_bool_t mmi_register_instance_creator (const char* module_name, mmi_instance_creator creator)
</ul>
</tt>
<h4>
DESCRIPTION</h4>
<ul><i>mmi_register_instance_creator()</i> registers
with SAM the function that is to be called to instantiate a module.
The call to <i>mmi_register_instance_creator</i> typically occurs from the
<i>_init()</i> function when a shared library
is loaded or from an initalization sequence for statically linked libraries.
<p>
The instance creator function that is registered is called by SAM whenever
a new instance of the module is instantiated (for example, upon a <tt>sysconf</tt> directive)
<p>
<i>module_name</i> is the name of the module, and
<i>creator</i> is a pointer to the instance creator function defined within the
module.
</ul>
<h4>
RETURN VALUES</h4>
<ul><i>mmi_register_instance_creator()</i> returns true when successful
and false when there is an error.</ul>
<h4>ERRORS</h4>
<ul><i>mmi_register_instance_creator()</i> will fail if the module_name is not recognized.</ul>
<h4>SEE ALSO</h4>
<ul><a href="intro.html">Introduction</a></ul>
<ul><a href="mmi_register_instance.html">mmi_register_instance</a></ul>
<p>
<p>
<hr>
</body>
</html>