TianoCore EDK2 master
Loading...
Searching...
No Matches
Legacy8259.h File Reference

Go to the source code of this file.

Data Structures

struct  _EFI_LEGACY_8259_PROTOCOL
 

Macros

#define EFI_LEGACY_8259_PROTOCOL_GUID
 

Typedefs

typedef struct _EFI_LEGACY_8259_PROTOCOL EFI_LEGACY_8259_PROTOCOL
 
typedef EFI_STATUS(EFIAPI * EFI_LEGACY_8259_SET_VECTOR_BASE) (IN EFI_LEGACY_8259_PROTOCOL *This, IN UINT8 MasterBase, IN UINT8 SlaveBase)
 
typedef EFI_STATUS(EFIAPI * EFI_LEGACY_8259_GET_MASK) (IN EFI_LEGACY_8259_PROTOCOL *This, OUT UINT16 *LegacyMask OPTIONAL, OUT UINT16 *LegacyEdgeLevel OPTIONAL, OUT UINT16 *ProtectedMask OPTIONAL, OUT UINT16 *ProtectedEdgeLevel OPTIONAL)
 
typedef EFI_STATUS(EFIAPI * EFI_LEGACY_8259_SET_MASK) (IN EFI_LEGACY_8259_PROTOCOL *This, IN UINT16 *LegacyMask OPTIONAL, IN UINT16 *LegacyEdgeLevel OPTIONAL, IN UINT16 *ProtectedMask OPTIONAL, IN UINT16 *ProtectedEdgeLevel OPTIONAL)
 
typedef EFI_STATUS(EFIAPI * EFI_LEGACY_8259_SET_MODE) (IN EFI_LEGACY_8259_PROTOCOL *This, IN EFI_8259_MODE Mode, IN UINT16 *Mask OPTIONAL, IN UINT16 *EdgeLevel OPTIONAL)
 
typedef EFI_STATUS(EFIAPI * EFI_LEGACY_8259_GET_VECTOR) (IN EFI_LEGACY_8259_PROTOCOL *This, IN EFI_8259_IRQ Irq, OUT UINT8 *Vector)
 
typedef EFI_STATUS(EFIAPI * EFI_LEGACY_8259_ENABLE_IRQ) (IN EFI_LEGACY_8259_PROTOCOL *This, IN EFI_8259_IRQ Irq, IN BOOLEAN LevelTriggered)
 
typedef EFI_STATUS(EFIAPI * EFI_LEGACY_8259_DISABLE_IRQ) (IN EFI_LEGACY_8259_PROTOCOL *This, IN EFI_8259_IRQ Irq)
 
typedef EFI_STATUS(EFIAPI * EFI_LEGACY_8259_GET_INTERRUPT_LINE) (IN EFI_LEGACY_8259_PROTOCOL *This, IN EFI_HANDLE PciHandle, OUT UINT8 *Vector)
 
typedef EFI_STATUS(EFIAPI * EFI_LEGACY_8259_END_OF_INTERRUPT) (IN EFI_LEGACY_8259_PROTOCOL *This, IN EFI_8259_IRQ Irq)
 

Enumerations

enum  EFI_8259_IRQ {
  Efi8259Irq0 , Efi8259Irq1 , Efi8259Irq2 , Efi8259Irq3 ,
  Efi8259Irq4 , Efi8259Irq5 , Efi8259Irq6 , Efi8259Irq7 ,
  Efi8259Irq8 , Efi8259Irq9 , Efi8259Irq10 , Efi8259Irq11 ,
  Efi8259Irq12 , Efi8259Irq13 , Efi8259Irq14 , Efi8259Irq15 ,
  Efi8259IrqMax
}
 
enum  EFI_8259_MODE { Efi8259LegacyMode , Efi8259ProtectedMode , Efi8259MaxMode }
 

Variables

EFI_GUID gEfiLegacy8259ProtocolGuid
 

Detailed Description

This protocol abstracts the 8259 interrupt controller. This includes PCI IRQ routing needed to program the PCI Interrupt Line register.

Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Revision Reference:
This protocol is defined in Framework for EFI Compatibility Support Module spec Version 0.97.

Definition in file Legacy8259.h.

Macro Definition Documentation

◆ EFI_LEGACY_8259_PROTOCOL_GUID

#define EFI_LEGACY_8259_PROTOCOL_GUID
Value:
{ \
0x38321dba, 0x4fe0, 0x4e17, {0x8a, 0xec, 0x41, 0x30, 0x55, 0xea, 0xed, 0xc1 } \
}

Definition at line 17 of file Legacy8259.h.

Typedef Documentation

◆ EFI_LEGACY_8259_DISABLE_IRQ

typedef EFI_STATUS(EFIAPI * EFI_LEGACY_8259_DISABLE_IRQ) (IN EFI_LEGACY_8259_PROTOCOL *This, IN EFI_8259_IRQ Irq)

Disable Irq by masking interrupt in 8259

Parameters
ThisThe protocol instance pointer.
Irq8259 IRQ0 - IRQ15.
Return values
EFI_SUCCESSThe Irq was disabled on 8259.
EFI_INVALID_PARAMETERThe Irq is not valid.

Definition at line 198 of file Legacy8259.h.

◆ EFI_LEGACY_8259_ENABLE_IRQ

typedef EFI_STATUS(EFIAPI * EFI_LEGACY_8259_ENABLE_IRQ) (IN EFI_LEGACY_8259_PROTOCOL *This, IN EFI_8259_IRQ Irq, IN BOOLEAN LevelTriggered)

Enable Irq by unmasking interrupt in 8259

Parameters
ThisThe protocol instance pointer.
Irq8259 IRQ0 - IRQ15.
LevelTriggeredTRUE if level triggered. FALSE if edge triggered.
Return values
EFI_SUCCESSThe Irq was enabled on 8259.
EFI_INVALID_PARAMETERThe Irq is not valid.

Definition at line 180 of file Legacy8259.h.

◆ EFI_LEGACY_8259_END_OF_INTERRUPT

typedef EFI_STATUS(EFIAPI * EFI_LEGACY_8259_END_OF_INTERRUPT) (IN EFI_LEGACY_8259_PROTOCOL *This, IN EFI_8259_IRQ Irq)

Send an EOI to 8259

Parameters
ThisThe protocol instance pointer.
Irq8259 IRQ0 - IRQ15.
Return values
EFI_SUCCESSEOI was successfully sent to 8259.
EFI_INVALID_PARAMETERThe Irq isnot valid.

Definition at line 237 of file Legacy8259.h.

◆ EFI_LEGACY_8259_GET_INTERRUPT_LINE

typedef EFI_STATUS(EFIAPI * EFI_LEGACY_8259_GET_INTERRUPT_LINE) (IN EFI_LEGACY_8259_PROTOCOL *This, IN EFI_HANDLE PciHandle, OUT UINT8 *Vector)

PciHandle represents a PCI config space of a PCI function. Vector represents Interrupt Pin (from PCI config space) and it is the data that is programmed into the Interrupt Line (from the PCI config space) register.

Parameters
ThisThe protocol instance pointer.
PciHandleThe PCI function to return the vector for.
VectorThe vector for the function it matches.
Return values
EFI_SUCCESSA valid Vector was returned.
EFI_INVALID_PARAMETERPciHandle not valid.

Definition at line 219 of file Legacy8259.h.

◆ EFI_LEGACY_8259_GET_MASK

typedef EFI_STATUS(EFIAPI * EFI_LEGACY_8259_GET_MASK) (IN EFI_LEGACY_8259_PROTOCOL *This, OUT UINT16 *LegacyMask OPTIONAL, OUT UINT16 *LegacyEdgeLevel OPTIONAL, OUT UINT16 *ProtectedMask OPTIONAL, OUT UINT16 *ProtectedEdgeLevel OPTIONAL)

Get the 8259 interrupt masks for Irq0 - Irq15. A different mask exists for the legacy mode mask and the protected mode mask. The base address for the 8259 is different for legacy and protected mode, so two masks are required.

Parameters
ThisThe protocol instance pointer.
LegacyMaskBit 0 is Irq0 - Bit 15 is Irq15.
LegacyEdgeLevelBit 0 is Irq0 - Bit 15 is Irq15.
ProtectedMaskBit 0 is Irq0 - Bit 15 is Irq15.
ProtectedEdgeLevelBit 0 is Irq0 - Bit 15 is Irq15.
Return values
EFI_SUCCESS8259 status returned.
EFI_DEVICE_ERRORError reading 8259.

Definition at line 87 of file Legacy8259.h.

◆ EFI_LEGACY_8259_GET_VECTOR

typedef EFI_STATUS(EFIAPI * EFI_LEGACY_8259_GET_VECTOR) (IN EFI_LEGACY_8259_PROTOCOL *This, IN EFI_8259_IRQ Irq, OUT UINT8 *Vector)

Convert from IRQ to processor interrupt vector number.

Parameters
ThisThe protocol instance pointer.
Irq8259 IRQ0 - IRQ15.
VectorThe processor vector number that matches an Irq.
Return values
EFI_SUCCESSThe Vector matching Irq is returned.
EFI_INVALID_PARAMETERThe Irq not valid.

Definition at line 161 of file Legacy8259.h.

◆ EFI_LEGACY_8259_PROTOCOL

Definition at line 22 of file Legacy8259.h.

◆ EFI_LEGACY_8259_SET_MASK

typedef EFI_STATUS(EFIAPI * EFI_LEGACY_8259_SET_MASK) (IN EFI_LEGACY_8259_PROTOCOL *This, IN UINT16 *LegacyMask OPTIONAL, IN UINT16 *LegacyEdgeLevel OPTIONAL, IN UINT16 *ProtectedMask OPTIONAL, IN UINT16 *ProtectedEdgeLevel OPTIONAL)

Set the 8259 interrupt masks for Irq0 - Irq15. A different mask exists for the legacy mode mask and the protected mode mask. The base address for the 8259 is different for legacy and protected mode, so two masks are required. Also set the edge/level masks.

Parameters
ThisThe protocol instance pointer.
LegacyMaskBit 0 is Irq0 - Bit 15 is Irq15.
LegacyEdgeLevelBit 0 is Irq0 - Bit 15 is Irq15.
ProtectedMaskBit 0 is Irq0 - Bit 15 is Irq15.
ProtectedEdgeLevelBit 0 is Irq0 - Bit 15 is Irq15.
Return values
EFI_SUCCESS8259 status returned.
EFI_DEVICE_ERRORError writing 8259.

Definition at line 113 of file Legacy8259.h.

◆ EFI_LEGACY_8259_SET_MODE

typedef EFI_STATUS(EFIAPI * EFI_LEGACY_8259_SET_MODE) (IN EFI_LEGACY_8259_PROTOCOL *This, IN EFI_8259_MODE Mode, IN UINT16 *Mask OPTIONAL, IN UINT16 *EdgeLevel OPTIONAL)

Set the 8259 mode of operation. The base address for the 8259 is different for legacy and protected mode. The legacy mode requires the master 8259 to have a master base of 0x08 and the slave base of 0x70. The protected mode base locations are not defined. Interrupts must be masked by the caller before this function is called. The interrupt mask from the current mode is saved. The interrupt mask for the new mode is Mask, or if Mask does not exist the previously saved mask is used.

Parameters
ThisThe protocol instance pointer.
ModeThe mode of operation. i.e. the real mode or protected mode.
MaskOptional interupt mask for the new mode.
EdgeLevelOptional trigger mask for the new mode.
Return values
EFI_SUCCESS8259 programmed.
EFI_DEVICE_ERRORError writing to 8259.

Definition at line 141 of file Legacy8259.h.

◆ EFI_LEGACY_8259_SET_VECTOR_BASE

typedef EFI_STATUS(EFIAPI * EFI_LEGACY_8259_SET_VECTOR_BASE) (IN EFI_LEGACY_8259_PROTOCOL *This, IN UINT8 MasterBase, IN UINT8 SlaveBase)

Get the 8259 interrupt masks for Irq0 - Irq15. A different mask exists for the legacy mode mask and the protected mode mask. The base address for the 8259 is different for legacy and protected mode, so two masks are required.

Parameters
ThisThe protocol instance pointer.
MasterBaseThe base vector for the Master PIC in the 8259 controller.
SlaveBaseThe base vector for the Slave PIC in the 8259 controller.
Return values
EFI_SUCCESSThe new bases were programmed.
EFI_DEVICE_ERRORA device error occurred programming the vector bases.

Definition at line 64 of file Legacy8259.h.

Enumeration Type Documentation

◆ EFI_8259_IRQ

enum EFI_8259_IRQ

Definition at line 24 of file Legacy8259.h.

◆ EFI_8259_MODE

enum EFI_8259_MODE

Definition at line 44 of file Legacy8259.h.