Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenapictimer.c
Go to the documentation of this file.
00001 /* 00002 * PROJECT: ReactOS HAL 00003 * LICENSE: GPL - See COPYING in the top level directory 00004 * FILE: hal/halx86/apic/apictimer.c 00005 * PURPOSE: System Profiling 00006 * PROGRAMMERS: Timo Kreuzer (timo.kreuzer@reactos.org) 00007 */ 00008 00009 /* INCLUDES ******************************************************************/ 00010 00011 #include <hal.h> 00012 #define NDEBUG 00013 #include <debug.h> 00014 00015 #include "apic.h" 00016 00017 extern LARGE_INTEGER HalpCpuClockFrequency; 00018 00019 /* TIMER FUNCTIONS ************************************************************/ 00020 00021 VOID 00022 NTAPI 00023 ApicSetTimerInterval(ULONG MicroSeconds) 00024 { 00025 LVT_REGISTER LvtEntry; 00026 ULONGLONG TimerInterval; 00027 00028 /* Calculate the Timer interval */ 00029 TimerInterval = HalpCpuClockFrequency.QuadPart * MicroSeconds / 1000000; 00030 00031 /* Set the count interval */ 00032 ApicWrite(APIC_TICR, (ULONG)TimerInterval); 00033 00034 /* Set to periodic */ 00035 LvtEntry.Long = 0; 00036 LvtEntry.TimerMode = 1; 00037 LvtEntry.Vector = APIC_PROFILE_VECTOR; 00038 LvtEntry.Mask = 0; 00039 ApicWrite(APIC_TMRLVTR, LvtEntry.Long); 00040 00041 } 00042 00043 VOID 00044 NTAPI 00045 ApicInitializeTimer(ULONG Cpu) 00046 { 00047 00048 /* Initialize the TSC */ 00049 //HalpInitializeTsc(); 00050 00051 /* Set clock multiplier to 1 */ 00052 ApicWrite(APIC_TDCR, TIMER_DV_DivideBy1); 00053 00054 ApicSetTimerInterval(1000); 00055 00056 // KeSetTimeIncrement 00057 } 00058 00059 00060 /* PUBLIC FUNCTIONS ***********************************************************/ 00061 00062 VOID 00063 NTAPI 00064 HalStartProfileInterrupt(IN KPROFILE_SOURCE ProfileSource) 00065 { 00066 UNIMPLEMENTED; 00067 return; 00068 } 00069 00070 VOID 00071 NTAPI 00072 HalStopProfileInterrupt(IN KPROFILE_SOURCE ProfileSource) 00073 { 00074 UNIMPLEMENTED; 00075 return; 00076 } 00077 00078 ULONG_PTR 00079 NTAPI 00080 HalSetProfileInterval(IN ULONG_PTR Interval) 00081 { 00082 UNIMPLEMENTED; 00083 return Interval; 00084 } Generated on Sat May 26 2012 04:27:22 for ReactOS by
1.7.6.1
|