Home |
RTTarget-32 Programming Manual System Management BIOS (SMBIOS) Advanced Programmable Interrupt Controller (APIC) Function RTMPInitAPICTimer Function RTMPTablePCIInterrupt |
Function RTMPInitAPICTimerRTMPInitAPICTimer initializes and starts the timer on a local APIC: UINT RTTAPI RTMPInitAPICTimer(UINT CPU, UINT BusClock, UINT Period, BYTE Vector, int Mode); ParametersCPUSpecifies the zero-based index of a CPU previously started with RTMPStartCPU. The local APIC of this CPU is programmed. BusClockThe external clock of the CPU in Hz. Systems with a System Management BIOS can use function RTSMBIOSGetBusSpeed to query the bus clock in MHz. Otherwise, if the CPU's internal clock is known, function RTMPBusFromCPUClock can be used. PeriodThe timer interval in microseconds or milliseconds if mode RT_APIC_ONESHORT_MS is specified. VectorThe interrupt vector on which timer interrupts shall be delivered. If Vector is in the range of vectors used by IRQs (0x40 .. 0x5F), that IRQ is disabled. Thus, specifying the vector of IRQ 0 (vector 0x40) will cause the APIC timer to replace the legacy PC timer. ModeThe mode in which the timer should operate. One of these values must be specified:
return valueZero on failure and non-zero otherwise. The function requires APIC mode and will call RTMPSetAPICMode(0) if in PIC mode. If a vector other than 0x40 is used, applications must install a handler on the requested vector to handle timer interrupts before this function is called. The supported range of periods depends on the external clock of the CPU. For example, if the bus clock is 200MHz, the supported periods range from 1 microsecond to about 22 minutes.
|