zoukankan      html  css  js  c++  java
  • 从时钟中断到线程调度的分析(二)

        既然时钟中断函数是HalpClockInterrupt,那就从它开始研究,WRK没有公布它,还是从reactos开始看吧,reactos是仿windows,所以可能和windows原版有些差别,不过差别不大

    VOID FASTCALL HalpClockInterruptHandler(IN PKTRAP_FRAME TrapFrame)
    {
        ULONG LastIncrement;
        KIRQL Irql;3
    
        /* Enter trap */
        KiEnterInterruptTrap(TrapFrame);
    
        /* Start the interrupt */
        if (ghhghhjvc(CLOCK2_LEVEL, PRIMARY_VECTOR_BASE, &Irql))
        {
            /* Update the performance counter */
            HalpPerfCounter.QuadPart += HalpCurrentRollOver;
            HalpPerfCounterCutoff = KiEnableTimerWatchdog;
    
            /* Save increment */
            LastIncrement = HalpCurrentTimeIncrement;
    
            /* Check if someone changed the time rate */
            if (HalpClockSetMSRate)
            {
                /* Update the global values */
                HalpCurrentTimeIncrement = HalpRolloverTable[HalpNextMSRate - 1].Increment;
                HalpCurrentRollOver = HalpRolloverTable[HalpNextMSRate - 1].RollOver;
    
                /* Set new timer rollover */
                HalpSetTimerRollOver((USHORT)HalpCurrentRollOver);
    
                /* We're done */
                HalpClockSetMSRate = FALSE;
            }
    
            /* Update the system time -- the kernel will exit this trap  */
            KeUpdateSystemTime(TrapFrame, LastIncrement, Irql);  更新系统时间
        } 
    
        /* Spurious, just end the interrupt */
        KiEoiHelper(TrapFrame);
    }

         时钟中断最后会调用KeUpdateSystemTime,所以看看这个函数是干嘛的

  • 相关阅读:
    rapidjson 的练习
    在Struts2中集成Spring详细讲解
    AJAX实例入门
    Redhat Enterprise Linux中如何关闭SELinux?
    C3P0连接池详细配置
    hibernate中load,get;find,iterator;merge,saveOrUpdate,lock的区别
    107个常用Javascript语句
    车祸 shit
    JAVASCRIPT实现XML分页
    javabeans的运用
  • 原文地址:https://www.cnblogs.com/testvt/p/5492994.html
Copyright © 2011-2022 走看看