Home | History | Annotate | Download | only in Ppi
      1 /** @file
      2   This PPI provides a set of memory and I/O-based services.
      3   The perspective of the services is that of the processor, not the bus or system.
      4 
      5 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
      6 This program and the accompanying materials are licensed and made available under
      7 the terms and conditions of the BSD License that accompanies this distribution.
      8 The full text of the license may be found at
      9 http://opensource.org/licenses/bsd-license.php.
     10 
     11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
     12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     13 
     14   @par Revision Reference:
     15   This PPI is introduced in PI Version 1.0.
     16 
     17 **/
     18 
     19 #ifndef __PEI_CPUIO_PPI_H__
     20 #define __PEI_CPUIO_PPI_H__
     21 
     22 #define EFI_PEI_CPU_IO_PPI_INSTALLED_GUID \
     23   { 0xe6af1f7b, 0xfc3f, 0x46da, {0xa8, 0x28, 0xa3, 0xb4, 0x57, 0xa4, 0x42, 0x82 } }
     24 
     25 typedef struct _EFI_PEI_CPU_IO_PPI  EFI_PEI_CPU_IO_PPI;
     26 
     27 ///
     28 /// EFI_PEI_CPU_IO_PPI_WIDTH.
     29 ///
     30 typedef enum {
     31   EfiPeiCpuIoWidthUint8,
     32   EfiPeiCpuIoWidthUint16,
     33   EfiPeiCpuIoWidthUint32,
     34   EfiPeiCpuIoWidthUint64,
     35   EfiPeiCpuIoWidthFifoUint8,
     36   EfiPeiCpuIoWidthFifoUint16,
     37   EfiPeiCpuIoWidthFifoUint32,
     38   EfiPeiCpuIoWidthFifoUint64,
     39   EfiPeiCpuIoWidthFillUint8,
     40   EfiPeiCpuIoWidthFillUint16,
     41   EfiPeiCpuIoWidthFillUint32,
     42   EfiPeiCpuIoWidthFillUint64,
     43   EfiPeiCpuIoWidthMaximum
     44 } EFI_PEI_CPU_IO_PPI_WIDTH;
     45 
     46 /**
     47   Memory-based access services and I/O-based access services.
     48 
     49   @param[in]      PeiServices  An indirect pointer to the PEI Services Table
     50                                published by the PEI Foundation.
     51   @param[in]      This         The pointer to local data for the interface.
     52   @param[in]      Width        The width of the access. Enumerated in bytes.
     53   @param[in]      Address      The physical address of the access.
     54   @param[in]      Count        The number of accesses to perform.
     55   @param[in, out] Buffer       A pointer to the buffer of data.
     56 
     57   @retval EFI_SUCCESS            The function completed successfully.
     58   @retval EFI_NOT_YET_AVAILABLE  The service has not been installed.
     59 
     60 **/
     61 typedef
     62 EFI_STATUS
     63 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_MEM)(
     64   IN     CONST EFI_PEI_SERVICES    **PeiServices,
     65   IN     CONST EFI_PEI_CPU_IO_PPI  *This,
     66   IN     EFI_PEI_CPU_IO_PPI_WIDTH  Width,
     67   IN     UINT64                    Address,
     68   IN     UINTN                     Count,
     69   IN OUT VOID                      *Buffer
     70   );
     71 
     72 ///
     73 /// EFI_PEI_CPU_IO_PPI_ACCESS
     74 ///
     75 typedef struct {
     76   ///
     77   /// This service provides the various modalities of memory and I/O read.
     78   ///
     79   EFI_PEI_CPU_IO_PPI_IO_MEM  Read;
     80   ///
     81   /// This service provides the various modalities of memory and I/O write.
     82   ///
     83   EFI_PEI_CPU_IO_PPI_IO_MEM  Write;
     84 } EFI_PEI_CPU_IO_PPI_ACCESS;
     85 
     86 /**
     87   8-bit I/O read operations.
     88 
     89   @param[in] PeiServices  An indirect pointer to the PEI Services Table published
     90                           by the PEI Foundation.
     91   @param[in] This         The pointer to local data for the interface.
     92   @param[in] Address      The physical address of the access.
     93 
     94   @return  An 8-bit value returned from the I/O space.
     95 
     96 **/
     97 typedef
     98 UINT8
     99 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_READ8)(
    100   IN  CONST EFI_PEI_SERVICES    **PeiServices,
    101   IN  CONST EFI_PEI_CPU_IO_PPI  *This,
    102   IN  UINT64                    Address
    103   );
    104 
    105 /**
    106   16-bit I/O read operations.
    107 
    108   @param[in] PeiServices  An indirect pointer to the PEI Services Table published
    109                           by the PEI Foundation.
    110   @param[in] This         The pointer to local data for the interface.
    111   @param[in] Address      The physical address of the access.
    112 
    113   @return  A 16-bit value returned from the I/O space.
    114 
    115 **/
    116 typedef
    117 UINT16
    118 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_READ16)(
    119   IN  CONST EFI_PEI_SERVICES    **PeiServices,
    120   IN  CONST EFI_PEI_CPU_IO_PPI  *This,
    121   IN  UINT64                    Address
    122   );
    123 
    124 /**
    125   32-bit I/O read operations.
    126 
    127   @param[in] PeiServices  An indirect pointer to the PEI Services Table published
    128                           by the PEI Foundation.
    129   @param[in] This         The pointer to local data for the interface.
    130   @param[in] Address      The physical address of the access.
    131 
    132   @return  A 32-bit value returned from the I/O space.
    133 
    134 **/
    135 typedef
    136 UINT32
    137 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_READ32)(
    138   IN  CONST EFI_PEI_SERVICES    **PeiServices,
    139   IN  CONST EFI_PEI_CPU_IO_PPI  *This,
    140   IN  UINT64                    Address
    141   );
    142 
    143 /**
    144   64-bit I/O read operations.
    145 
    146   @param[in] PeiServices  An indirect pointer to the PEI Services Table published
    147                           by the PEI Foundation.
    148   @param[in] This         The pointer to local data for the interface.
    149   @param[in] Address      The physical address of the access.
    150 
    151   @return  A 64-bit value returned from the I/O space.
    152 
    153 **/
    154 typedef
    155 UINT64
    156 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_READ64)(
    157   IN  CONST EFI_PEI_SERVICES    **PeiServices,
    158   IN  CONST EFI_PEI_CPU_IO_PPI  *This,
    159   IN  UINT64                    Address
    160   );
    161 
    162 /**
    163   8-bit I/O write operations.
    164 
    165   @param[in] PeiServices  An indirect pointer to the PEI Services Table published
    166                           by the PEI Foundation.
    167   @param[in] This         The pointer to local data for the interface.
    168   @param[in] Address      The physical address of the access.
    169   @param[in] Data         The data to write.
    170 
    171 **/
    172 typedef
    173 VOID
    174 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_WRITE8)(
    175   IN  CONST EFI_PEI_SERVICES    **PeiServices,
    176   IN  CONST EFI_PEI_CPU_IO_PPI  *This,
    177   IN  UINT64                    Address,
    178   IN  UINT8                     Data
    179   );
    180 
    181 /**
    182   16-bit I/O write operations.
    183 
    184   @param[in] PeiServices  An indirect pointer to the PEI Services Table published
    185                           by the PEI Foundation.
    186   @param[in] This         The pointer to local data for the interface.
    187   @param[in] Address      The physical address of the access.
    188   @param[in] Data         The data to write.
    189 
    190 **/
    191 typedef
    192 VOID
    193 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_WRITE16)(
    194   IN  CONST EFI_PEI_SERVICES    **PeiServices,
    195   IN  CONST EFI_PEI_CPU_IO_PPI  *This,
    196   IN  UINT64                    Address,
    197   IN  UINT16                    Data
    198   );
    199 
    200 /**
    201   32-bit I/O write operations.
    202 
    203   @param[in] PeiServices  An indirect pointer to the PEI Services Table published
    204                           by the PEI Foundation.
    205   @param[in] This         The pointer to local data for the interface.
    206   @param[in] Address      The physical address of the access.
    207   @param[in] Data         The data to write.
    208 
    209 **/
    210 typedef
    211 VOID
    212 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_WRITE32)(
    213   IN  CONST EFI_PEI_SERVICES    **PeiServices,
    214   IN  CONST EFI_PEI_CPU_IO_PPI  *This,
    215   IN  UINT64                    Address,
    216   IN  UINT32                    Data
    217   );
    218 
    219 /**
    220   64-bit I/O write operations.
    221 
    222   @param[in] PeiServices  An indirect pointer to the PEI Services Table published
    223                           by the PEI Foundation.
    224   @param[in] This         The pointer to local data for the interface.
    225   @param[in] Address      The physical address of the access.
    226   @param[in] Data         The data to write.
    227 
    228 **/
    229 typedef
    230 VOID
    231 (EFIAPI *EFI_PEI_CPU_IO_PPI_IO_WRITE64)(
    232   IN  CONST EFI_PEI_SERVICES    **PeiServices,
    233   IN  CONST EFI_PEI_CPU_IO_PPI  *This,
    234   IN  UINT64                    Address,
    235   IN  UINT64                    Data
    236   );
    237 
    238 /**
    239   8-bit memory read operations.
    240 
    241   @param[in] PeiServices  An indirect pointer to the PEI Services Table published
    242                           by the PEI Foundation.
    243   @param[in] This         The pointer to local data for the interface.
    244   @param[in] Address      The physical address of the access.
    245 
    246   @return  An 8-bit value returned from the memory space.
    247 
    248 **/
    249 typedef
    250 UINT8
    251 (EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_READ8)(
    252   IN  CONST EFI_PEI_SERVICES    **PeiServices,
    253   IN  CONST EFI_PEI_CPU_IO_PPI  *This,
    254   IN  UINT64                    Address
    255   );
    256 
    257 /**
    258   16-bit memory read operations.
    259 
    260   @param[in] PeiServices  An indirect pointer to the PEI Services Table published
    261                           by the PEI Foundation.
    262   @param[in] This         The pointer to local data for the interface.
    263   @param[in] Address      The physical address of the access.
    264 
    265   @return  A 16-bit value returned from the memory space.
    266 
    267 **/
    268 typedef
    269 UINT16
    270 (EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_READ16)(
    271   IN  CONST EFI_PEI_SERVICES    **PeiServices,
    272   IN  CONST EFI_PEI_CPU_IO_PPI  *This,
    273   IN  UINT64                    Address
    274   );
    275 
    276 /**
    277   32-bit memory read operations.
    278 
    279   @param[in] PeiServices  An indirect pointer to the PEI Services Table published
    280                           by the PEI Foundation.
    281   @param[in] This         The pointer to local data for the interface.
    282   @param[in] Address      The physical address of the access.
    283 
    284   @return  A 32-bit value returned from the memory space.
    285 
    286 **/
    287 typedef
    288 UINT32
    289 (EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_READ32)(
    290   IN  CONST EFI_PEI_SERVICES    **PeiServices,
    291   IN  CONST EFI_PEI_CPU_IO_PPI  *This,
    292   IN  UINT64                    Address
    293   );
    294 
    295 /**
    296   64-bit memory read operations.
    297 
    298   @param[in] PeiServices  An indirect pointer to the PEI Services Table published
    299                           by the PEI Foundation.
    300   @param[in] This         The pointer to local data for the interface.
    301   @param[in] Address      The physical address of the access.
    302 
    303   @return  A 64-bit value returned from the memory space.
    304 
    305 **/
    306 typedef
    307 UINT64
    308 (EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_READ64)(
    309   IN  CONST EFI_PEI_SERVICES    **PeiServices,
    310   IN  CONST EFI_PEI_CPU_IO_PPI  *This,
    311   IN  UINT64                    Address
    312   );
    313 
    314 /**
    315   8-bit memory write operations.
    316 
    317   @param[in] PeiServices  An indirect pointer to the PEI Services Table published
    318                           by the PEI Foundation.
    319   @param[in] This         The pointer to local data for the interface.
    320   @param[in] Address      The physical address of the access.
    321   @param[in] Data         The data to write.
    322 
    323 **/
    324 typedef
    325 VOID
    326 (EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_WRITE8)(
    327   IN  CONST EFI_PEI_SERVICES    **PeiServices,
    328   IN  CONST EFI_PEI_CPU_IO_PPI  *This,
    329   IN  UINT64                    Address,
    330   IN  UINT8                     Data
    331   );
    332 
    333 /**
    334   16-bit memory write operations.
    335 
    336   @param[in] PeiServices  An indirect pointer to the PEI Services Table published
    337                           by the PEI Foundation.
    338   @param[in] This         The pointer to local data for the interface.
    339   @param[in] Address      The physical address of the access.
    340   @param[in] Data         The data to write.
    341 
    342 **/
    343 typedef
    344 VOID
    345 (EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_WRITE16)(
    346   IN  CONST EFI_PEI_SERVICES    **PeiServices,
    347   IN  CONST EFI_PEI_CPU_IO_PPI  *This,
    348   IN  UINT64                    Address,
    349   IN  UINT16                    Data
    350   );
    351 
    352 /**
    353   32-bit memory write operations.
    354 
    355   @param[in] PeiServices  An indirect pointer to the PEI Services Table published
    356                           by the PEI Foundation.
    357   @param[in] This         The pointer to local data for the interface.
    358   @param[in] Address      The physical address of the access.
    359   @param[in] Data         The data to write.
    360 
    361 **/
    362 typedef
    363 VOID
    364 (EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_WRITE32)(
    365   IN  CONST EFI_PEI_SERVICES    **PeiServices,
    366   IN  CONST EFI_PEI_CPU_IO_PPI  *This,
    367   IN  UINT64                    Address,
    368   IN  UINT32                    Data
    369   );
    370 
    371 /**
    372   64-bit memory write operations.
    373 
    374   @param[in] PeiServices  An indirect pointer to the PEI Services Table published
    375                           by the PEI Foundation.
    376   @param[in] This         The pointer to local data for the interface.
    377   @param[in] Address      The physical address of the access.
    378   @param[in] Data         The data to write.
    379 
    380 **/
    381 typedef
    382 VOID
    383 (EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_WRITE64)(
    384   IN  CONST EFI_PEI_SERVICES    **PeiServices,
    385   IN  CONST EFI_PEI_CPU_IO_PPI  *This,
    386   IN  UINT64                    Address,
    387   IN  UINT64                    Data
    388   );
    389 
    390 ///
    391 /// EFI_PEI_CPU_IO_PPI provides a set of memory and I/O-based services.
    392 /// The perspective of the services is that of the processor, not that of the
    393 /// bus or system.
    394 ///
    395 struct _EFI_PEI_CPU_IO_PPI {
    396   ///
    397   /// Collection of memory-access services.
    398   ///
    399   EFI_PEI_CPU_IO_PPI_ACCESS       Mem;
    400   ///
    401   /// Collection of I/O-access services.
    402   ///
    403   EFI_PEI_CPU_IO_PPI_ACCESS       Io;
    404 
    405   EFI_PEI_CPU_IO_PPI_IO_READ8     IoRead8;
    406   EFI_PEI_CPU_IO_PPI_IO_READ16    IoRead16;
    407   EFI_PEI_CPU_IO_PPI_IO_READ32    IoRead32;
    408   EFI_PEI_CPU_IO_PPI_IO_READ64    IoRead64;
    409 
    410   EFI_PEI_CPU_IO_PPI_IO_WRITE8    IoWrite8;
    411   EFI_PEI_CPU_IO_PPI_IO_WRITE16   IoWrite16;
    412   EFI_PEI_CPU_IO_PPI_IO_WRITE32   IoWrite32;
    413   EFI_PEI_CPU_IO_PPI_IO_WRITE64   IoWrite64;
    414 
    415   EFI_PEI_CPU_IO_PPI_MEM_READ8    MemRead8;
    416   EFI_PEI_CPU_IO_PPI_MEM_READ16   MemRead16;
    417   EFI_PEI_CPU_IO_PPI_MEM_READ32   MemRead32;
    418   EFI_PEI_CPU_IO_PPI_MEM_READ64   MemRead64;
    419 
    420   EFI_PEI_CPU_IO_PPI_MEM_WRITE8   MemWrite8;
    421   EFI_PEI_CPU_IO_PPI_MEM_WRITE16  MemWrite16;
    422   EFI_PEI_CPU_IO_PPI_MEM_WRITE32  MemWrite32;
    423   EFI_PEI_CPU_IO_PPI_MEM_WRITE64  MemWrite64;
    424 };
    425 
    426 extern EFI_GUID gEfiPeiCpuIoPpiInstalledGuid;
    427 
    428 #endif
    429