prmt.c (4f2c0a4acffbec01079c28f839422e64ddeff004) prmt.c (182da6f2b81a78709c58021542fb694f8ed80774)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Author: Erik Kaneda <erik.kaneda@intel.com>
4 * Copyright 2020 Intel Corporation
5 *
6 * prmt.c
7 *
8 * Each PRM service is an executable that is run in a restricted environment

--- 222 unchanged lines hidden (view full) ---

231 void *region_context)
232{
233 struct prm_buffer *buffer = ACPI_CAST_PTR(struct prm_buffer, value);
234 struct prm_handler_info *handler;
235 struct prm_module_info *module;
236 efi_status_t status;
237 struct prm_context_buffer context;
238
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Author: Erik Kaneda <erik.kaneda@intel.com>
4 * Copyright 2020 Intel Corporation
5 *
6 * prmt.c
7 *
8 * Each PRM service is an executable that is run in a restricted environment

--- 222 unchanged lines hidden (view full) ---

231 void *region_context)
232{
233 struct prm_buffer *buffer = ACPI_CAST_PTR(struct prm_buffer, value);
234 struct prm_handler_info *handler;
235 struct prm_module_info *module;
236 efi_status_t status;
237 struct prm_context_buffer context;
238
239 if (!efi_enabled(EFI_RUNTIME_SERVICES)) {
240 pr_err_ratelimited("PRM: EFI runtime services no longer available\n");
241 return AE_NO_HANDLER;
242 }
243
239 /*
240 * The returned acpi_status will always be AE_OK. Error values will be
241 * saved in the first byte of the PRM message buffer to be used by ASL.
242 */
243 switch (buffer->prm_cmd) {
244 case PRM_CMD_RUN_SERVICE:
245
246 handler = find_prm_handler(&buffer->handler_guid);

--- 73 unchanged lines hidden (view full) ---

320 /*
321 * Return immediately if PRMT table is not present or no PRM module found.
322 */
323 if (mc <= 0)
324 return;
325
326 pr_info("PRM: found %u modules\n", mc);
327
244 /*
245 * The returned acpi_status will always be AE_OK. Error values will be
246 * saved in the first byte of the PRM message buffer to be used by ASL.
247 */
248 switch (buffer->prm_cmd) {
249 case PRM_CMD_RUN_SERVICE:
250
251 handler = find_prm_handler(&buffer->handler_guid);

--- 73 unchanged lines hidden (view full) ---

325 /*
326 * Return immediately if PRMT table is not present or no PRM module found.
327 */
328 if (mc <= 0)
329 return;
330
331 pr_info("PRM: found %u modules\n", mc);
332
333 if (!efi_enabled(EFI_RUNTIME_SERVICES)) {
334 pr_err("PRM: EFI runtime services unavailable\n");
335 return;
336 }
337
328 status = acpi_install_address_space_handler(ACPI_ROOT_OBJECT,
329 ACPI_ADR_SPACE_PLATFORM_RT,
330 &acpi_platformrt_space_handler,
331 NULL, NULL);
332 if (ACPI_FAILURE(status))
333 pr_alert("PRM: OperationRegion handler could not be installed\n");
334}
338 status = acpi_install_address_space_handler(ACPI_ROOT_OBJECT,
339 ACPI_ADR_SPACE_PLATFORM_RT,
340 &acpi_platformrt_space_handler,
341 NULL, NULL);
342 if (ACPI_FAILURE(status))
343 pr_alert("PRM: OperationRegion handler could not be installed\n");
344}