⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 windows ce下驱动程序开发基础(3)_3.htm

📁 wince 电池电源管理文件集 wince 电池电源管理文件集
💻 HTM
📖 第 1 页 / 共 5 页
字号:

<SCRIPT type=text/javascript>//<!--_S_pSt("");//--></SCRIPT>
<!-- SUDA_CODE_END -->
<CENTER><!--导航start-->
<STYLE>.h3 {
	FONT-SIZE: 7px; COLOR: #ffbd00
}
</STYLE>

<TABLE cellSpacing=0 cellPadding=0 width=750 border=0>
  <TBODY>
  <TR>
    <TD>
      <SCRIPT>
function getCookie(name) {

  var search;

  search = name + "="
  offset = document.cookie.indexOf(search) 
  if (offset != -1) {
    offset += search.length ;
    end = document.cookie.indexOf(";", offset) ;
    if (end == -1)
      end = document.cookie.length;
    return document.cookie.substring(offset, end);
  }
  else
    return "";
}

function unipro_clearCookie(name ) {
	document.cookie=name+"=; " + "domain=sina.com.cn; path=/; ";     
	//bites = document.cookie.split("; ");
} 

function getMobileNum(ckName){
var userInfo = getCookie(ckName).split(":");
	return userInfo[2];
}

function unipro_UniProLogout() {
	unipro_clearCookie("SINAPRO");
	unipro_clearCookie("SINA-AVATAR");
	unipro_clearCookie("SINAPROC");
	unipro_clearCookie("nick");
	unipro_clearCookie("SINA_NU");      
	unipro_clearCookie("SINA_OU");
	unipro_clearCookie("appmask");
	unipro_clearCookie("gender");
	unipro_clearCookie("UNIPROTM");
	unipro_clearCookie("UNIPROU");
	unipro_clearCookie("SINA_USER");
	unipro_clearCookie("SMS_COOKIE");
	return true;
}

function getUniproUrl_stand(){
	window.location='http://unipro.sina.com.cn/';
	return false;
}

function getUniproUrl_welcome(){
	unipro_UniProLogout();
	window.location='http://unipro.sina.com.cn';
	return false;	
}

function print_stand_unipro_head()
{
	document.write("<table border=0 cellpadding=0 cellspacing=0><tr align=center><td><a href=http://www.sina.com.cn class=a01>首页</a></td><td width=14></td><td><a href=http://news.sina.com.cn class=a01>新闻</a></td><td width=14></td><td><a href=http://sports.sina.com.cn class=a01>体育</a></td><td width=14></td><td><a href=http://ent.sina.com.cn class=a01>娱乐</a></td><td width=14></td><td><a href=http://bn.sina.com.cn/ class=a01>视频</a></td><td width=14></td><td><a href=http://finance.sina.com.cn/ class=a01>财经</a></td><td width=14></td><td><a href=http://tech.sina.com.cn/ class=a01>科技</a></td><td width=14></td><td><a href=http://auto.sina.com.cn/ class=a01>汽车</a></td><td width=14></td><td><a href=http://house.sina.com.cn/ class=a01><font color=red>房产</font></a></td><td width=14></td><td><a href=http://games.sina.com.cn class=a01>游戏</a></td><td width=14></td><td><a href=http://eladies.sina.com.cn/ class=a01>女性</a></td><td width=14></td><td><a href=http://book.sina.com.cn/ class=a01>读书</a><td width=14></td><td><a href=http://y.sina.com.cn/ class=a01>校园</a></td><td width=14></td><td><a href=http://weather.sina.com.cn/ class=a01>天气</a></td><td width=14></td><td><a href=http://sms.sina.com.cn class=a01>短信</a></td><td width=14></td><td><a href=http://mail.sina.com.cn class=a01>邮箱</a></td><td width=14></td><td><a href=http://search.sina.com.cn class=a01>搜索</a></td><td width=14></td><td><a href=http://news.sina.com.cn/guide/ class=a01>导航</a></td><td width=14></td></tr></table>");
	
	document.write("</td><td align=right>");
	
	document.write("<table height=25 border=0 cellpadding=0 cellspacing=0>");	
	document.write("<tr><td><td align=right> <a href=# onClick='return getUniproUrl_stand()'>通行证登录</a></td></tr>");	
	document.write("</table>");	
	
}

function print_stand_unipro_welcome()
{
	var unipro_login_nickname = getCookie( "nick" );
	var unipro_login_pos = unipro_login_nickname.indexOf( "(" );
	if ( unipro_login_pos != -1 )
	{
		unipro_login_nickname = unipro_login_nickname.substr( 0, unipro_login_pos );
	}
	
	document.write("<table border=0 cellpadding=0 cellspacing=0><tr align=center><td><a href=http://www.sina.com.cn class=a01>首页</a></td><td width=14></td><td><a href=http://news.sina.com.cn class=a01>新闻</a></td><td width=14></td><td><a href=http://sports.sina.com.cn class=a01>体育</a></td><td width=14></td><td><a href=http://ent.sina.com.cn class=a01>娱乐</a></td><td width=14></td><td><a href=http://bn.sina.com.cn/ class=a01>视听</a></td><td width=14></td><td><a href=http://finance.sina.com.cn/ class=a01>财经</a></td><td width=14></td><td><a href=http://tech.sina.com.cn/ class=a01>科技</a></td><td width=14></td><td><a href=http://auto.sina.com.cn/ class=a01>汽车</a></td><td width=14></td><td><a href=http://house.sina.com.cn/ class=a01><font color=red>房产</font></a></td><td width=14></td><td><a href=http://games.sina.com.cn class=a01>游戏</a></td><td width=14></td><td><a href=http://weather.sina.com.cn/ class=a01>天气</a></td><td width=14></td><td><a href=http://sms.sina.com.cn class=a01>短信</a></td><td width=14></td><td><a href=http://mail.sina.com.cn class=a01>邮箱</a></td><td width=14></td><td><a href=http://search.sina.com.cn class=a01>搜索</a></td><td width=14></td><td><a href=http://news.sina.com.cn/guide/ class=a01>导航</a></td><td width=14></td><td></td></tr></table>");
	
	document.write("</td><td align=right>");
	
	document.write("<table border=0 cellpadding=0 cellspacing=0>");
	document.write("<tr>");
	
	if ( unipro_login_nickname!="" && unipro_login_nickname!="null" && unipro_login_nickname!=null && unipro_login_nickname!="undefined" ) {
		document.write("<td align=right> "+unipro_login_nickname+"</td><td width=4></td><td><a href=# onClick='return getUniproUrl_welcome()'><font color=#0000ff>安全退出</font></a>");
	} else {
		document.write( "<td align=right> 新浪过客" +"</td><td width=4></td><td><a href=# onClick='return getUniproUrl_welcome()'><font color=#0000ff>安全退出</font></a>");
	}
	document.write("</td></tr>");
	document.write("</table>");
}
</SCRIPT>

      <SCRIPT language=javascript>
if (getCookie("SINAPRO") == "") {
	print_stand_unipro_head();

} else {

	print_stand_unipro_welcome();

}
</SCRIPT>
    </TD></TR></TBODY></TABLE><!--导航end--><!--头部结束--><!--科技新闻内页顶部通栏开始--><!--6793569021D5--><A 
href="http://ad.cn.doubleclick.net/clk;14775613;10960139;g?http://www-900.ibm.com/cn/software/tivoli/" 
target=_blank><IMG height=80 src="Windows CE下驱动程序开发基础(3)_3.files/12499.gif" 
width=750 border=0></A><!--$$ weixing/2005-3-25 ~ 2005-3-25/B $--> <!--科技新闻内页顶部通栏结束-->
<TABLE cellSpacing=0 cellPadding=0 width=750 border=0>
  <TBODY>
  <TR>
    <TD width=150 height=34><A href="http://tech.sina.com.cn/"><IMG height=34 
      alt=科技时代 src="Windows CE下驱动程序开发基础(3)_3.files/sina_kjsd.gif" width=144 
      border=0></A></TD>
    <TD vAlign=bottom width=440><FONT color=#0000ff><A class=a02 
      href="http://home.sina.com.cn/">新浪首页</A> &gt; <A class=a02 
      href="http://tech.sina.com.cn/">科技时代</A> &gt; <A class=a02 
      href="http://tech.sina.com.cn/s_h/news/">软件</A> &gt; 正文</FONT></TD>
    <TD vAlign=bottom align=right width=150><A href="http://www.yesky.com/" 
      target=_blank><IMG height=28 
      src="Windows CE下驱动程序开发基础(3)_3.files/U1084P2T50D213F629DT20041213105743.gif" 
      border=0></A></TD>
    <TD width=10></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width=750 border=0>
  <TBODY>
  <TR>
    <TD height=8></TD></TR>
  <TR>
    <TD bgColor=#747474 height=1><IMG height=1 
      src="Windows CE下驱动程序开发基础(3)_3.files/c.gif" width=1></TD></TR></TBODY></TABLE>
<DIV id=outer style="WIDTH: 750px; POSITION: relative">
<TABLE cellSpacing=0 cellPadding=0 width=750 border=0>
  <TBODY>
  <TR>
    <TD vAlign=top align=middle width=620 bgColor=#edf0f5 rowSpan=2><BR>
      <DIV id=article>
      <TABLE cellSpacing=0 cellPadding=0 width=560 border=0>
        <TBODY>
        <TR>
          <TH class=f24><FONT color=#05006c>
            <H1>Windows CE下驱动程序开发基础(3)</H1></FONT></TH></TR>
        <TR>
          <TD>
            <HR SIZE=1 bgcolor="#d9d9d9">
          </TD></TR>
        <TR>
          <TD align=middle height=20>http://www.sina.com.cn 
            2005年03月25日&nbsp;18:21 <FONT color=#a20010>天极yesky</FONT></TD></TR>
        <TR>
          <TD height=15></TD></TR>
        <TR>
          <TD class=l17><FONT class=f14 id=zoom><!-- 正文内部文字导航 : begin --><!-- 正文内部文字导航 : end -->
            <P>  文/付林林</P>
            <P></P>
            <P>  在这里顺便提一下可安装ISR,读者在我以前发表的关于OAL的文章中可以了解到OEM在OEMInit函数中关联IRQ和SysIntr,当硬件设备发生中断时,ISR会禁止同级和低级中断,然后根据IRQ返回关联的SysIntr,内核根据ISR返回的SysIntr唤醒相应的IST(SysIntr与IST创建的Event关联),IST处理中断之后调用InterruptDone解除中断禁止。在OEMInit中关联的缺点是一旦编译了CE内核后就无法添加这种关联了,而一些硬件设备会随时插拔或者共享中断,要关联这样的硬件设备解决方法就是可安装ISR,可安装ISR专用于处理指定的硬件设备发出的中断,所以如果硬件设备需要可安装ISR必须在注册表中添加IsrDll、IsrHandler。多数硬件设备采用CE默认的可安装ISR 
            giisr.dll,格式如下:<BR><BR></P>
            <P>
            <TABLE borderColor=#ffcc66 width="90%" align=center bgColor=#dadacf 
            border=1>
              <TBODY>
              <TR>
                <TD>"IsrDll"="giisr.dll"<BR><BR>"IsrHandler"="ISRHandler"</TD></TR></TBODY></TABLE></P>
            <P><BR>  如果一个硬件驱动程序需要可安装ISR而开发者又不想自己写一个,那么可以利用giisr.dll来实现。除了在注册表中添加如上所示外,还要在驱动程序中调用相关函数注册可安装ISR。伪代码如下:<BR><BR></P>
            <P>
            <TABLE borderColor=#ffcc66 width="90%" align=center bgColor=#dadacf 
            border=1>
              <TBODY>
              <TR>
                <TD>g_IsrHandle = LoadIntChainHandler(IsrDll, IsrHandler, 
                  (BYTE)Irq);<BR><BR>GIISR_INFO Info;<BR><BR>PHYSICAL_A<A 
                  class=akey 
                  href="http://tech.sina.com.cn/n/2005-01-25/1743514596.shtml" 
                  target=_blank>DDR</A>ESS PortAddress = {PhysAddr, 
                  0};<BR><BR>TransBusAddrToStatic(BusType, dwBusNumber, 
                  PortAddress, dwAddrLen, &amp;dwI<A class=akey 
                  href="http://tech.sina.com.cn/n/2005-01-26/1337515552.shtml" 
                  target=_blank>OS</A>pace, 
                  &amp;(PVOID)PhysAddr)<BR><BR>Info.SysIntr = 
                  dwSysIntr;<BR><BR>Info.CheckPort = TRUE;<BR><BR>Info.PortIsIO 
                  = (dwIOSpace) ? TRUE : FALSE;<BR><BR>Info.UseMaskReg = 
                  TRUE;<BR><BR>Info.PortAddr = PhysAddr + 
                  0x0C;<BR><BR>Info.PortSize = 
                  sizeof(DWORD);<BR><BR>Info.MaskAddr = PhysAddr + 
                  0x10;<BR><BR>KernelLibIoControl(g_IsrHandle, IOCTL_GIISR_INFO, 
                  &amp;Info, sizeof(Info), NULL, 0, 
            NULL);</TD></TR></TBODY></TABLE></P>
            <P><BR>  LoadIntChainHandler函数负责注册可安装ISR,参数1为DLL名称,参数2为ISR函数名称,参数3为IRQ。TransBusAddrToStatic函数在后面讲。如果要利用giisr.dll作为可安装ISR,必须先填充GIISR_INFO结构体,CheckPort=TRUE表示giisr要检测指定的寄存器来确定当前发出中断的是否是这个设备。PortIsIO表示寄存器地址属于哪个地址空间,FALSE表示是内定空间,TRUE表示IO空间。UseMaskReg=TRUE表示设备有一个掩码寄存器,专用于指定当前设备是否是中断源,也就是发出中断,而MaskAddr表示掩码寄存器的地址。如果对Info.Mask赋值,那么PortAddr表示一个特殊的寄存器地址,这个寄存器的值与Mask的值&amp;运算的结果如果为真,则证明当前设备是中断源,否则返回SYSINTR_CHAIN(表示当前ISR没有处理中断,内核将调用ISR链中下一个ISR),如果UseMaskReg=TRUE,那么MaskReg寄存器的值与PortAddr指定的寄存器的值&amp;运算的结果如果为真,则证明当前设备是中断源。<BR><BR>
            <P align=right><A style="FONT-SIZE: 14px" 
            href="http://tech.sina.com.cn/s/s/2005-03-25/1821562034.shtml">[上一页]</A>&nbsp;&nbsp;<A 
            href="http://tech.sina.com.cn/s/s/2005-03-25/1821562033.shtml">[1]</A>&nbsp;&nbsp;<A 
            href="http://tech.sina.com.cn/s/s/2005-03-25/1821562034.shtml">[2]</A>&nbsp;&nbsp;[3]&nbsp;&nbsp;<A 
            href="http://tech.sina.com.cn/s/s/2005-03-25/1821562036.shtml">[4]</A>&nbsp;&nbsp;<A 
            href="http://tech.sina.com.cn/s/s/2005-03-25/1821562037.shtml">[5]</A>&nbsp;&nbsp;<A 
            style="FONT-SIZE: 14px" 
            href="http://tech.sina.com.cn/s/s/2005-03-25/1821562036.shtml">[下一页]</A></P>
            <TABLE width="90%" align=center border=0>
              <TBODY>
              <TR></TR></TBODY></TABLE><BR clear=all>
            <TABLE cellSpacing=0 cellPadding=0 width=565 border=0>
              <TBODY>
              <TR>
                <TD class=f14 vAlign=top height=30>  点击此处查询<A 
                  href="http://chanews.sina.com.cn/s.cgi?k=keyword&amp;c=2&amp;k=Windows" 
                  target=_blank CE>全部<FONT color=red>Windows CE</FONT>新闻</A> 
              </TD></TR></TBODY></TABLE></FONT></TD></TR></TBODY></TABLE></DIV><BR>
      <TABLE cellSpacing=0 cellPadding=0 width=560 border=0>
        <TBODY>
        <TR>
          <TD>
            <TABLE cellSpacing=0 cellPadding=0 width=565 border=0>
              <TBODY>
              <TR>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -