]> git.proxmox.com Git - mirror_edk2.git/blame - PcAtChipsetPkg/Include/Library/IoApicLib.h
Add generic HPET Timer DXE Driver and support libraries
[mirror_edk2.git] / PcAtChipsetPkg / Include / Library / IoApicLib.h
CommitLineData
986d1dfb 1/** @file\r
2 Public include file for I/O APIC library.\r
3\r
4 I/O APIC library assumes I/O APIC is enabled. It does not\r
5 handles cases where I/O APIC is disabled.\r
6\r
7 Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>\r
8 This program and the accompanying materials\r
9 are licensed and made available under the terms and conditions of the BSD License\r
10 which accompanies this distribution. The full text of the license may be found at\r
11 http://opensource.org/licenses/bsd-license.php\r
12\r
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
15\r
16**/\r
17\r
18/**\r
19 Read a 32-bit I/O APIC register.\r
20\r
21 If Index is >= 0x100, then ASSERT().\r
22 \r
23 @param Index Specifies the I/O APIC register to read.\r
24\r
25 @return The 32-bit value read from the I/O APIC register specified by Index.\r
26**/\r
27UINT32\r
28EFIAPI\r
29IoApicRead (\r
30 IN UINTN Index\r
31 );\r
32\r
33/**\r
34 Write a 32-bit I/O APIC register.\r
35\r
36 If Index is >= 0x100, then ASSERT().\r
37 \r
38 @param Index Specifies the I/O APIC register to write.\r
39 @param Value Specifies the value to write to the I/O APIC register specified by Index.\r
40\r
41 @return The 32-bit value written to I/O APIC register specified by Index.\r
42**/\r
43UINT32\r
44EFIAPI\r
45IoApicWrite (\r
46 IN UINTN Index,\r
47 IN UINT32 Value\r
48 );\r
49\r
50/**\r
51 Set the interrupt mask of an I/O APIC interrupt.\r
52\r
53 If Irq is larger than the maximum number I/O APIC redirection entries, then ASSERT(). \r
54 \r
55 @param Irq Specifies the I/O APIC interrupt to enable or disable.\r
56 @param Enable If TRUE, then enable the I/O APIC interrupt specified by Irq.\r
57 If FALSE, then disable the I/O APIC interrupt specified by Irq.\r
58**/\r
59VOID\r
60EFIAPI\r
61IoApicEnableInterrupt (\r
62 IN UINTN Irq,\r
63 IN BOOLEAN Enable\r
64 );\r
65\r
66/**\r
67 Configures an I/O APIC interrupt.\r
68 \r
69 Configure an I/O APIC Redirection Table Entry to deliver an interrupt in physical\r
70 mode to the Local APIC of the currntly executing CPU. The default state of the \r
71 entry is for the interrupt to be disabled (masked). IoApicEnableInterrupts() must\r
72 be used to enable(unmask) the I/O APIC Interrupt.\r
73\r
74 If Irq is larger than the maximum number I/O APIC redirection entries, then ASSERT(). \r
75 If Vector >= 0x100, then ASSERT().\r
76 If DeliveryMode is not supported, then ASSERT().\r
77\r
78 @param Irq Specifies the I/O APIC interrupt to initialize.\r
79 @param Vector The 8-bit interrupt vector associated with the I/O APIC\r
80 Interrupt. Must be in the range 0x10..0xFE.\r
81 @param DeliveryMode A 3-bit value that specifies how the recept of the I/O APIC\r
82 interrupt is handled. The only supported values are:\r
83 0: IO_APIC_DELIVERY_MODE_FIXED\r
84 1: IO_APIC_DELIVERY_MODE_LOWEST_PRIORITY\r
85 2: IO_APIC_DELIVERY_MODE_SMI\r
86 4: IO_APIC_DELIVERY_MODE_NMI\r
87 5: IO_APIC_DELIVERY_MODE_INIT\r
88 7: IO_APIC_DELIVERY_MODE_EXTINT\r
89 @param LevelTriggered TRUE specifies a level triggered interrupt.\r
90 FALSE specifies an edge triggered interrupt.\r
91 @param AssertionLevel TRUE specified an active high interrupt.\r
92 FALSE specifies an active low interrupt.\r
93**/\r
94VOID\r
95EFIAPI\r
96IoApicConfigureInterrupt (\r
97 IN UINTN Irq,\r
98 IN UINTN Vector,\r
99 IN UINTN DeliveryMode,\r
100 IN BOOLEAN LevelTriggered,\r
101 IN BOOLEAN AssertionLevel\r
102 );\r