Home | History | Annotate | Download | only in LegacyInterrupt
      1 /*++
      2 
      3 Copyright (c) 1999 - 2006, Intel Corporation. All rights reserved.<BR>
      4 This program and the accompanying materials
      5 are licensed and made available under the terms and conditions of the BSD License
      6 which accompanies this distribution.  The full text of the license may be found at
      7 http://opensource.org/licenses/bsd-license.php
      8 
      9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
     10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     11 
     12 
     13 Module Name:
     14 
     15   LegacyInterrupt.h
     16 
     17 Abstract:
     18 
     19   This protocol manages the PIRQ for PCI devices
     20 
     21 Revision History
     22 
     23   The EFI Legacy Interrupt Protocol is compliant with CSM spec 0.96.
     24 
     25 --*/
     26 
     27 #ifndef _EFI_LEGACY_INTERRUPT_H_
     28 #define _EFI_LEGACY_INTERRUPT_H_
     29 
     30 #define EFI_LEGACY_INTERRUPT_PROTOCOL_GUID \
     31   { \
     32     0x31ce593d, 0x108a, 0x485d, {0xad, 0xb2, 0x78, 0xf2, 0x1f, 0x29, 0x66, 0xbe} \
     33   }
     34 
     35 EFI_FORWARD_DECLARATION (EFI_LEGACY_INTERRUPT_PROTOCOL);
     36 
     37 typedef
     38 EFI_STATUS
     39 (EFIAPI *EFI_LEGACY_INTERRUPT_GET_NUMBER_PIRQS) (
     40   IN EFI_LEGACY_INTERRUPT_PROTOCOL            * This,
     41   OUT UINT8                                   *NumberPirqs
     42   );
     43 
     44 /*++
     45 
     46   Routine Description:
     47       Return the number of PIRQs this hardware supports.
     48 
     49   Arguments:
     50     This                - Protocol instance pointer.
     51     NumberPirsq         - Number of PIRQs.
     52 
     53   Returns:
     54     EFI_SUCCESS   - Number of PIRQs returned.
     55 
     56 --*/
     57 typedef
     58 EFI_STATUS
     59 (EFIAPI *EFI_LEGACY_INTERRUPT_GET_LOCATION) (
     60   IN EFI_LEGACY_INTERRUPT_PROTOCOL            * This,
     61   OUT UINT8                                   *Bus,
     62   OUT UINT8                                   *Device,
     63   OUT UINT8                                   *Function
     64   );
     65 
     66 /*++
     67 
     68   Routine Description:
     69       Return PCI location of this device. $PIR table requires this info.
     70 
     71   Arguments:
     72     This                - Protocol instance pointer.
     73     Bus                 - PCI Bus
     74     Device              - PCI Device
     75     Function            - PCI Function
     76 
     77   Returns:
     78     EFI_SUCCESS   - Bus/Device/Function returned
     79 
     80 --*/
     81 typedef
     82 EFI_STATUS
     83 (EFIAPI *EFI_LEGACY_INTERRUPT_READ_PIRQ) (
     84   IN EFI_LEGACY_INTERRUPT_PROTOCOL           * This,
     85   IN  UINT8                                  PirqNumber,
     86   OUT UINT8                                  *PirqData
     87   );
     88 
     89 /*++
     90 
     91   Routine Description:
     92       Read the PIRQ register and return the data
     93 
     94   Arguments:
     95     This                - Protocol instance pointer.
     96     PirqNumber          - PIRQ register to read
     97     PirqData            - Data read
     98 
     99   Returns:
    100     EFI_SUCCESS   - Data was read
    101     EFI_INVALID_PARAMETER - Invalid PIRQ number
    102 
    103 --*/
    104 typedef
    105 EFI_STATUS
    106 (EFIAPI *EFI_LEGACY_INTERRUPT_WRITE_PIRQ) (
    107   IN EFI_LEGACY_INTERRUPT_PROTOCOL           * This,
    108   IN  UINT8                                  PirqNumber,
    109   IN UINT8                                   PirqData
    110   );
    111 
    112 /*++
    113 
    114   Routine Description:
    115       Write the specified PIRQ register with the given data.
    116 
    117   Arguments:
    118     This                - Protocol instance pointer.
    119     PirqNumber          - PIRQ register to read.
    120     PirqData            - Data written.
    121 
    122   Returns:
    123     EFI_SUCCESS   - Table pointer returned
    124     EFI_INVALID_PARAMETER - Invalid PIRQ number
    125 
    126 --*/
    127 struct _EFI_LEGACY_INTERRUPT_PROTOCOL {
    128   EFI_LEGACY_INTERRUPT_GET_NUMBER_PIRQS GetNumberPirqs;
    129   EFI_LEGACY_INTERRUPT_GET_LOCATION     GetLocation;
    130   EFI_LEGACY_INTERRUPT_READ_PIRQ        ReadPirq;
    131   EFI_LEGACY_INTERRUPT_WRITE_PIRQ       WritePirq;
    132 };
    133 
    134 extern EFI_GUID gEfiLegacyInterruptProtocolGuid;
    135 
    136 #endif
    137