PageRenderTime 539ms CodeModel.GetById 40ms RepoModel.GetById 1ms app.codeStats 0ms

/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Ipf/SalDriverLib.h

https://bitbucket.org/incubaid/edk2
C Header | 1454 lines | 398 code | 66 blank | 990 comment | 0 complexity | 9bf4b5368684cc71c0ec8701f232b852 MD5 | raw file
  1. /*++
  2. Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>
  3. This program and the accompanying materials
  4. are licensed and made available under the terms and conditions of the BSD License
  5. which accompanies this distribution. The full text of the license may be found at
  6. http://opensource.org/licenses/bsd-license.php
  7. THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
  8. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
  9. Module Name:
  10. SalDriverLib.h
  11. Abstract:
  12. SAL Driver Lib
  13. Revision History
  14. --*/
  15. #ifndef _SAL_DRIVER_LIB_H_
  16. #define _SAL_DRIVER_LIB_H_
  17. #include "Tiano.h"
  18. #include "EfiDriverLib.h"
  19. #include "SalApi.h"
  20. #include EFI_PROTOCOL_DEFINITION (ExtendedSalBootService)
  21. #include EFI_PROTOCOL_DEFINITION (ExtendedSalGuid)
  22. //
  23. // Assembly Functions
  24. //
  25. SAL_RETURN_REGS
  26. LibGetEsalPhyData (
  27. VOID
  28. )
  29. /*++
  30. Routine Description:
  31. Get Esal global data in physical mode.
  32. Arguments:
  33. None
  34. Returns:
  35. Output regs
  36. --*/
  37. ;
  38. SAL_RETURN_REGS
  39. LibGetEsalVirtData (
  40. VOID
  41. )
  42. /*++
  43. Routine Description:
  44. Get Esal global data in virtual mode.
  45. Arguments:
  46. None
  47. Returns:
  48. Output regs
  49. --*/
  50. ;
  51. SAL_RETURN_REGS
  52. LibSetEsalPhyData (
  53. IN VOID *Ptr,
  54. IN UINT64 GP
  55. )
  56. /*++
  57. Routine Description:
  58. Set Esal global data in physical mode.
  59. Arguments:
  60. Ptr - Pointer to the data
  61. GP - Global pointer
  62. Returns:
  63. Output regs
  64. --*/
  65. ;
  66. SAL_RETURN_REGS
  67. LibSetEsalVirtData (
  68. IN VOID *Ptr,
  69. IN UINT64 GP
  70. )
  71. /*++
  72. Routine Description:
  73. Set Esal global data in virtual mode.
  74. Arguments:
  75. Ptr - Pointer to the data
  76. GP - Global pointer
  77. Returns:
  78. Output regs
  79. --*/
  80. ;
  81. SAL_RETURN_REGS
  82. LibGetGlobalPhyData (
  83. VOID
  84. )
  85. /*++
  86. Routine Description:
  87. Get Esal global data in physical mode.
  88. Arguments:
  89. None
  90. Returns:
  91. Output regs
  92. --*/
  93. ;
  94. SAL_RETURN_REGS
  95. LibGetGlobalVirtData (
  96. VOID
  97. )
  98. /*++
  99. Routine Description:
  100. Get Esal global data in virtual mode.
  101. Arguments:
  102. None
  103. Returns:
  104. Output regs
  105. --*/
  106. ;
  107. SAL_RETURN_REGS
  108. LibSetGlobalPhyData (
  109. IN VOID *Ptr,
  110. IN UINT64 GP
  111. )
  112. /*++
  113. Routine Description:
  114. Set Esal global data in physical mode.
  115. Arguments:
  116. Ptr - Pointer to the data
  117. GP - Global pointer
  118. Returns:
  119. Output regs
  120. --*/
  121. ;
  122. SAL_RETURN_REGS
  123. LibSetGlobalVirtData (
  124. IN VOID *Ptr,
  125. IN UINT64 GP
  126. )
  127. /*++
  128. Routine Description:
  129. Set Esal global data in virtual mode.
  130. Arguments:
  131. Ptr - Pointer to the data
  132. GP - Global pointer
  133. Returns:
  134. Output regs
  135. --*/
  136. ;
  137. SAL_RETURN_REGS
  138. GetIrrData (
  139. VOID
  140. )
  141. /*++
  142. Routine Description:
  143. Get interrupt request register.
  144. Arguments:
  145. None
  146. Returns:
  147. Output regs
  148. --*/
  149. ;
  150. VOID
  151. PrepareApsForHandOverToOS (
  152. VOID
  153. )
  154. /*++
  155. Routine Description:
  156. Prepare AP info for hand over to OS.
  157. Arguments:
  158. None
  159. Returns:
  160. None
  161. --*/
  162. ;
  163. VOID
  164. HandOverApsToOS (
  165. IN UINT64 a1,
  166. IN UINT64 a2,
  167. IN UINT64 a3
  168. )
  169. /*++
  170. Routine Description:
  171. Hand over AP info to OS.
  172. Arguments:
  173. a1 - Address to call into
  174. a2 - GP
  175. a3 - Undefined
  176. Returns:
  177. None
  178. --*/
  179. ;
  180. SAL_RETURN_REGS
  181. GetPsrData (
  182. VOID
  183. )
  184. /*++
  185. Routine Description:
  186. Get PSR register.
  187. Arguments:
  188. None
  189. Returns:
  190. Output regs.
  191. --*/
  192. ;
  193. SAL_RETURN_REGS
  194. GetProcIdData (
  195. VOID
  196. )
  197. /*++
  198. Routine Description:
  199. Get LID
  200. Arguments:
  201. None
  202. Returns:
  203. Output regs
  204. --*/
  205. ;
  206. VOID
  207. SwitchCpuStack (
  208. IN UINT64 NewBsp,
  209. IN UINT64 OldBsp
  210. )
  211. /*++
  212. Routine Description:
  213. Switch BSP
  214. Arguments:
  215. NewBsp - New BSP index
  216. OldBsp - Old BSP index
  217. Returns:
  218. None
  219. --*/
  220. ;
  221. //
  222. // SAL Reset Class
  223. //
  224. VOID
  225. SalResetSystem (
  226. IN EFI_RESET_TYPE ResetType,
  227. IN EFI_STATUS ResetStatus,
  228. IN UINTN DataSize,
  229. IN CHAR16 *ResetData
  230. )
  231. /*++
  232. Routine Description:
  233. Reset system
  234. Arguments:
  235. ResetType - Reset type
  236. ResetStatus - Reset status
  237. DataSize - Size of ResetData
  238. ResetData - Description string
  239. Returns:
  240. None
  241. --*/
  242. ;
  243. //
  244. // PAL PROC Class
  245. //
  246. SAL_RETURN_REGS
  247. SalPalProc (
  248. IN UINT64 Arg1,
  249. IN UINT64 Arg2,
  250. IN UINT64 Arg3,
  251. IN UINT64 Arg4
  252. )
  253. /*++
  254. Routine Description:
  255. Call pal proc.
  256. Arguments:
  257. Arg1 - Pal call index
  258. Arg2 - First arg
  259. Arg3 - Second arg
  260. Arg4 - Third arg
  261. Returns:
  262. Output regs
  263. --*/
  264. ;
  265. SAL_RETURN_REGS
  266. SalRegisterNewPalEntry (
  267. IN BOOLEAN PhysicalPalAddress,
  268. IN EFI_PHYSICAL_ADDRESS NewPalAddress
  269. )
  270. /*++
  271. Routine Description:
  272. Register Pal entry.
  273. Arguments:
  274. PhysicalPalAddress - The address is physical or virtual
  275. NewPalAddress - New Pal entry address
  276. Returns:
  277. Output regs
  278. --*/
  279. ;
  280. SAL_RETURN_REGS
  281. SalGetPalEntryPointer (
  282. IN BOOLEAN PhysicalPalAddress
  283. )
  284. /*++
  285. Routine Description:
  286. Get Pal entry.
  287. Arguments:
  288. PhysicalPalAddress - The address is physical or virtual
  289. Returns:
  290. Output regs
  291. --*/
  292. ;
  293. //
  294. // SAL MTC Class
  295. //
  296. EFI_STATUS
  297. SalGetNextHighMonotonicCount (
  298. OUT UINT32 *HighCount
  299. )
  300. /*++
  301. Routine Description:
  302. Get next high 32 bits of monotonic count.
  303. Arguments:
  304. HighCount - High 32 bits of monotonic count.
  305. Returns:
  306. Status code
  307. --*/
  308. ;
  309. //
  310. // SAL BASE Class
  311. //
  312. SAL_RETURN_REGS
  313. SalProcSetVectors (
  314. IN UINT64 SalVectorType,
  315. IN UINT64 PhyAddr1,
  316. IN UINT64 Gp1,
  317. IN UINT64 LengthCs1,
  318. IN UINT64 PhyAddr2,
  319. IN UINT64 Gp2,
  320. IN UINT64 LengthCs2
  321. )
  322. /*++
  323. Routine Description:
  324. Set vectors.
  325. Arguments:
  326. SalVectorType - Vector type
  327. PhyAddr1 - OS MCA entry point
  328. Gp1 - GP for OS MCA entry
  329. LengthCs1 - Length of OS MCA
  330. PhyAddr2 - OS INIT entry point
  331. Gp2 - GP for OS Init entry
  332. LengthCs2 - Length of OS INIT
  333. Returns:
  334. Output regs
  335. --*/
  336. ;
  337. SAL_RETURN_REGS
  338. SalProcMcRendez (
  339. VOID
  340. )
  341. /*++
  342. Routine Description:
  343. Mc rendezvous function.
  344. Arguments:
  345. None
  346. Returns:
  347. Output regs
  348. --*/
  349. ;
  350. SAL_RETURN_REGS
  351. SalProcMcSetParams (
  352. IN UINT64 ParamType,
  353. IN UINT64 IntOrMem,
  354. IN UINT64 IntOrMemVal,
  355. IN UINT64 Timeout,
  356. IN UINT64 McaOpt
  357. )
  358. /*++
  359. Routine Description:
  360. Set MCA parameters.
  361. Arguments:
  362. ParamType - Parameter type
  363. IntOrMem - Interrupt or memory address
  364. IntOrMemVal - Interrupt number or memory address value
  365. Timeout - Time out value
  366. McaOpt - Option for MCA
  367. Returns:
  368. Output regs
  369. --*/
  370. ;
  371. SAL_RETURN_REGS
  372. EsalProcGetVectors (
  373. IN UINT64 VectorType
  374. )
  375. /*++
  376. Routine Description:
  377. Get OS MCA vector.
  378. Arguments:
  379. VectorType - Vector type
  380. Returns:
  381. Output regs
  382. --*/
  383. ;
  384. SAL_RETURN_REGS
  385. EsalProcMcGetParams (
  386. IN UINT64 ParamInfoType
  387. )
  388. /*++
  389. Routine Description:
  390. Get MCA parameter.
  391. Arguments:
  392. ParamInfoType - Parameter info type
  393. Returns:
  394. Output regs
  395. --*/
  396. ;
  397. SAL_RETURN_REGS
  398. EsalProcMcGetMcParams (
  399. VOID
  400. )
  401. /*++
  402. Routine Description:
  403. Get MCA parameter.
  404. Arguments:
  405. Returns:
  406. Output regs
  407. --*/
  408. ;
  409. SAL_RETURN_REGS
  410. EsalProcGetMcCheckinFlags (
  411. IN UINT64 ProcessorUnit
  412. )
  413. /*++
  414. Routine Description:
  415. Get process status.
  416. Arguments:
  417. ProcessorUnit - Processor Index
  418. Returns:
  419. Output regs
  420. --*/
  421. ;
  422. //
  423. // Sal Base Class enums
  424. //
  425. typedef enum {
  426. McaVector,
  427. BspInitVector,
  428. BootRendezVector,
  429. ApInitVector
  430. } ESAL_GET_VECTOR_TYPE;
  431. //
  432. // Sal RTC Class
  433. //
  434. EFI_STATUS
  435. SalGetTime (
  436. OUT EFI_TIME *Time,
  437. OUT EFI_TIME_CAPABILITIES *Capabilities
  438. )
  439. /*++
  440. Routine Description:
  441. Returns the current time and date information, and the time-keeping
  442. capabilities of the hardware platform.
  443. Arguments:
  444. Time - A pointer to storage to receive a snapshot of the current time.
  445. Capabilities - An optional pointer to a buffer to receive the real time clock device's
  446. capabilities.
  447. Returns:
  448. Status code
  449. --*/
  450. ;
  451. EFI_STATUS
  452. SalSetTime (
  453. OUT EFI_TIME *Time
  454. )
  455. /*++
  456. Routine Description:
  457. Sets the current local time and date information.
  458. Arguments:
  459. Time - A pointer to the current time.
  460. Returns:
  461. Status code
  462. --*/
  463. ;
  464. EFI_STATUS
  465. SalGetWakeupTime (
  466. OUT BOOLEAN *Enabled,
  467. OUT BOOLEAN *Pending,
  468. OUT EFI_TIME *Time
  469. )
  470. /*++
  471. Routine Description:
  472. Returns the current wakeup alarm clock setting.
  473. Arguments:
  474. Enabled - Indicates if the alarm is currently enabled or disabled.
  475. Pending - Indicates if the alarm signal is pending and requires acknowledgement.
  476. Time - The current alarm setting.
  477. Returns:
  478. Status code
  479. --*/
  480. ;
  481. EFI_STATUS
  482. SalSetWakeupTime (
  483. IN BOOLEAN Enable,
  484. IN EFI_TIME *Time
  485. )
  486. /*++
  487. Routine Description:
  488. Sets the system wakeup alarm clock time.
  489. Arguments:
  490. Enable - Enable or disable the wakeup alarm.
  491. Time - If Enable is TRUE, the time to set the wakeup alarm for.
  492. If Enable is FALSE, then this parameter is optional, and may be NULL.
  493. Returns:
  494. Status code
  495. --*/
  496. ;
  497. SAL_RETURN_REGS
  498. SalInitializeThreshold (
  499. IN VOID *ThresholdStruct,
  500. IN UINT64 Count,
  501. IN UINT64 Duration
  502. )
  503. /*++
  504. Routine Description:
  505. Init threshold structure.
  506. Arguments:
  507. ThresholdStruct - Threshold structure
  508. Count - Threshold count
  509. Duration - Duration
  510. Returns:
  511. Output regs
  512. --*/
  513. ;
  514. SAL_RETURN_REGS
  515. SalBumpThresholdCount (
  516. IN VOID *ThresholdStruct,
  517. IN UINT64 Count,
  518. IN UINT64 Duration
  519. )
  520. /*++
  521. Routine Description:
  522. Bump threshold count.
  523. Arguments:
  524. ThresholdStruct - Threshold structure
  525. Count - Threshold count
  526. Duration - Duration
  527. Returns:
  528. Output regs
  529. --*/
  530. ;
  531. SAL_RETURN_REGS
  532. SalGetThresholdCount (
  533. IN VOID *ThresholdStruct,
  534. IN UINT64 Count,
  535. IN UINT64 Duration
  536. )
  537. /*++
  538. Routine Description:
  539. Get threshold structure.
  540. Arguments:
  541. ThresholdStruct - Threshold structure
  542. Count - Threshold count
  543. Duration - Duration
  544. Returns:
  545. Output regs
  546. --*/
  547. ;
  548. //
  549. // Common Lib Function
  550. //
  551. EFI_STATUS
  552. RegisterEsalFunction (
  553. IN UINT64 FunctionId,
  554. IN EFI_GUID *ClassGuid,
  555. IN SAL_INTERNAL_EXTENDED_SAL_PROC Function,
  556. IN VOID *ModuleGlobal
  557. )
  558. /*++
  559. Routine Description:
  560. Register ESAL Class Function and it's asociated global.
  561. This function is boot service only!
  562. Arguments:
  563. FunctionId - ID of function to register
  564. ClassGuid - GUID of function class
  565. Function - Function to register under ClassGuid/FunctionId pair
  566. ModuleGlobal - Module global for Function.
  567. Returns:
  568. EFI_SUCCESS - If ClassGuid/FunctionId Function was registered.
  569. --*/
  570. ;
  571. EFI_STATUS
  572. EfiInitializeSalDriverLib (
  573. IN BOOLEAN Runtime
  574. )
  575. /*++
  576. Routine Description:
  577. Initialize Sal driver lib.
  578. Arguments:
  579. Runtime - At runtime or not?
  580. Returns:
  581. Status code
  582. --*/
  583. ;
  584. //
  585. // MCA PMI INIT Registeration Functions.
  586. //
  587. EFI_STATUS
  588. LibRegisterMcaFunction (
  589. IN EFI_SAL_MCA_HANDLER McaHandler,
  590. IN VOID *ModuleGlobal,
  591. IN BOOLEAN MakeFirst,
  592. IN BOOLEAN MakeLast
  593. )
  594. /*++
  595. Routine Description:
  596. Register MCA handler.
  597. Arguments:
  598. McaHandler - MCA handler
  599. ModuleGlobal - Module global for function
  600. MakeFirst - Make it as first?
  601. MakeLast - Make it as last?
  602. Returns:
  603. Status code
  604. --*/
  605. ;
  606. EFI_STATUS
  607. LibRegisterPmiFunction (
  608. IN EFI_SAL_PMI_HANDLER PmiHandler,
  609. IN VOID *ModuleGlobal,
  610. IN BOOLEAN MakeFirst,
  611. IN BOOLEAN MakeLast
  612. )
  613. /*++
  614. Routine Description:
  615. Register PMI handler.
  616. Arguments:
  617. PmiHandler - PMI handler
  618. ModuleGlobal - Module global for function
  619. MakeFirst - Make it as first?
  620. MakeLast - Make it as last?
  621. Returns:
  622. Status code
  623. --*/
  624. ;
  625. EFI_STATUS
  626. LibRegisterInitFunction (
  627. IN EFI_SAL_INIT_HANDLER InitHandler,
  628. IN VOID *ModuleGlobal,
  629. IN BOOLEAN MakeFirst,
  630. IN BOOLEAN MakeLast
  631. )
  632. /*++
  633. Routine Description:
  634. Register INIT handler.
  635. Arguments:
  636. InitHandler - INIT handler
  637. ModuleGlobal - Module global for function
  638. MakeFirst - Make it as first?
  639. MakeLast - Make it as last?
  640. Returns:
  641. Status code
  642. --*/
  643. ;
  644. //
  645. // Base IO Class Functions
  646. //
  647. EFI_STATUS
  648. ESalIoRead (
  649. IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
  650. IN UINT64 Address,
  651. IN UINTN Count,
  652. IN OUT VOID *Buffer
  653. )
  654. /*++
  655. Routine Description:
  656. Io read operation.
  657. Arguments:
  658. Width - Width of read operation
  659. Address - Start IO address to read
  660. Count - Read count
  661. Buffer - Buffer to store result
  662. Returns:
  663. Status code
  664. --*/
  665. ;
  666. EFI_STATUS
  667. ESalIoWrite (
  668. IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
  669. IN UINT64 Address,
  670. IN UINTN Count,
  671. IN OUT VOID *Buffer
  672. )
  673. /*++
  674. Routine Description:
  675. Io write operation.
  676. Arguments:
  677. Width - Width of write operation
  678. Address - Start IO address to write
  679. Count - Write count
  680. Buffer - Buffer to write to the address
  681. Returns:
  682. Status code
  683. --*/
  684. ;
  685. EFI_STATUS
  686. ESalMemRead (
  687. IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
  688. IN UINT64 Address,
  689. IN UINTN Count,
  690. IN OUT VOID *Buffer
  691. )
  692. /*++
  693. Routine Description:
  694. Perform a Memory mapped IO read into Buffer.
  695. Arguments:
  696. Width - Width of each read transaction.
  697. Address - Memory mapped IO address to read
  698. Count - Number of Width quanta to read
  699. Buffer - Buffer to read data into. size is Width * Count
  700. Returns:
  701. Status code
  702. --*/
  703. ;
  704. EFI_STATUS
  705. ESalMemWrite (
  706. IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
  707. IN UINT64 Address,
  708. IN UINTN Count,
  709. IN OUT VOID *Buffer
  710. )
  711. /*++
  712. Routine Description:
  713. Perform a memory mapped IO write into Buffer.
  714. Arguments:
  715. Width - Width of write transaction, and repeat operation to use
  716. Address - IO address to write
  717. Count - Number of times to write the IO address.
  718. Buffer - Buffer to write data from. size is Width * Count
  719. Returns:
  720. Status code
  721. --*/
  722. ;
  723. //
  724. // PCI Class Functions
  725. //
  726. SAL_RETURN_REGS
  727. SalPCIConfigRead (
  728. IN UINT64 Address,
  729. IN UINT64 Size
  730. )
  731. /*++
  732. Routine Description:
  733. Pci config space read.
  734. Arguments:
  735. Address - PCI address to read
  736. Size - Size to read
  737. Returns:
  738. Output regs
  739. --*/
  740. ;
  741. SAL_RETURN_REGS
  742. SalPCIConfigWrite (
  743. IN UINT64 Address,
  744. IN UINT64 Size,
  745. IN UINT64 Value
  746. )
  747. /*++
  748. Routine Description:
  749. Pci config space write.
  750. Arguments:
  751. Address - PCI address to write
  752. Size - Size to write
  753. Value - Value to write
  754. Returns:
  755. Output regs
  756. --*/
  757. ;
  758. //
  759. // MP Class Functions
  760. //
  761. SAL_RETURN_REGS
  762. LibMPAddCpuData (
  763. IN UINT64 CpuGlobalId,
  764. IN BOOLEAN Enabled,
  765. IN UINT64 PalCompatability
  766. )
  767. /*++
  768. Routine Description:
  769. Add CPU data.
  770. Arguments:
  771. CpuGlobalId - CPU ID
  772. Enabled - Enabled or not
  773. PalCompatability - Pal compatability
  774. Returns:
  775. Output regs
  776. --*/
  777. ;
  778. SAL_RETURN_REGS
  779. LibMPRemoveCpuData (
  780. IN UINT64 CpuGlobalId
  781. )
  782. /*++
  783. Routine Description:
  784. Remove CPU data.
  785. Arguments:
  786. CpuGlobalId - CPU ID
  787. Returns:
  788. Output regs
  789. --*/
  790. ;
  791. SAL_RETURN_REGS
  792. LibMPModifyCpuData (
  793. IN UINT64 CpuGlobalId,
  794. IN BOOLEAN Enabled,
  795. IN UINT64 PalCompatability
  796. )
  797. /*++
  798. Routine Description:
  799. Modify CPU data.
  800. Arguments:
  801. CpuGlobalId - CPU ID
  802. Enabled - Enabled or not
  803. PalCompatability - Pal compatability
  804. Returns:
  805. Output regs
  806. --*/
  807. ;
  808. SAL_RETURN_REGS
  809. LibMPGetCpuDataByID (
  810. IN UINT64 CpuGlobalId,
  811. IN BOOLEAN IndexByEnabledCpu
  812. )
  813. /*++
  814. Routine Description:
  815. Get CPU data.
  816. Arguments:
  817. CpuGlobalId - CPU ID
  818. IndexByEnabledCpu - Whether indexed by enabled CPU
  819. Returns:
  820. Output regs
  821. --*/
  822. ;
  823. SAL_RETURN_REGS
  824. LibMPGetCpuDataByIndex (
  825. IN UINT64 Index,
  826. IN BOOLEAN IndexByEnabledCpu
  827. )
  828. /*++
  829. Routine Description:
  830. Get CPU data.
  831. Arguments:
  832. Index - CPU index
  833. IndexByEnabledCpu - Whether indexed by enabled CPU
  834. Returns:
  835. Output regs
  836. --*/
  837. ;
  838. SAL_RETURN_REGS
  839. LibMPSendIpi (
  840. IN UINT64 ProcessorNumber,
  841. IN UINT64 VectorNumber,
  842. IN EFI_DELIVERY_MODE DeliveryMode,
  843. IN BOOLEAN IRFlag
  844. )
  845. /*++
  846. Routine Description:
  847. Send IPI.
  848. Arguments:
  849. ProcessorNumber - Processor number
  850. VectorNumber - Vector number
  851. DeliveryMode - Delivery mode
  852. IRFlag - Interrupt Redirection flag
  853. Returns:
  854. Output regs
  855. --*/
  856. ;
  857. SAL_RETURN_REGS
  858. LibMpCurrentProcessor (
  859. IN BOOLEAN IndexByEnabledCpu
  860. )
  861. /*++
  862. Routine Description:
  863. Get current processor index.
  864. Arguments:
  865. IndexByEnabledCpu - Whether indexed by enabled CPU
  866. Returns:
  867. Output regs
  868. --*/
  869. ;
  870. SAL_RETURN_REGS
  871. LibGetNumProcessors (
  872. VOID
  873. )
  874. /*++
  875. Routine Description:
  876. Get number of processors.
  877. Arguments:
  878. None
  879. Returns:
  880. Output regs
  881. --*/
  882. ;
  883. SAL_RETURN_REGS
  884. LibMpSaveMinStatePointer (
  885. IN UINT64 CpuGlobalId,
  886. IN EFI_PHYSICAL_ADDRESS MinStatePointer
  887. )
  888. /*++
  889. Routine Description:
  890. Register pointer to save min state.
  891. Arguments:
  892. CpuGlobalId - CPU global ID
  893. MinStatePointer - Pointer to save min state
  894. Returns:
  895. Output regs
  896. --*/
  897. ;
  898. SAL_RETURN_REGS
  899. LibMpRestoreMinStatePointer (
  900. IN UINT64 CpuGlobalId
  901. )
  902. /*++
  903. Routine Description:
  904. Restore pointer to save min state.
  905. Arguments:
  906. CpuGlobalId - CPU global ID
  907. Returns:
  908. Output regs
  909. --*/
  910. ;
  911. //
  912. // MCA Class Functions
  913. //
  914. EFI_STATUS
  915. LibMcaGetStateInfo (
  916. IN UINT64 CpuId,
  917. OUT EFI_PHYSICAL_ADDRESS *StateBufferPointer,
  918. OUT UINT64 *RequiredStateBufferSize
  919. )
  920. /*++
  921. Routine Description:
  922. MCA get state info.
  923. Arguments:
  924. CpuId - CPU ID
  925. StateBufferPointer - Pointer of state buffer
  926. RequiredStateBufferSize - Size of required state buffer
  927. Returns:
  928. Status code
  929. --*/
  930. ;
  931. EFI_STATUS
  932. LibMcaRegisterCpu (
  933. IN UINT64 CpuId,
  934. IN EFI_PHYSICAL_ADDRESS StateBufferAddress
  935. )
  936. /*++
  937. Routine Description:
  938. MCA register CPU state info.
  939. Arguments:
  940. CpuId - CPU ID
  941. StateBufferAddress - Pointer of state buffer
  942. Returns:
  943. Status code
  944. --*/
  945. ;
  946. //
  947. // SAL ELOG Functions
  948. //
  949. EFI_STATUS
  950. LibSalGetStateInfo (
  951. IN UINT64 McaType,
  952. IN UINT8 *McaBuffer,
  953. OUT UINTN *Size
  954. )
  955. /*++
  956. Routine Description:
  957. Get state info.
  958. Arguments:
  959. McaType - MCA type
  960. McaBuffer - Info buffer provided by caller
  961. Size - Size of info
  962. Returns:
  963. Status code
  964. --*/
  965. ;
  966. EFI_STATUS
  967. LibSalGetStateInfoSize (
  968. IN UINT64 McaType,
  969. OUT UINTN *Size
  970. )
  971. /*++
  972. Routine Description:
  973. Get state info size.
  974. Arguments:
  975. McaType - MCA type
  976. Size - Size required
  977. Returns:
  978. Status code
  979. --*/
  980. ;
  981. EFI_STATUS
  982. LibSalClearStateInfo (
  983. IN UINT64 McaType
  984. )
  985. /*++
  986. Routine Description:
  987. Clear state info.
  988. Arguments:
  989. McaType - MCA type
  990. Returns:
  991. Status code
  992. --*/
  993. ;
  994. EFI_STATUS
  995. LibEsalGetStateBuffer (
  996. IN UINT64 McaType,
  997. OUT UINT8 **McaBuffer,
  998. OUT UINTN *Index
  999. )
  1000. /*++
  1001. Routine Description:
  1002. Get state buffer.
  1003. Arguments:
  1004. McaType - MCA type
  1005. McaBuffer - MCA buffer
  1006. Index - CPU index
  1007. Returns:
  1008. Status code
  1009. --*/
  1010. ;
  1011. EFI_STATUS
  1012. LibEsalSaveStateBuffer (
  1013. IN UINT64 McaType
  1014. )
  1015. /*++
  1016. Routine Description:
  1017. Save state buffer.
  1018. Arguments:
  1019. McaType - MCA type
  1020. Returns:
  1021. Status code
  1022. --*/
  1023. ;
  1024. #endif