mirror of
https://github.com/reactos/reactos.git
synced 2024-09-17 16:20:20 +00:00
e1ef078741
The idea then would be to have the following behaviour (when specifying the following options in the kernel command line): /DEBUGPORT=COMi --> load KDCOM.DLL and use COMi port (i == 1,2,3,4) if possible. /DEBUGPORT=FOO --> load KDFOO.DLL (useful for KDUSB.DLL, KD1394.DLL, KDBAZIS.DLL for VirtualKD, etc...) /DEBUGPORT=ROSDBG:[COMi|SCREEN|FILE|GDB|...] --> load KDROSDBG.DLL which contains the ROS kernel debugger, and use COMi or SCREEN or... as output port. svn path=/branches/kd++/; revision=58883
85 lines
1.6 KiB
C
85 lines
1.6 KiB
C
/*
|
|
* PROJECT: ReactOS HAL
|
|
* LICENSE: GPL - See COPYING in the top level directory
|
|
* FILE: hal/halx86/apic/apictimer.c
|
|
* PURPOSE: System Profiling
|
|
* PROGRAMMERS: Timo Kreuzer (timo.kreuzer@reactos.org)
|
|
*/
|
|
|
|
/* INCLUDES ******************************************************************/
|
|
|
|
#include <hal.h>
|
|
#define NDEBUG
|
|
#include <debug.h>
|
|
|
|
#include "apic.h"
|
|
|
|
extern LARGE_INTEGER HalpCpuClockFrequency;
|
|
|
|
/* TIMER FUNCTIONS ************************************************************/
|
|
|
|
VOID
|
|
NTAPI
|
|
ApicSetTimerInterval(ULONG MicroSeconds)
|
|
{
|
|
LVT_REGISTER LvtEntry;
|
|
ULONGLONG TimerInterval;
|
|
|
|
/* Calculate the Timer interval */
|
|
TimerInterval = HalpCpuClockFrequency.QuadPart * MicroSeconds / 1000000;
|
|
|
|
/* Set the count interval */
|
|
ApicWrite(APIC_TICR, (ULONG)TimerInterval);
|
|
|
|
/* Set to periodic */
|
|
LvtEntry.Long = 0;
|
|
LvtEntry.TimerMode = 1;
|
|
LvtEntry.Vector = APIC_PROFILE_VECTOR;
|
|
LvtEntry.Mask = 0;
|
|
ApicWrite(APIC_TMRLVTR, LvtEntry.Long);
|
|
|
|
}
|
|
|
|
VOID
|
|
NTAPI
|
|
ApicInitializeTimer(ULONG Cpu)
|
|
{
|
|
|
|
/* Initialize the TSC */
|
|
//HalpInitializeTsc();
|
|
|
|
/* Set clock multiplier to 1 */
|
|
ApicWrite(APIC_TDCR, TIMER_DV_DivideBy1);
|
|
|
|
ApicSetTimerInterval(1000);
|
|
|
|
// KeSetTimeIncrement
|
|
}
|
|
|
|
|
|
/* PUBLIC FUNCTIONS ***********************************************************/
|
|
|
|
VOID
|
|
NTAPI
|
|
HalStartProfileInterrupt(IN KPROFILE_SOURCE ProfileSource)
|
|
{
|
|
UNIMPLEMENTED;
|
|
return;
|
|
}
|
|
|
|
VOID
|
|
NTAPI
|
|
HalStopProfileInterrupt(IN KPROFILE_SOURCE ProfileSource)
|
|
{
|
|
UNIMPLEMENTED;
|
|
return;
|
|
}
|
|
|
|
ULONG_PTR
|
|
NTAPI
|
|
HalSetProfileInterval(IN ULONG_PTR Interval)
|
|
{
|
|
UNIMPLEMENTED;
|
|
return Interval;
|
|
}
|