<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7652.24">
<TITLE>RE: [PATCH 1/2] [v3][POWERPC] refactor dcr code</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<BR>
<BR>

<P><FONT SIZE=2>&gt; &gt; +void dcr_unmap_generic(dcr_host_t host, unsigned int dcr_c)<BR>
&gt; &gt; +{<BR>
&gt; &gt; +&nbsp;&nbsp; if (host.type == NATIVE)<BR>
&gt; &gt; +&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dcr_unmap_native(host.host.native, dcr_c);<BR>
&gt; &gt; +&nbsp;&nbsp; else<BR>
&gt; &gt; +&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dcr_unmap_mmio(host.host.mmio, dcr_c);<BR>
&gt;<BR>
&gt; What happens if host.type == INVALID?&nbsp; Same question for the other<BR>
&gt; accessors in dcr_*_generic.<BR>
<BR>
I guess looking back on it, I assumed that MAP_OK would return 0, meaning that behavior was undefined,<BR>
but I agree it's probably safer to have some error reporting there...&nbsp; There starts to become a speed tradeoff<BR>
at some point, which would make function pointers more attractive.&nbsp; If the ioremap does fail, or the<BR>
dcr-access-method can't be determined, then dcr_unmap_mmio would probably SEGV anyway, although that's<BR>
not something I'd really want to rely on.&nbsp; I'll put an error case in there.<BR>
<BR>
&gt; &gt; +enum host_type_t {MMIO, NATIVE, INVALID};<BR>
&gt;<BR>
&gt; Should these be DCR_HOST_MMIO, DCR_HOST_NATIVE, DCR_HOST_INVALID?<BR>
&gt;<BR>
&gt; I worry about the generic nature of the names.<BR>
<BR>
Also seems reasonable,<BR>
<BR>
Steve<BR>
</FONT>
</P>

</BODY>
</HTML>