Home | History | Annotate | Download | only in Ipf
      1 /*++
      2 
      3 Copyright (c) 2004, 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 Module Name:
     13 
     14   SalDriverLib.h
     15 
     16 Abstract:
     17 
     18   SAL Driver Lib
     19 
     20 Revision History
     21 
     22 --*/
     23 
     24 #ifndef _SAL_DRIVER_LIB_H_
     25 #define _SAL_DRIVER_LIB_H_
     26 
     27 #include "Tiano.h"
     28 #include "EfiDriverLib.h"
     29 #include "SalApi.h"
     30 
     31 #include EFI_PROTOCOL_DEFINITION (ExtendedSalBootService)
     32 #include EFI_PROTOCOL_DEFINITION (ExtendedSalGuid)
     33 
     34 //
     35 //  Assembly Functions
     36 //
     37 SAL_RETURN_REGS
     38 LibGetEsalPhyData (
     39   VOID
     40   )
     41 /*++
     42 
     43 Routine Description:
     44 
     45   Get Esal global data in physical mode.
     46 
     47 Arguments:
     48 
     49   None
     50 
     51 Returns:
     52 
     53   Output regs
     54 
     55 --*/
     56 ;
     57 
     58 SAL_RETURN_REGS
     59 LibGetEsalVirtData (
     60   VOID
     61   )
     62 /*++
     63 
     64 Routine Description:
     65 
     66   Get Esal global data in virtual mode.
     67 
     68 Arguments:
     69 
     70   None
     71 
     72 Returns:
     73 
     74   Output regs
     75 
     76 --*/
     77 ;
     78 
     79 SAL_RETURN_REGS
     80 LibSetEsalPhyData (
     81   IN  VOID                        *Ptr,
     82   IN  UINT64                      GP
     83   )
     84 /*++
     85 
     86 Routine Description:
     87 
     88   Set Esal global data in physical mode.
     89 
     90 Arguments:
     91 
     92   Ptr            - Pointer to the data
     93   GP             - Global pointer
     94 
     95 Returns:
     96 
     97   Output regs
     98 
     99 --*/
    100 ;
    101 
    102 SAL_RETURN_REGS
    103 LibSetEsalVirtData (
    104   IN  VOID                        *Ptr,
    105   IN  UINT64                      GP
    106   )
    107 /*++
    108 
    109 Routine Description:
    110 
    111   Set Esal global data in virtual mode.
    112 
    113 Arguments:
    114 
    115   Ptr            - Pointer to the data
    116   GP             - Global pointer
    117 
    118 Returns:
    119 
    120   Output regs
    121 
    122 --*/
    123 ;
    124 
    125 SAL_RETURN_REGS
    126 LibGetGlobalPhyData (
    127   VOID
    128   )
    129 /*++
    130 
    131 Routine Description:
    132 
    133   Get Esal global data in physical mode.
    134 
    135 Arguments:
    136 
    137   None
    138 
    139 Returns:
    140 
    141   Output regs
    142 
    143 --*/
    144 ;
    145 
    146 SAL_RETURN_REGS
    147 LibGetGlobalVirtData (
    148   VOID
    149   )
    150 /*++
    151 
    152 Routine Description:
    153 
    154   Get Esal global data in virtual mode.
    155 
    156 Arguments:
    157 
    158   None
    159 
    160 Returns:
    161 
    162   Output regs
    163 
    164 --*/
    165 ;
    166 
    167 SAL_RETURN_REGS
    168 LibSetGlobalPhyData (
    169   IN  VOID                        *Ptr,
    170   IN  UINT64                      GP
    171   )
    172 /*++
    173 
    174 Routine Description:
    175 
    176   Set Esal global data in physical mode.
    177 
    178 Arguments:
    179 
    180   Ptr            - Pointer to the data
    181   GP             - Global pointer
    182 
    183 Returns:
    184 
    185   Output regs
    186 
    187 --*/
    188 ;
    189 
    190 SAL_RETURN_REGS
    191 LibSetGlobalVirtData (
    192   IN  VOID                        *Ptr,
    193   IN  UINT64                      GP
    194   )
    195 /*++
    196 
    197 Routine Description:
    198 
    199   Set Esal global data in virtual mode.
    200 
    201 Arguments:
    202 
    203   Ptr            - Pointer to the data
    204   GP             - Global pointer
    205 
    206 Returns:
    207 
    208   Output regs
    209 
    210 --*/
    211 ;
    212 
    213 SAL_RETURN_REGS
    214 GetIrrData (
    215   VOID
    216   )
    217 /*++
    218 
    219 Routine Description:
    220 
    221   Get interrupt request register.
    222 
    223 Arguments:
    224 
    225   None
    226 
    227 Returns:
    228 
    229   Output regs
    230 
    231 --*/
    232 ;
    233 
    234 VOID
    235 PrepareApsForHandOverToOS (
    236   VOID
    237   )
    238 /*++
    239 
    240 Routine Description:
    241 
    242   Prepare AP info for hand over to OS.
    243 
    244 Arguments:
    245 
    246   None
    247 
    248 Returns:
    249 
    250   None
    251 
    252 --*/
    253 ;
    254 
    255 VOID
    256 HandOverApsToOS (
    257   IN UINT64  a1,
    258   IN UINT64  a2,
    259   IN UINT64  a3
    260   )
    261 /*++
    262 
    263 Routine Description:
    264 
    265   Hand over AP info to OS.
    266 
    267 Arguments:
    268 
    269   a1    - Address to call into
    270 
    271   a2    - GP
    272 
    273   a3    - Undefined
    274 
    275 Returns:
    276 
    277   None
    278 
    279 --*/
    280 ;
    281 
    282 SAL_RETURN_REGS
    283 GetPsrData (
    284   VOID
    285   )
    286 /*++
    287 
    288 Routine Description:
    289 
    290   Get PSR register.
    291 
    292 Arguments:
    293 
    294   None
    295 
    296 Returns:
    297 
    298   Output regs.
    299 
    300 --*/
    301 ;
    302 
    303 SAL_RETURN_REGS
    304 GetProcIdData (
    305   VOID
    306   )
    307 /*++
    308 
    309 Routine Description:
    310 
    311   Get LID
    312 
    313 Arguments:
    314 
    315   None
    316 
    317 Returns:
    318 
    319   Output regs
    320 
    321 --*/
    322 ;
    323 
    324 VOID
    325 SwitchCpuStack (
    326   IN  UINT64  NewBsp,
    327   IN  UINT64  OldBsp
    328   )
    329 /*++
    330 
    331 Routine Description:
    332 
    333   Switch BSP
    334 
    335 Arguments:
    336 
    337   NewBsp    - New BSP index
    338   OldBsp    - Old BSP index
    339 
    340 Returns:
    341 
    342   None
    343 
    344 --*/
    345 ;
    346 
    347 //
    348 //  SAL Reset Class
    349 //
    350 VOID
    351 SalResetSystem (
    352   IN EFI_RESET_TYPE                ResetType,
    353   IN EFI_STATUS                    ResetStatus,
    354   IN UINTN                         DataSize,
    355   IN CHAR16                        *ResetData
    356   )
    357 /*++
    358 
    359 Routine Description:
    360 
    361   Reset system
    362 
    363 Arguments:
    364 
    365   ResetType     - Reset type
    366   ResetStatus   - Reset status
    367   DataSize      - Size of ResetData
    368   ResetData     - Description string
    369 
    370 Returns:
    371 
    372   None
    373 
    374 --*/
    375 ;
    376 
    377 //
    378 //  PAL PROC Class
    379 //
    380 SAL_RETURN_REGS
    381 SalPalProc (
    382   IN  UINT64            Arg1,
    383   IN  UINT64            Arg2,
    384   IN  UINT64            Arg3,
    385   IN  UINT64            Arg4
    386   )
    387 /*++
    388 
    389 Routine Description:
    390 
    391   Call pal proc.
    392 
    393 Arguments:
    394 
    395   Arg1          - Pal call index
    396   Arg2          - First arg
    397   Arg3          - Second arg
    398   Arg4          - Third arg
    399 
    400 Returns:
    401 
    402   Output regs
    403 
    404 --*/
    405 ;
    406 
    407 SAL_RETURN_REGS
    408 SalRegisterNewPalEntry (
    409   IN  BOOLEAN                     PhysicalPalAddress,
    410   IN  EFI_PHYSICAL_ADDRESS        NewPalAddress
    411   )
    412 /*++
    413 
    414 Routine Description:
    415 
    416   Register Pal entry.
    417 
    418 Arguments:
    419 
    420   PhysicalPalAddress      - The address is physical or virtual
    421   NewPalAddress           - New Pal entry address
    422 
    423 Returns:
    424 
    425   Output regs
    426 
    427 --*/
    428 ;
    429 
    430 SAL_RETURN_REGS
    431 SalGetPalEntryPointer (
    432   IN  BOOLEAN                     PhysicalPalAddress
    433   )
    434 /*++
    435 
    436 Routine Description:
    437 
    438   Get Pal entry.
    439 
    440 Arguments:
    441 
    442   PhysicalPalAddress      - The address is physical or virtual
    443 
    444 Returns:
    445 
    446   Output regs
    447 
    448 --*/
    449 ;
    450 
    451 //
    452 //  SAL MTC Class
    453 //
    454 EFI_STATUS
    455 SalGetNextHighMonotonicCount (
    456   OUT UINT32                      *HighCount
    457   )
    458 /*++
    459 
    460 Routine Description:
    461 
    462   Get next high 32 bits of monotonic count.
    463 
    464 Arguments:
    465 
    466   HighCount     - High 32 bits of monotonic count.
    467 
    468 Returns:
    469 
    470   Status code
    471 
    472 --*/
    473 ;
    474 
    475 //
    476 //  SAL BASE Class
    477 //
    478 SAL_RETURN_REGS
    479 SalProcSetVectors (
    480   IN  UINT64                      SalVectorType,
    481   IN  UINT64                      PhyAddr1,
    482   IN  UINT64                      Gp1,
    483   IN  UINT64                      LengthCs1,
    484   IN  UINT64                      PhyAddr2,
    485   IN  UINT64                      Gp2,
    486   IN  UINT64                      LengthCs2
    487   )
    488 /*++
    489 
    490 Routine Description:
    491 
    492   Set vectors.
    493 
    494 Arguments:
    495 
    496   SalVectorType     - Vector type
    497   PhyAddr1          - OS MCA entry point
    498   Gp1               - GP for OS MCA entry
    499   LengthCs1         - Length of OS MCA
    500   PhyAddr2          - OS INIT entry point
    501   Gp2               - GP for OS Init entry
    502   LengthCs2         - Length of OS INIT
    503 
    504 Returns:
    505 
    506   Output regs
    507 
    508 --*/
    509 ;
    510 
    511 SAL_RETURN_REGS
    512 SalProcMcRendez (
    513   VOID
    514   )
    515 /*++
    516 
    517 Routine Description:
    518 
    519   Mc rendezvous function.
    520 
    521 Arguments:
    522 
    523   None
    524 
    525 Returns:
    526 
    527   Output regs
    528 
    529 --*/
    530 ;
    531 
    532 SAL_RETURN_REGS
    533 SalProcMcSetParams (
    534   IN  UINT64                      ParamType,
    535   IN  UINT64                      IntOrMem,
    536   IN  UINT64                      IntOrMemVal,
    537   IN  UINT64                      Timeout,
    538   IN  UINT64                      McaOpt
    539   )
    540 /*++
    541 
    542 Routine Description:
    543 
    544   Set MCA parameters.
    545 
    546 Arguments:
    547 
    548   ParamType     - Parameter type
    549   IntOrMem      - Interrupt or memory address
    550   IntOrMemVal   - Interrupt number or memory address value
    551   Timeout       - Time out value
    552   McaOpt        - Option for MCA
    553 
    554 Returns:
    555 
    556   Output regs
    557 
    558 --*/
    559 ;
    560 
    561 SAL_RETURN_REGS
    562 EsalProcGetVectors (
    563   IN  UINT64                      VectorType
    564   )
    565 /*++
    566 
    567 Routine Description:
    568 
    569   Get OS MCA vector.
    570 
    571 Arguments:
    572 
    573   VectorType      - Vector type
    574 
    575 Returns:
    576 
    577   Output regs
    578 
    579 --*/
    580 ;
    581 
    582 SAL_RETURN_REGS
    583 EsalProcMcGetParams (
    584   IN  UINT64                      ParamInfoType
    585   )
    586 /*++
    587 
    588 Routine Description:
    589 
    590   Get MCA parameter.
    591 
    592 Arguments:
    593 
    594   ParamInfoType     - Parameter info type
    595 
    596 Returns:
    597 
    598   Output regs
    599 
    600 --*/
    601 ;
    602 
    603 SAL_RETURN_REGS
    604 EsalProcMcGetMcParams (
    605   VOID
    606   )
    607 /*++
    608 
    609 Routine Description:
    610 
    611   Get MCA parameter.
    612 
    613 Arguments:
    614 
    615 
    616 Returns:
    617 
    618   Output regs
    619 
    620 --*/
    621 ;
    622 
    623 SAL_RETURN_REGS
    624 EsalProcGetMcCheckinFlags (
    625   IN  UINT64                      ProcessorUnit
    626   )
    627 /*++
    628 
    629 Routine Description:
    630 
    631   Get process status.
    632 
    633 Arguments:
    634 
    635   ProcessorUnit     - Processor Index
    636 
    637 Returns:
    638 
    639   Output regs
    640 
    641 --*/
    642 ;
    643 
    644 //
    645 //  Sal Base Class enums
    646 //
    647 typedef enum {
    648   McaVector,
    649   BspInitVector,
    650   BootRendezVector,
    651   ApInitVector
    652 } ESAL_GET_VECTOR_TYPE;
    653 
    654 //
    655 //  Sal RTC Class
    656 //
    657 EFI_STATUS
    658 SalGetTime (
    659   OUT EFI_TIME                     *Time,
    660   OUT EFI_TIME_CAPABILITIES        *Capabilities
    661   )
    662 /*++
    663 
    664 Routine Description:
    665 
    666   Returns the current time and date information, and the time-keeping
    667   capabilities of the hardware platform.
    668 
    669 Arguments:
    670 
    671   Time          - A pointer to storage to receive a snapshot of the current time.
    672   Capabilities  - An optional pointer to a buffer to receive the real time clock device's
    673                   capabilities.
    674 
    675 Returns:
    676 
    677   Status code
    678 
    679 --*/
    680 ;
    681 
    682 EFI_STATUS
    683 SalSetTime (
    684   OUT EFI_TIME                    *Time
    685   )
    686 /*++
    687 
    688 Routine Description:
    689 
    690   Sets the current local time and date information.
    691 
    692 Arguments:
    693 
    694   Time  - A pointer to the current time.
    695 
    696 Returns:
    697 
    698   Status code
    699 
    700 --*/
    701 ;
    702 
    703 EFI_STATUS
    704 SalGetWakeupTime (
    705   OUT BOOLEAN                      *Enabled,
    706   OUT BOOLEAN                      *Pending,
    707   OUT EFI_TIME                     *Time
    708   )
    709 /*++
    710 
    711 Routine Description:
    712 
    713   Returns the current wakeup alarm clock setting.
    714 
    715 Arguments:
    716 
    717   Enabled - Indicates if the alarm is currently enabled or disabled.
    718   Pending - Indicates if the alarm signal is pending and requires acknowledgement.
    719   Time    - The current alarm setting.
    720 
    721 Returns:
    722 
    723   Status code
    724 
    725 --*/
    726 ;
    727 
    728 EFI_STATUS
    729 SalSetWakeupTime (
    730   IN BOOLEAN                      Enable,
    731   IN EFI_TIME                     *Time
    732   )
    733 /*++
    734 
    735 Routine Description:
    736 
    737   Sets the system wakeup alarm clock time.
    738 
    739 Arguments:
    740 
    741   Enable  - Enable or disable the wakeup alarm.
    742   Time    - If Enable is TRUE, the time to set the wakeup alarm for.
    743             If Enable is FALSE, then this parameter is optional, and may be NULL.
    744 
    745 Returns:
    746 
    747   Status code
    748 
    749 --*/
    750 ;
    751 
    752 SAL_RETURN_REGS
    753 SalInitializeThreshold (
    754   IN  VOID                        *ThresholdStruct,
    755   IN  UINT64                      Count,
    756   IN  UINT64                      Duration
    757   )
    758 /*++
    759 
    760 Routine Description:
    761 
    762   Init threshold structure.
    763 
    764 Arguments:
    765 
    766   ThresholdStruct     - Threshold structure
    767   Count               - Threshold count
    768   Duration            - Duration
    769 
    770 Returns:
    771 
    772   Output regs
    773 
    774 --*/
    775 ;
    776 
    777 SAL_RETURN_REGS
    778 SalBumpThresholdCount (
    779   IN  VOID                        *ThresholdStruct,
    780   IN  UINT64                      Count,
    781   IN  UINT64                      Duration
    782   )
    783 /*++
    784 
    785 Routine Description:
    786 
    787   Bump threshold count.
    788 
    789 Arguments:
    790 
    791   ThresholdStruct     - Threshold structure
    792   Count               - Threshold count
    793   Duration            - Duration
    794 
    795 Returns:
    796 
    797   Output regs
    798 
    799 --*/
    800 ;
    801 
    802 SAL_RETURN_REGS
    803 SalGetThresholdCount (
    804   IN  VOID                        *ThresholdStruct,
    805   IN  UINT64                      Count,
    806   IN  UINT64                      Duration
    807   )
    808 /*++
    809 
    810 Routine Description:
    811 
    812   Get threshold structure.
    813 
    814 Arguments:
    815 
    816   ThresholdStruct     - Threshold structure
    817   Count               - Threshold count
    818   Duration            - Duration
    819 
    820 Returns:
    821 
    822   Output regs
    823 
    824 --*/
    825 ;
    826 
    827 //
    828 //  Common Lib Function
    829 //
    830 EFI_STATUS
    831 RegisterEsalFunction (
    832   IN  UINT64                                    FunctionId,
    833   IN  EFI_GUID                                  *ClassGuid,
    834   IN  SAL_INTERNAL_EXTENDED_SAL_PROC            Function,
    835   IN  VOID                                      *ModuleGlobal
    836   )
    837 /*++
    838 
    839 Routine Description:
    840 
    841   Register ESAL Class Function and it's asociated global.
    842   This function is boot service only!
    843 
    844 Arguments:
    845   FunctionId    - ID of function to register
    846   ClassGuid     - GUID of function class
    847   Function      - Function to register under ClassGuid/FunctionId pair
    848   ModuleGlobal  - Module global for Function.
    849 
    850 Returns:
    851   EFI_SUCCESS - If ClassGuid/FunctionId Function was registered.
    852 
    853 --*/
    854 ;
    855 
    856 EFI_STATUS
    857 EfiInitializeSalDriverLib (
    858   IN  BOOLEAN   Runtime
    859   )
    860 /*++
    861 
    862 Routine Description:
    863 
    864   Initialize Sal driver lib.
    865 
    866 Arguments:
    867   Runtime     - At runtime or not?
    868 
    869 Returns:
    870   Status code
    871 
    872 --*/
    873 ;
    874 
    875 //
    876 // MCA PMI INIT Registeration Functions.
    877 //
    878 EFI_STATUS
    879 LibRegisterMcaFunction (
    880   IN  EFI_SAL_MCA_HANDLER                   McaHandler,
    881   IN  VOID                                  *ModuleGlobal,
    882   IN  BOOLEAN                               MakeFirst,
    883   IN  BOOLEAN                               MakeLast
    884   )
    885 /*++
    886 
    887 Routine Description:
    888 
    889   Register MCA handler.
    890 
    891 Arguments:
    892   McaHandler      - MCA handler
    893   ModuleGlobal    - Module global for function
    894   MakeFirst       - Make it as first?
    895   MakeLast        - Make it as last?
    896 
    897 Returns:
    898   Status code
    899 
    900 --*/
    901 ;
    902 
    903 EFI_STATUS
    904 LibRegisterPmiFunction (
    905   IN  EFI_SAL_PMI_HANDLER                   PmiHandler,
    906   IN  VOID                                  *ModuleGlobal,
    907   IN  BOOLEAN                               MakeFirst,
    908   IN  BOOLEAN                               MakeLast
    909   )
    910 /*++
    911 
    912 Routine Description:
    913 
    914   Register PMI handler.
    915 
    916 Arguments:
    917   PmiHandler      - PMI handler
    918   ModuleGlobal    - Module global for function
    919   MakeFirst       - Make it as first?
    920   MakeLast        - Make it as last?
    921 
    922 Returns:
    923   Status code
    924 
    925 --*/
    926 ;
    927 
    928 EFI_STATUS
    929 LibRegisterInitFunction (
    930   IN  EFI_SAL_INIT_HANDLER                  InitHandler,
    931   IN  VOID                                  *ModuleGlobal,
    932   IN  BOOLEAN                               MakeFirst,
    933   IN  BOOLEAN                               MakeLast
    934   )
    935 /*++
    936 
    937 Routine Description:
    938 
    939   Register INIT handler.
    940 
    941 Arguments:
    942   InitHandler     - INIT handler
    943   ModuleGlobal    - Module global for function
    944   MakeFirst       - Make it as first?
    945   MakeLast        - Make it as last?
    946 
    947 Returns:
    948   Status code
    949 
    950 --*/
    951 ;
    952 
    953 //
    954 //  Base IO Class Functions
    955 //
    956 EFI_STATUS
    957 ESalIoRead (
    958   IN     EFI_CPU_IO_PROTOCOL_WIDTH  Width,
    959   IN     UINT64                     Address,
    960   IN     UINTN                      Count,
    961   IN OUT VOID                       *Buffer
    962   )
    963 /*++
    964 
    965 Routine Description:
    966 
    967   Io read operation.
    968 
    969 Arguments:
    970 
    971   Width   - Width of read operation
    972   Address - Start IO address to read
    973   Count   - Read count
    974   Buffer  - Buffer to store result
    975 
    976 Returns:
    977 
    978   Status code
    979 
    980 --*/
    981 ;
    982 
    983 EFI_STATUS
    984 ESalIoWrite (
    985   IN     EFI_CPU_IO_PROTOCOL_WIDTH  Width,
    986   IN     UINT64                     Address,
    987   IN     UINTN                      Count,
    988   IN OUT VOID                       *Buffer
    989   )
    990 /*++
    991 
    992 Routine Description:
    993 
    994   Io write operation.
    995 
    996 Arguments:
    997 
    998   Width   - Width of write operation
    999   Address - Start IO address to write
   1000   Count   - Write count
   1001   Buffer  - Buffer to write to the address
   1002 
   1003 Returns:
   1004 
   1005   Status code
   1006 
   1007 --*/
   1008 ;
   1009 
   1010 EFI_STATUS
   1011 ESalMemRead (
   1012   IN     EFI_CPU_IO_PROTOCOL_WIDTH   Width,
   1013   IN     UINT64                      Address,
   1014   IN     UINTN                       Count,
   1015   IN  OUT VOID                       *Buffer
   1016   )
   1017 /*++
   1018 
   1019 Routine Description:
   1020   Perform a Memory mapped IO read into Buffer.
   1021 
   1022 Arguments:
   1023   Width   - Width of each read transaction.
   1024   Address - Memory mapped IO address to read
   1025   Count   - Number of Width quanta to read
   1026   Buffer  - Buffer to read data into. size is Width * Count
   1027 
   1028 Returns:
   1029   Status code
   1030 
   1031 --*/
   1032 ;
   1033 
   1034 EFI_STATUS
   1035 ESalMemWrite (
   1036   IN     EFI_CPU_IO_PROTOCOL_WIDTH   Width,
   1037   IN     UINT64                      Address,
   1038   IN     UINTN                       Count,
   1039   IN OUT VOID                        *Buffer
   1040   )
   1041 /*++
   1042 
   1043 Routine Description:
   1044   Perform a memory mapped IO write into Buffer.
   1045 
   1046 Arguments:
   1047   Width   - Width of write transaction, and repeat operation to use
   1048   Address - IO address to write
   1049   Count   - Number of times to write the IO address.
   1050   Buffer  - Buffer to write data from. size is Width * Count
   1051 
   1052 Returns:
   1053   Status code
   1054 
   1055 --*/
   1056 ;
   1057 
   1058 //
   1059 //  PCI Class Functions
   1060 //
   1061 SAL_RETURN_REGS
   1062 SalPCIConfigRead (
   1063   IN  UINT64              Address,
   1064   IN  UINT64              Size
   1065   )
   1066 /*++
   1067 
   1068 Routine Description:
   1069   Pci config space read.
   1070 
   1071 Arguments:
   1072   Address - PCI address to read
   1073   Size    - Size to read
   1074 
   1075 Returns:
   1076   Output regs
   1077 
   1078 --*/
   1079 ;
   1080 
   1081 SAL_RETURN_REGS
   1082 SalPCIConfigWrite (
   1083   IN  UINT64              Address,
   1084   IN  UINT64              Size,
   1085   IN  UINT64              Value
   1086   )
   1087 /*++
   1088 
   1089 Routine Description:
   1090   Pci config space write.
   1091 
   1092 Arguments:
   1093   Address - PCI address to write
   1094   Size    - Size to write
   1095   Value   - Value to write
   1096 
   1097 Returns:
   1098   Output regs
   1099 
   1100 --*/
   1101 ;
   1102 
   1103 //
   1104 //  MP Class Functions
   1105 //
   1106 SAL_RETURN_REGS
   1107 LibMPAddCpuData (
   1108   IN    UINT64      CpuGlobalId,
   1109   IN    BOOLEAN     Enabled,
   1110   IN    UINT64      PalCompatability
   1111   )
   1112 /*++
   1113 
   1114 Routine Description:
   1115   Add CPU data.
   1116 
   1117 Arguments:
   1118   CpuGlobalId         - CPU ID
   1119   Enabled             - Enabled or not
   1120   PalCompatability    - Pal compatability
   1121 
   1122 Returns:
   1123   Output regs
   1124 
   1125 --*/
   1126 ;
   1127 
   1128 SAL_RETURN_REGS
   1129 LibMPRemoveCpuData (
   1130   IN    UINT64      CpuGlobalId
   1131   )
   1132 /*++
   1133 
   1134 Routine Description:
   1135   Remove CPU data.
   1136 
   1137 Arguments:
   1138   CpuGlobalId         - CPU ID
   1139 
   1140 Returns:
   1141   Output regs
   1142 
   1143 --*/
   1144 ;
   1145 
   1146 SAL_RETURN_REGS
   1147 LibMPModifyCpuData (
   1148   IN    UINT64      CpuGlobalId,
   1149   IN    BOOLEAN     Enabled,
   1150   IN    UINT64      PalCompatability
   1151   )
   1152 /*++
   1153 
   1154 Routine Description:
   1155   Modify CPU data.
   1156 
   1157 Arguments:
   1158   CpuGlobalId         - CPU ID
   1159   Enabled             - Enabled or not
   1160   PalCompatability    - Pal compatability
   1161 
   1162 Returns:
   1163   Output regs
   1164 
   1165 --*/
   1166 ;
   1167 
   1168 SAL_RETURN_REGS
   1169 LibMPGetCpuDataByID (
   1170   IN    UINT64      CpuGlobalId,
   1171   IN    BOOLEAN     IndexByEnabledCpu
   1172   )
   1173 /*++
   1174 
   1175 Routine Description:
   1176   Get CPU data.
   1177 
   1178 Arguments:
   1179   CpuGlobalId         - CPU ID
   1180   IndexByEnabledCpu   - Whether indexed by enabled CPU
   1181 
   1182 Returns:
   1183   Output regs
   1184 
   1185 --*/
   1186 ;
   1187 
   1188 SAL_RETURN_REGS
   1189 LibMPGetCpuDataByIndex (
   1190   IN    UINT64      Index,
   1191   IN    BOOLEAN     IndexByEnabledCpu
   1192   )
   1193 /*++
   1194 
   1195 Routine Description:
   1196   Get CPU data.
   1197 
   1198 Arguments:
   1199   Index               - CPU index
   1200   IndexByEnabledCpu   - Whether indexed by enabled CPU
   1201 
   1202 Returns:
   1203   Output regs
   1204 
   1205 --*/
   1206 ;
   1207 
   1208 SAL_RETURN_REGS
   1209 LibMPSendIpi (
   1210   IN  UINT64                ProcessorNumber,
   1211   IN  UINT64                VectorNumber,
   1212   IN  EFI_DELIVERY_MODE     DeliveryMode,
   1213   IN  BOOLEAN               IRFlag
   1214   )
   1215 /*++
   1216 
   1217 Routine Description:
   1218   Send IPI.
   1219 
   1220 Arguments:
   1221   ProcessorNumber         - Processor number
   1222   VectorNumber            - Vector number
   1223   DeliveryMode            - Delivery mode
   1224   IRFlag                  - Interrupt Redirection flag
   1225 
   1226 Returns:
   1227   Output regs
   1228 
   1229 --*/
   1230 ;
   1231 
   1232 SAL_RETURN_REGS
   1233 LibMpCurrentProcessor (
   1234   IN    BOOLEAN     IndexByEnabledCpu
   1235   )
   1236 /*++
   1237 
   1238 Routine Description:
   1239   Get current processor index.
   1240 
   1241 Arguments:
   1242   IndexByEnabledCpu       - Whether indexed by enabled CPU
   1243 
   1244 Returns:
   1245   Output regs
   1246 
   1247 --*/
   1248 ;
   1249 
   1250 SAL_RETURN_REGS
   1251 LibGetNumProcessors (
   1252   VOID
   1253   )
   1254 /*++
   1255 
   1256 Routine Description:
   1257   Get number of processors.
   1258 
   1259 Arguments:
   1260   None
   1261 
   1262 Returns:
   1263   Output regs
   1264 
   1265 --*/
   1266 ;
   1267 
   1268 SAL_RETURN_REGS
   1269 LibMpSaveMinStatePointer (
   1270   IN    UINT64                CpuGlobalId,
   1271   IN    EFI_PHYSICAL_ADDRESS  MinStatePointer
   1272   )
   1273 /*++
   1274 
   1275 Routine Description:
   1276   Register pointer to save min state.
   1277 
   1278 Arguments:
   1279   CpuGlobalId       - CPU global ID
   1280   MinStatePointer   - Pointer to save min state
   1281 
   1282 Returns:
   1283   Output regs
   1284 
   1285 --*/
   1286 ;
   1287 
   1288 SAL_RETURN_REGS
   1289 LibMpRestoreMinStatePointer (
   1290   IN    UINT64                CpuGlobalId
   1291   )
   1292 /*++
   1293 
   1294 Routine Description:
   1295   Restore pointer to save min state.
   1296 
   1297 Arguments:
   1298   CpuGlobalId       - CPU global ID
   1299 
   1300 Returns:
   1301   Output regs
   1302 
   1303 --*/
   1304 ;
   1305 
   1306 //
   1307 //  MCA Class Functions
   1308 //
   1309 EFI_STATUS
   1310 LibMcaGetStateInfo (
   1311   IN  UINT64                                      CpuId,
   1312   OUT EFI_PHYSICAL_ADDRESS                        *StateBufferPointer,
   1313   OUT UINT64                                      *RequiredStateBufferSize
   1314   )
   1315 /*++
   1316 
   1317 Routine Description:
   1318   MCA get state info.
   1319 
   1320 Arguments:
   1321   CpuId                   - CPU ID
   1322   StateBufferPointer      - Pointer of state buffer
   1323   RequiredStateBufferSize - Size of required state buffer
   1324 
   1325 Returns:
   1326   Status code
   1327 
   1328 --*/
   1329 ;
   1330 
   1331 EFI_STATUS
   1332 LibMcaRegisterCpu (
   1333   IN  UINT64                                      CpuId,
   1334   IN  EFI_PHYSICAL_ADDRESS                        StateBufferAddress
   1335   )
   1336 /*++
   1337 
   1338 Routine Description:
   1339   MCA register CPU state info.
   1340 
   1341 Arguments:
   1342   CpuId                   - CPU ID
   1343   StateBufferAddress      - Pointer of state buffer
   1344 
   1345 Returns:
   1346   Status code
   1347 
   1348 --*/
   1349 ;
   1350 
   1351 //
   1352 // SAL ELOG Functions
   1353 //
   1354 EFI_STATUS
   1355 LibSalGetStateInfo (
   1356   IN  UINT64                                      McaType,
   1357   IN  UINT8                                       *McaBuffer,
   1358   OUT UINTN                                       *Size
   1359   )
   1360 /*++
   1361 
   1362 Routine Description:
   1363   Get state info.
   1364 
   1365 Arguments:
   1366   McaType                 - MCA type
   1367   McaBuffer               - Info buffer provided by caller
   1368   Size                    - Size of info
   1369 
   1370 Returns:
   1371   Status code
   1372 
   1373 --*/
   1374 ;
   1375 
   1376 EFI_STATUS
   1377 LibSalGetStateInfoSize (
   1378   IN  UINT64                                      McaType,
   1379   OUT UINTN                                       *Size
   1380   )
   1381 /*++
   1382 
   1383 Routine Description:
   1384   Get state info size.
   1385 
   1386 Arguments:
   1387   McaType                   - MCA type
   1388   Size                      - Size required
   1389 
   1390 Returns:
   1391   Status code
   1392 
   1393 --*/
   1394 ;
   1395 
   1396 EFI_STATUS
   1397 LibSalClearStateInfo (
   1398   IN  UINT64                                      McaType
   1399   )
   1400 /*++
   1401 
   1402 Routine Description:
   1403   Clear state info.
   1404 
   1405 Arguments:
   1406   McaType                   - MCA type
   1407 
   1408 Returns:
   1409   Status code
   1410 
   1411 --*/
   1412 ;
   1413 
   1414 EFI_STATUS
   1415 LibEsalGetStateBuffer (
   1416   IN  UINT64                                      McaType,
   1417   OUT UINT8                                       **McaBuffer,
   1418   OUT UINTN                                       *Index
   1419   )
   1420 /*++
   1421 
   1422 Routine Description:
   1423   Get state buffer.
   1424 
   1425 Arguments:
   1426   McaType                   - MCA type
   1427   McaBuffer                 - MCA buffer
   1428   Index                     - CPU index
   1429 
   1430 Returns:
   1431   Status code
   1432 
   1433 --*/
   1434 ;
   1435 
   1436 EFI_STATUS
   1437 LibEsalSaveStateBuffer (
   1438   IN  UINT64                                      McaType
   1439   )
   1440 /*++
   1441 
   1442 Routine Description:
   1443   Save state buffer.
   1444 
   1445 Arguments:
   1446   McaType                   - MCA type
   1447 
   1448 Returns:
   1449   Status code
   1450 
   1451 --*/
   1452 ;
   1453 
   1454 #endif
   1455