mdprof.c

来自「WinCE 3.0 BSP, 包含Inter SA1110, Intel_815」· C语言 代码 · 共 63 行

C
63
字号
/*++
THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE.
Copyright (c) 1995-2000 Microsoft Corporation.  All rights reserved.

Module Name:  mdprof.c

Abstract:  
 This file implements the platform specific profiler support 

Functions:


Notes: 

--*/
#include "windows.h"
#include "nkintr.h"

extern int ProfileInterrupt(void);
extern int Timer2ISR(void);
extern int P2ISR(void);
extern void ProfileTimerStart(DWORD);
extern void ProfileTimerStop(void);

extern DWORD ReschedCount;
extern DWORD ReschedCountMax;


void 
OEMProfileTimerEnable(
    DWORD dwUSec
    )
{
#ifdef R3912
    ReschedCount=ReschedCountMax=25;
    ProfileTimerStart(576);
    HookInterrupt (2, ProfileInterrupt);
#endif
#if defined(R4100) || defined(R4300) || defined(IDT32364)
    ReschedCountMax=0;
    ReschedCount=100;
    ProfileTimerStart(1500);
    HookInterrupt(5,ProfileInterrupt);
#endif
}

void OEMProfileTimerDisable(void) {
    ProfileTimerStop();

#ifdef R3912
    UnhookInterrupt(2, ProfileInterrupt);
    HookInterrupt(2,P2ISR);
#endif
#if defined(r4100) || defined(R4300) || defined(IDT32364)
    UnhookInterrupt(5,ProfileInterrupt);
    HookInterrupt(5, Timer2ISR);
#endif
}

⌨️ 快捷键说明

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