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