On Time RTOS-32 Documentation
Welcome
RTTarget-32
RTTarget-32 Programming Manual
RTTarget-32 Reference Manual
Introduction
RTTarget-32 Configuration
Screen I/O
Interrupt Handling
Port I/O
System Functions
Program Loading
Memory Mapping and Management
Real-Time Clock and CMOS RAM
Keyboard
Mouse and Touch Screen Driver
Parallel Port Printer
Serial Port I/O
PCI BIOS
Plug-and-Play BIOS
PC Cards (PCMCIA)
MetaWINDOW Initialization
Run-Time System Support
System Management BIOS (SMBIOS)
Advanced Programmable Interrupt Controller (APIC)
Function RTMPSetAPICMode
Function RTMPIsAPICMode
Function RTMPSetAPICModeACPI
Function RTMPSetPICMode
Function RTMPSetIOAPICVector
Function RTMPSendIPInterrupt
Function RTMPInitAPICTimer
Function RTMPBusFromCPUClock
Function RTMPDumpInfo
Function RTMPTableCreate
Function RTMPTableCPUEx
Function RTMPTableIOAPIC
Function RTMPTableBus
Function RTMPTableInterrupt
Function RTMPTablePCIInterrupt
Function RTMPTableCPU
Function RTMPACPITableCreate
Function RTMPSetupMSI
Function RTMPBalanceINTCPUs
Multiprocessor Management
Spinlocks
Advanced Configuration and Power Interface (ACPI) Tables
Extended RAM Management
RTVmf-32
RTRth-32
RTKernel-32
RTFiles-32
RTIP-32
RTPEG-32
RTUSB-32
|
Function RTMPSetAPICMode
RTMPSetAPICMode switches to APIC mode:
int RTMPSetAPICMode(DWORD Flags);
ParametersFlagsZero or a combination of the following flag values:
Value |
Meaning |
RT_APIC_TRUST_MPFPS |
Trust the BIOS' MP Floating Pointer Structure. The table is published by the BIOS and contains information about how IRQs of various system components are routed. Unfortunately, these tables frequently contain errors which RTMPSetAPICMode will attempt to recognize and fix. Use this flag to prevent all such fixes. |
RT_APIC_ASSUME_LEGACY_MAP |
This flag instructs RTMPSetAPICMode to assume that the IRQ mapping of the first IOAPIC is identical to the IRQ mapping of the legacy PICs. RTMPSetAPICMode will automatically set this flag if there is no IRQ > 15 and flag RT_APIC_TRUST_MPFPS has not been specified. |
RT_APIC_USE_LEGACY_MAP |
This flag instructs RTMPSetAPICMode to assign the same IRQs to PCI devices as they have in PIC mode. If this flag is not set, the IRQs of PCI devices may be reassigned. RT_APIC_USE_LEGACY_MAP prevents IRQs > 15 being used. |
RT_APIC_NO_HYPERTHREAD |
This flag instructs RTMPSetAPICMode to ignore Hyperthread logical CPUs. Please note that function RTMPCPUs also evaluates this flag before APIC mode has been entered. Once in APIC mode, Hyperthread support is only determined by this flag passed to RTMPSetAPICMode. |
RT_APIC_FIXED_INT_ROUTING |
RT_APIC_FIXED_INT_ROUTING instructs RTMPSetAPICMode to use Fixed CPU Delivery Mode instead of Lowest Priority Delivery Mode for interrupts. If set, all interrupts are initially routed to the boot CPU. The application can reassign target CPUs of interrupts for enabled interrupts using function RTMPBalanceINTCPUs. In Lowest Priority Delivery Mode, interrupts are dynamically routed to the CPU which is currently running at the lowest interrupts priority, which usually means that the vast majority of interrupts are handled by the same CPU. Flag RT_APIC_FIXED_INT_ROUTING is set automatically when flag RT_APIC_LOWEST_INT_ROUTING is not set. |
RT_APIC_LOWEST_INT_ROUTING |
RT_APIC_LOWEST_INT_ROUTING instructs RTMPSetAPICMode to use Lowest Priority Delivery Mode for interrupts. Please note that many newer Intel CPUs no longer support Lowest Priority Delivery Mode. Setting this flag is thus not recommended. |
RT_APIC_VERBOSE |
RT_APIC_VERBOSE instructs RTMPSetAPICMode to display the change of IRQ values of all PCI devices. |
return valueZero if the switch to APIC mode failed and non-zero otherwise.
If the program is already running in APIC mode, RTMPSetAPICMode does nothing and returns 1. Otherwise, it deactivates the legacy i8259 PICs and enables all IOAPICs and the local APIC. By default, new IRQ values are assigned to all PCI devices, so it is important that RTMPSetAPICMode is called before any PCI device has been initialized. If this is not possible, specify flag RT_APIC_USE_LEGACY_MAP to preserve the PCI IRQ configuration.
RTKernel-32 programs using the multiprocessor scheduler need to call this function only if their require flag RT_APIC_TRUST_MPFPS, RT_APIC_ASSUME_LEGACY_MAP, RT_APIC_USE_LEGACY_MAP, or RT_APIC_LOWEST_INT_ROUTING. RTKernelInit calls RTMPSetAPICMode(0) or RTMPSetAPICMode(RT_APIC_NO_HYPERTHREAD), depending on RTKConfig driver flag DF_NO_HYPERTHREAD.
From an application point of view, interrupt handling works the same way in legacy PIC mode and in APIC mode. Interrupt handlers should be installed using RTInstallSharedIRQHandlerEx.
Function RTMPIsAPICMode
|