<!doctype html public
"-//w3c//dtd html 4.0 transitional//en">
<title>SPARC Architectural Model: Device and Utility API
</title>
<body bgcolor=
"#FFFFFF" LANG=
"en-US">
<ul><i>mmi_map_physio()
</i> - Add mapping for module in I/O space
</ul>
<font color=
"#0000FF">#include
"mmi.h"</font>
<p>typedef int (*
<i>mmi_access
</i>)
<br>
(uint32_t
<i>cpu_id
</i>, void*
<i>obj
</i>, uint64_t
<i>paddr
</i>,
bool_t
<i>wr
</i>, uint32_t
<i>size
</i>, uint64_t*
<i>buf
</i>, uint8_t
<i>bytemask
</i>)
<p>int mmi_map_physio (uint64_t
<i>base
</i>, uint64_t
<i>size
</i>, void*
<i>obj
</i>, mmi_access
<i>access
</i>)
<ul>Creates a mapping for
<i>obj
</i> at
<i>base
</i> for
<i>size
</i> bytes.
</ul>
<ul>CPU I/O space accesses in this range call
<i>access
</i>, with
<i>obj
</i> and parameters for the I/O access.
</ul>
<ul>Returns true if successful.
</ul>
sgc_access(uint32_t cpu_id, void* obj, uint64_t paddr, bool_t wr, uint32_t size, uint64_t* buf)
SerengetiConsole* s = (SerengetiConsole*) obj;
return s-
>access(cpu_id, obj, paddr, wr, size, buf);
SerengetiConsole::SerengetiConsole()
mmi_map_physio(
0x7fff0000000ULL,
0x10000000ULL, this, sgc_access);
<ul><a href=
"intro.html">Introduction
</a></ul>