2009-03-02 01:58:29 +01:00
|
|
|
/** @file
|
|
|
|
Driver implementing the Tiano Legacy 8259 Protocol
|
2008-04-18 06:13:47 +02:00
|
|
|
|
2009-03-02 01:58:29 +01:00
|
|
|
Copyright (c) 2005, 2009, Intel Corporation
|
2008-04-18 06:13:47 +02:00
|
|
|
All rights reserved. This program and the accompanying materials
|
|
|
|
are licensed and made available under the terms and conditions of the BSD License
|
|
|
|
which accompanies this distribution. The full text of the license may be found at
|
|
|
|
http://opensource.org/licenses/bsd-license.php
|
|
|
|
|
|
|
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
|
|
|
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef _8259_H__
|
|
|
|
#define _8259_H__
|
|
|
|
|
|
|
|
#include <FrameworkDxe.h>
|
|
|
|
|
|
|
|
#include <Protocol/Legacy8259.h>
|
|
|
|
|
|
|
|
#include <Library/UefiBootServicesTableLib.h>
|
|
|
|
#include <Library/DebugLib.h>
|
2008-10-27 03:16:38 +01:00
|
|
|
#include <Library/IoLib.h>
|
2008-04-18 06:13:47 +02:00
|
|
|
|
|
|
|
//
|
|
|
|
// 8259 Hardware definitions
|
|
|
|
//
|
|
|
|
#define LEGACY_MODE_BASE_VECTOR_MASTER 0x08
|
|
|
|
#define LEGACY_MODE_BASE_VECTOR_SLAVE 0x70
|
|
|
|
|
|
|
|
#define PROTECTED_MODE_BASE_VECTOR_MASTER 0x68
|
|
|
|
#define PROTECTED_MODE_BASE_VECTOR_SLAVE 0x70
|
|
|
|
|
|
|
|
#define LEGACY_8259_CONTROL_REGISTER_MASTER 0x20
|
|
|
|
#define LEGACY_8259_MASK_REGISTER_MASTER 0x21
|
|
|
|
#define LEGACY_8259_CONTROL_REGISTER_SLAVE 0xA0
|
|
|
|
#define LEGACY_8259_MASK_REGISTER_SLAVE 0xA1
|
|
|
|
#define LEGACY_8259_EDGE_LEVEL_TRIGGERED_REGISTER_MASTER 0x4D0
|
|
|
|
#define LEGACY_8259_EDGE_LEVEL_TRIGGERED_REGISTER_SLAVE 0x4D1
|
|
|
|
|
|
|
|
#define LEGACY_8259_EOI 0x20
|
|
|
|
|
|
|
|
//
|
|
|
|
// Protocol Function Prototypes
|
|
|
|
//
|
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
Interrupt8259SetVectorBase (
|
2009-03-02 01:58:29 +01:00
|
|
|
IN EFI_LEGACY_8259_PROTOCOL *This,
|
|
|
|
IN UINT8 MasterBase,
|
|
|
|
IN UINT8 SlaveBase
|
|
|
|
);
|
2008-04-18 06:13:47 +02:00
|
|
|
|
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
Interrupt8259GetMask (
|
2009-03-02 01:58:29 +01:00
|
|
|
IN EFI_LEGACY_8259_PROTOCOL *This,
|
2008-04-18 06:13:47 +02:00
|
|
|
OUT UINT16 *LegacyMask, OPTIONAL
|
|
|
|
OUT UINT16 *LegacyEdgeLevel, OPTIONAL
|
|
|
|
OUT UINT16 *ProtectedMask, OPTIONAL
|
|
|
|
OUT UINT16 *ProtectedEdgeLevel OPTIONAL
|
2009-03-02 01:58:29 +01:00
|
|
|
);
|
2008-04-18 06:13:47 +02:00
|
|
|
|
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
Interrupt8259SetMask (
|
2009-03-02 01:58:29 +01:00
|
|
|
IN EFI_LEGACY_8259_PROTOCOL *This,
|
|
|
|
IN UINT16 *LegacyMask, OPTIONAL
|
|
|
|
IN UINT16 *LegacyEdgeLevel, OPTIONAL
|
|
|
|
IN UINT16 *ProtectedMask, OPTIONAL
|
|
|
|
IN UINT16 *ProtectedEdgeLevel OPTIONAL
|
|
|
|
);
|
2008-04-18 06:13:47 +02:00
|
|
|
|
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
Interrupt8259SetMode (
|
2009-03-02 01:58:29 +01:00
|
|
|
IN EFI_LEGACY_8259_PROTOCOL *This,
|
|
|
|
IN EFI_8259_MODE Mode,
|
|
|
|
IN UINT16 *Mask, OPTIONAL
|
|
|
|
IN UINT16 *EdgeLevel OPTIONAL
|
|
|
|
);
|
2008-04-18 06:13:47 +02:00
|
|
|
|
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
Interrupt8259GetVector (
|
|
|
|
IN EFI_LEGACY_8259_PROTOCOL *This,
|
|
|
|
IN EFI_8259_IRQ Irq,
|
|
|
|
OUT UINT8 *Vector
|
2009-03-02 01:58:29 +01:00
|
|
|
);
|
2008-04-18 06:13:47 +02:00
|
|
|
|
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
Interrupt8259EnableIrq (
|
2009-03-02 01:58:29 +01:00
|
|
|
IN EFI_LEGACY_8259_PROTOCOL *This,
|
|
|
|
IN EFI_8259_IRQ Irq,
|
|
|
|
IN BOOLEAN LevelTriggered
|
|
|
|
);
|
2008-04-18 06:13:47 +02:00
|
|
|
|
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
Interrupt8259DisableIrq (
|
2009-03-02 01:58:29 +01:00
|
|
|
IN EFI_LEGACY_8259_PROTOCOL *This,
|
|
|
|
IN EFI_8259_IRQ Irq
|
|
|
|
);
|
2008-04-18 06:13:47 +02:00
|
|
|
|
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
Interrupt8259GetInterruptLine (
|
|
|
|
IN EFI_LEGACY_8259_PROTOCOL *This,
|
|
|
|
IN EFI_HANDLE PciHandle,
|
|
|
|
OUT UINT8 *Vector
|
2009-03-02 01:58:29 +01:00
|
|
|
);
|
2008-04-18 06:13:47 +02:00
|
|
|
|
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
Interrupt8259EndOfInterrupt (
|
|
|
|
IN EFI_LEGACY_8259_PROTOCOL *This,
|
|
|
|
IN EFI_8259_IRQ Irq
|
2009-03-02 01:58:29 +01:00
|
|
|
);
|
2008-04-18 06:13:47 +02:00
|
|
|
|
|
|
|
#endif
|