mirror of
				https://github.com/acidanthera/audk.git
				synced 2025-11-03 21:17:23 +01:00 
			
		
		
		
	ArmPkg/ArmMonitorLib: Add ArmMonitorLib
The ArmMonitorLib provides an abstract interface to issue an HyperVisor Call (HVC) or System Monitor Call (SMC) depending on the default conduit. The PcdMonitorConduitHvc PCD allows to select the default conduit. Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com> Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
This commit is contained in:
		
							parent
							
								
									9a50990cdb
								
							
						
					
					
						commit
						aa0f522471
					
				@ -135,6 +135,7 @@
 | 
				
			|||||||
  ArmPkg/Library/ArmSmcLibNull/ArmSmcLibNull.inf
 | 
					  ArmPkg/Library/ArmSmcLibNull/ArmSmcLibNull.inf
 | 
				
			||||||
  ArmPkg/Library/ArmHvcLib/ArmHvcLib.inf
 | 
					  ArmPkg/Library/ArmHvcLib/ArmHvcLib.inf
 | 
				
			||||||
  ArmPkg/Library/ArmSvcLib/ArmSvcLib.inf
 | 
					  ArmPkg/Library/ArmSvcLib/ArmSvcLib.inf
 | 
				
			||||||
 | 
					  ArmPkg/Library/ArmMonitorLib/ArmMonitorLib.inf
 | 
				
			||||||
  ArmPkg/Library/OpteeLib/OpteeLib.inf
 | 
					  ArmPkg/Library/OpteeLib/OpteeLib.inf
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ArmPkg/Filesystem/SemihostFs/SemihostFs.inf
 | 
					  ArmPkg/Filesystem/SemihostFs/SemihostFs.inf
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										34
									
								
								ArmPkg/Library/ArmMonitorLib/ArmMonitorLib.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								ArmPkg/Library/ArmMonitorLib/ArmMonitorLib.c
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,34 @@
 | 
				
			|||||||
 | 
					/** @file
 | 
				
			||||||
 | 
					  Arm Monitor Library.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Copyright (c) 2022, Arm Limited. All rights reserved.<BR>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <Library/ArmHvcLib.h>
 | 
				
			||||||
 | 
					#include <Library/ArmMonitorLib.h>
 | 
				
			||||||
 | 
					#include <Library/ArmSmcLib.h>
 | 
				
			||||||
 | 
					#include <Library/PcdLib.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** Monitor call.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  An HyperVisor Call (HVC) or System Monitor Call (SMC) will be issued
 | 
				
			||||||
 | 
					  depending on the default conduit. PcdMonitorConduitHvc determines the type
 | 
				
			||||||
 | 
					  of the call: if true, do an HVC.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @param [in,out]  Args    Arguments for the HVC/SMC.
 | 
				
			||||||
 | 
					**/
 | 
				
			||||||
 | 
					VOID
 | 
				
			||||||
 | 
					EFIAPI
 | 
				
			||||||
 | 
					ArmMonitorCall (
 | 
				
			||||||
 | 
					  IN OUT ARM_MONITOR_ARGS  *Args
 | 
				
			||||||
 | 
					  )
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  if (FeaturePcdGet (PcdMonitorConduitHvc)) {
 | 
				
			||||||
 | 
					    ArmCallHvc ((ARM_HVC_ARGS *)Args);
 | 
				
			||||||
 | 
					  } else {
 | 
				
			||||||
 | 
					    ArmCallSmc ((ARM_SMC_ARGS *)Args);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										29
									
								
								ArmPkg/Library/ArmMonitorLib/ArmMonitorLib.inf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								ArmPkg/Library/ArmMonitorLib/ArmMonitorLib.inf
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,29 @@
 | 
				
			|||||||
 | 
					## @file
 | 
				
			||||||
 | 
					#  Arm Monitor Library
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#  Copyright (c) 2022, Arm Limited. All rights reserved.<BR>
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
				
			||||||
 | 
					##
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[Defines]
 | 
				
			||||||
 | 
					  INF_VERSION                    = 1.29
 | 
				
			||||||
 | 
					  BASE_NAME                      = ArmMonitorLib
 | 
				
			||||||
 | 
					  FILE_GUID                      = F918DACB-FBB8-4CB6-A61D-08E75AF0E7CD
 | 
				
			||||||
 | 
					  MODULE_TYPE                    = BASE
 | 
				
			||||||
 | 
					  VERSION_STRING                 = 1.0
 | 
				
			||||||
 | 
					  LIBRARY_CLASS                  = ArmMonitorLib
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[Sources]
 | 
				
			||||||
 | 
					  ArmMonitorLib.c
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[Packages]
 | 
				
			||||||
 | 
					  ArmPkg/ArmPkg.dec
 | 
				
			||||||
 | 
					  MdePkg/MdePkg.dec
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[LibraryClasses]
 | 
				
			||||||
 | 
					  ArmHvcLib
 | 
				
			||||||
 | 
					  ArmSmcLib
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[Pcd]
 | 
				
			||||||
 | 
					  gArmTokenSpaceGuid.PcdMonitorConduitHvc
 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user