@@ -224,6 +224,30 @@ static struct prm_handler_info *find_prm_handler(const guid_t *guid)
224224#define UPDATE_LOCK_ALREADY_HELD 4
225225#define UPDATE_UNLOCK_WITHOUT_LOCK 5
226226
227+ int acpi_call_prm_handler (guid_t handler_guid , void * param_buffer )
228+ {
229+ struct prm_handler_info * handler = find_prm_handler (& handler_guid );
230+ struct prm_module_info * module = find_prm_module (& handler_guid );
231+ struct prm_context_buffer context ;
232+ efi_status_t status ;
233+
234+ if (!module || !handler )
235+ return - ENODEV ;
236+
237+ memset (& context , 0 , sizeof (context ));
238+ ACPI_COPY_NAMESEG (context .signature , "PRMC" );
239+ context .identifier = handler -> guid ;
240+ context .static_data_buffer = handler -> static_data_buffer_addr ;
241+ context .mmio_ranges = module -> mmio_info ;
242+
243+ status = efi_call_acpi_prm_handler (handler -> handler_addr ,
244+ (u64 )param_buffer ,
245+ & context );
246+
247+ return efi_status_to_err (status );
248+ }
249+ EXPORT_SYMBOL_GPL (acpi_call_prm_handler );
250+
227251/*
228252 * This is the PlatformRtMechanism opregion space handler.
229253 * @function: indicates the read/write. In fact as the PlatformRtMechanism
@@ -277,9 +301,9 @@ static acpi_status acpi_platformrt_space_handler(u32 function,
277301 context .static_data_buffer = handler -> static_data_buffer_addr ;
278302 context .mmio_ranges = module -> mmio_info ;
279303
280- status = efi_call_virt_pointer (handler , handler_addr ,
281- handler -> acpi_param_buffer_addr ,
282- & context );
304+ status = efi_call_acpi_prm_handler (handler -> handler_addr ,
305+ handler -> acpi_param_buffer_addr ,
306+ & context );
283307 if (status == EFI_SUCCESS ) {
284308 buffer -> prm_status = PRM_HANDLER_SUCCESS ;
285309 } else {
0 commit comments