Intel MultiProcessor manual Example A-1. Programming Local Apic for Virtual Wire Mode

Page 71

System BIOS Programming Guidelines

;-----------------------------------------------------------------------

 

 

;

; InitLocalAPIC( )

 

;

;-----------------------------------------------------------------------

 

 

;

;

 

 

 

;

;

Initialize the local APIC to virtual wire mode.

;

;

 

 

 

;

;-----------------------------------------------------------------------

 

 

;

SVR

 

equ

0FEE000F0H

 

LVT1

 

equ

0FEE00350H

 

LVT2

 

equ

0FEE00360H

 

APIC_ENABLED

equ

000000100H

 

 

public

InitLocalAPIC

 

InitLocalAPIC

proc

near

 

 

push

ds

; save regs used for APIC init

 

 

push

es

 

 

 

push

esi

 

 

 

mov

al,080h

; ensure NMI disabled

 

 

out

070h,al

 

 

 

in

al,021h

; read primary imr

 

 

push

ax

; save settings

 

 

mov

al,0ffh

; mask all off

 

 

out

021h,al

 

 

 

in

al,0a1h

; read secondary imr

 

 

push

ax

; save settings

 

 

mov

al,0ffh

; mask all off

 

 

out

0a1h,al

 

 

 

extrn

pmode_on : near

 

 

call

pmode_on

; switch into real big mode

 

;

;The APIC spurious interrupt must point to a vector whose lower

;nibble is 0F, that is 0xF, where x is 0 - F. Here we use Int 00FH,

;which handles spurious interrupts and supplies the necessary IRET.

;This vector is assumed to have already been initialized in memory.

;Enable the APIC via SVR and set the spurious interrupt to use Int 00F

mov esi,SVR

mov

eax,[esi]

; read SVR

and

eax,0FFFFFF0FH

; clear

spurious vector (use vector

 

 

 

00FH)

 

or

eax,APIC_ENABLED

;

bit 8

= 1

mov

[esi],eax

;

write

SVR

;

;Program LVT1 as ExtInt, which delivers the signal to the INTR signal of all

;processors' cores listed in the destination as an interrupt that originated

;in an externally-connected interrupt controller.

;

Example A-1. Programming Local APIC for Virtual Wire Mode

Version 1.4

A-3

Image 71
Contents MultiProcessor Specification Copyright 1993-1997. Intel Corporation, All Rights Reserved Revision Revision History Date Revision HistoryPage Table of Contents Contents MP Configuration TableDefault Configurations Appendix E Errata Glossary Appendix a System Bios Programming GuidelinesAppendix B Operating System Programming Guidelines Tables FiguresExamples Page Conceptual Overview GoalsScope Features of the SpecificationMultiProcessor Specification Introduction Target AudienceOrganization of This Document Document OrganizationFor More Information Conventions Used in This DocumentSystem Overview System Processors Hardware OverviewSystem Overview Advanced Programmable Interrupt Controller4 I/O Expansion Bus System MemoryOperating System Overview Bios OverviewPage System Memory Configuration Hardware SpecificationSystem Memory Address Map System Memory Cacheability and ShareabilityMemory Cacheability Map Hardware SpecificationLocking External Cache SubsystemApic Architecture Posted Memory WriteMultiprocessor Interrupt Control Apic Versions Interrupt ModesPIC Mode PIC Mode Virtual Wire Mode via Local Apic Virtual Wire ModeVirtual Wire Mode via I/O Apic Symmetric I/O Mode Symmetric I/O ModeApic Memory Mapping Assignment of System Interrupts to the Apic Local UnitFloating Point Exception Interrupt Apic Identification Apic Interval TimersSystem-wide Reset Reset SupportProcessor-specific Init System-wide InitSystem Initial State Support for Fault-resilient BootingMP Configuration Table MultiProcessor Specification Offset Length Field Bytesbits in bits Description MP Configuration TableMP Floating Pointer Structure Information Bytes MP FeatureOffset Length Field Bytesbits Bits Description Information ByteMP Configuration Table Header MP Configuration Table HeaderOffset Length Field Bytes Bits Description Base MP Configuration Table EntriesMP Configuration Table Header Fields Apic Base MP Configuration Table Entry TypesProcessor Entries Length Entry Description Entry Type Code Bytes CommentsProcessor Entry Fields Bit Name Description Comments Feature Flags from Cpuid InstructionIntel486 and Pentium Processor Signatures Family Model Stepping a DescriptionString Bus EntriesBUS ID BUS TypeBus Type String Description Bus Type String ValuesI/O Apic Entry Fields 3 I/O Apic Entries4 I/O Interrupt Assignment Entries Apic EntryI/O Interrupt Entry 10. I/O Interrupt Entry Fields Interrupt Type Description Comments Local Interrupt Assignment Entries11. Interrupt Type Values LINTIN# 12. Local Interrupt Entry FieldsDestination Local Apic ID Destination Local ApicExtended MP Configuration Table Entries System Address Space Mapping Entries 14. System Address Space Mapping Entry Fields 10. Example System with Multiple Bus Types and Bridge Types Bus Hierarchy Descriptor Entry Compatibility Bus Address Space Modifier Entry 12. Compatibility Bus Address Space Modifier Entry 16. Compatibility Bus Address Space Modifier Entry Fields Default Configurations Config Code CPUs Type Variant Schematic Discrete Apic ConfigurationsDefault Configurations Default Number BusDefault Configurations Default Configuration for Discrete ApicIntegrated Apic Configurations Default Configuration for Integrated Apic First I/O Default Configuration Interrupt AssignmentsConfig INTINx Comments Assignment of I/O Interrupts to the Apic I/O UnitLevel-triggered Interrupt Support All Local APICs Config LINTINx CommentsAssignment of System Interrupts to the Apic Local Unit Eisa and IRQ13MultiProcessor Specification Bios Post Initialization System Bios Programming GuidelinesControlling the Application Processors Programming the Apic for Virtual Wire ModeSystem Bios Programming Guidelines Example A-1. Programming Local Apic for Virtual Wire ModeNMI Constructing the MP Configuration TableSystem Bios Programming Guidelines Page Operating System Programming Guidelines Operating System Boot-upInterrupt Mode Initialization and Handling Operating System Booting and Self-configurationOperating System Programming Guidelines Application Processor StartupUsing Init IPI AP Shutdown Handling Using Startup IPIHandling TLB Invalidation Other IPI ApplicationsSpurious Apic Interrupts Handling Cache FlushSupporting Unequal Processors Page System Compliance Checklist Page Variable Interrupt Routing Interrupt Routing with Multiple APICsFixed Interrupt Routing INTD# Bus Entries in Systems with More Than One PCI BusI/O Interrupt Assignment Entries for PCI Devices Multiple I/O Apic Multiple PCI Bus SystemsPage Errata 126 System Address Space Entry System Address Space Mapping EntriesAddress Base 14. System Address Space Mapping Entry FieldsEntry Length Address TypeSpace records must also be provided Bus Hierarchy Descriptor EntryParent BUS BUS InformationsdGlossary Glossary-2 Order Number