Lines Matching +full:os +full:- +full:initiated

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * acpi_osl.c - OS-dependent functions ($Revision: 83 $)
36 #include <linux/io-64-nonatomic-lo-hi.h>
99 memcpy(&addr, &gas->address, sizeof(addr)); in acpi_request_region()
104 if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_IO) in acpi_request_region()
106 else if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) in acpi_request_region()
130 /* Length of GPE blocks must be a non-negative multiple of 2 */ in acpi_reserve_resources()
195 * at modified ACPI tables that could alter kernel behaviour - in acpi_os_get_root_pointer()
230 if (map->phys <= phys && in acpi_map_lookup()
231 phys + size <= map->phys + map->size) in acpi_map_lookup()
245 return map->virt + (phys - map->phys); in acpi_map_vaddr_lookup()
258 virt = map->virt + (phys - map->phys); in acpi_os_get_iomem()
259 map->track.refcount++; in acpi_os_get_iomem()
273 if (map->virt <= virt && in acpi_map_lookup_virt()
274 virt + size <= map->virt + map->size) in acpi_map_lookup_virt()
312 * acpi_os_map_iomem - Get a virtual address for a given physical address range.
344 map->track.refcount++; in acpi_os_map_iomem()
355 pg_sz = round_up(phys + size, PAGE_SIZE) - pg_off; in acpi_os_map_iomem()
363 INIT_LIST_HEAD(&map->list); in acpi_os_map_iomem()
364 map->virt = (void __iomem __force *)((unsigned long)virt & PAGE_MASK); in acpi_os_map_iomem()
365 map->phys = pg_off; in acpi_os_map_iomem()
366 map->size = pg_sz; in acpi_os_map_iomem()
367 map->track.refcount = 1; in acpi_os_map_iomem()
369 list_add_tail_rcu(&map->list, &acpi_ioremaps); in acpi_os_map_iomem()
373 return map->virt + (phys - map->phys); in acpi_os_map_iomem()
389 acpi_unmap(map->phys, map->virt); in acpi_os_map_remove()
396 if (--map->track.refcount) in acpi_os_drop_map_ref()
399 list_del_rcu(&map->list); in acpi_os_drop_map_ref()
401 INIT_RCU_WORK(&map->track.rwork, acpi_os_map_remove); in acpi_os_drop_map_ref()
402 queue_rcu_work(system_wq, &map->track.rwork); in acpi_os_drop_map_ref()
406 * acpi_os_unmap_iomem - Drop a memory mapping reference.
443 * acpi_os_unmap_memory - Drop a memory mapping reference.
457 if (gas->space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY) in acpi_os_map_generic_address()
461 memcpy(&addr, &gas->address, sizeof(addr)); in acpi_os_map_generic_address()
462 if (!addr || !gas->bit_width) in acpi_os_map_generic_address()
465 return acpi_os_map_iomem(addr, gas->bit_width / 8); in acpi_os_map_generic_address()
474 if (gas->space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY) in acpi_os_unmap_generic_address()
478 memcpy(&addr, &gas->address, sizeof(addr)); in acpi_os_unmap_generic_address()
479 if (!addr || !gas->bit_width) in acpi_os_unmap_generic_address()
484 map = acpi_map_lookup(addr, gas->bit_width / 8); in acpi_os_unmap_generic_address()
533 if (!memcmp(init_val->name, "_OS_", 4) && strlen(acpi_os_name)) { in acpi_os_predefined_override()
538 if (!memcmp(init_val->name, "_REV", 4) && acpi_rev_override) { in acpi_os_predefined_override()
626 us -= delay; in acpi_os_stall()
631 * Support ACPI 3.0 AML Timer operand. Returns a 64-bit free-running,
641 return (get_jiffies_64() - INITIAL_JIFFIES) * in acpi_os_get_timer()
702 return -EINVAL; in acpi_os_read_iomem()
808 result = raw_pci_read(pci_id->segment, pci_id->bus, in acpi_os_read_pci_configuration()
809 PCI_DEVFN(pci_id->device, pci_id->function), in acpi_os_read_pci_configuration()
836 result = raw_pci_write(pci_id->segment, pci_id->bus, in acpi_os_write_pci_configuration()
837 PCI_DEVFN(pci_id->device, pci_id->function), in acpi_os_write_pci_configuration()
848 dpc->function(dpc->context); in acpi_os_execute_deferred()
863 ret = -EBUSY; in acpi_register_debugger()
894 return -ENODEV; in acpi_debugger_create_thread()
897 ret = -ENODEV; in acpi_debugger_create_thread()
901 ret = -ENODEV; in acpi_debugger_create_thread()
904 func = acpi_debugger.ops->create_thread; in acpi_debugger_create_thread()
924 return -ENODEV; in acpi_debugger_write_log()
927 ret = -ENODEV; in acpi_debugger_write_log()
931 ret = -ENODEV; in acpi_debugger_write_log()
934 func = acpi_debugger.ops->write_log; in acpi_debugger_write_log()
954 return -ENODEV; in acpi_debugger_read_cmd()
957 ret = -ENODEV; in acpi_debugger_read_cmd()
961 ret = -ENODEV; in acpi_debugger_read_cmd()
964 func = acpi_debugger.ops->read_cmd; in acpi_debugger_read_cmd()
984 return -ENODEV; in acpi_debugger_wait_command_ready()
987 ret = -ENODEV; in acpi_debugger_wait_command_ready()
991 ret = -ENODEV; in acpi_debugger_wait_command_ready()
994 func = acpi_debugger.ops->wait_command_ready; in acpi_debugger_wait_command_ready()
1015 return -ENODEV; in acpi_debugger_notify_command_complete()
1018 ret = -ENODEV; in acpi_debugger_notify_command_complete()
1022 ret = -ENODEV; in acpi_debugger_notify_command_complete()
1025 func = acpi_debugger.ops->notify_command_complete; in acpi_debugger_notify_command_complete()
1050 * PARAMETERS: Type - Type of the callback
1051 * Function - Function to be executed
1052 * Context - Function parameters
1094 dpc->function = function; in acpi_os_execute()
1095 dpc->context = context; in acpi_os_execute()
1104 INIT_WORK(&dpc->work, acpi_os_execute_deferred); in acpi_os_execute()
1107 INIT_WORK(&dpc->work, acpi_os_execute_deferred); in acpi_os_execute()
1117 * On some machines, a software-initiated SMI causes corruption unless in acpi_os_execute()
1118 * the SMI runs on CPU 0. An SMI can be initiated by any AML, but in acpi_os_execute()
1119 * typically it's done in GPE-related methods that are run via in acpi_os_execute()
1123 ret = queue_work_on(0, queue, &dpc->work); in acpi_os_execute()
1160 acpi_device_hotplug(hpw->adev, hpw->src); in acpi_hotplug_work_fn()
1168 acpi_handle_debug(adev->handle, in acpi_hotplug_schedule()
1176 INIT_WORK(&hpw->work, acpi_hotplug_work_fn); in acpi_hotplug_schedule()
1177 hpw->adev = adev; in acpi_hotplug_schedule()
1178 hpw->src = src; in acpi_hotplug_schedule()
1185 if (!queue_work(kacpi_hotplug_wq, &hpw->work)) { in acpi_hotplug_schedule()
1218 * 'delete_semaphore()' function -- may result in an invalid
1219 * pointer dereference for non-synchronized consumers. Should
1232 BUG_ON(!list_empty(&sem->wait_list)); in acpi_os_delete_semaphore()
1317 chars = strlen(buffer) - 1; in acpi_os_get_line()
1380 int count = ACPI_MAX_OVERRIDE_LEN - 1; in acpi_os_name_setup()
1385 for (; count-- && *str; str++) { in acpi_os_name_setup()
1402 * Disable the auto-serialization of named objects creation methods.
1410 pr_info("Auto-serialization disabled\n"); in acpi_no_auto_serialize_setup()
1423 * - strict (default) (2)
1424 * -> further driver trying to access the resources will not load
1425 * - lax (1)
1426 * -> further driver trying to access the resources will load, but you
1429 * - no (0)
1430 * -> ACPI Operation Region resources will not be registered
1465 if (res->flags & IORESOURCE_IO) in acpi_check_resource_conflict()
1467 else if (res->flags & IORESOURCE_MEM) in acpi_check_resource_conflict()
1472 if (!acpi_check_address_range(space_id, res->start, resource_size(res), 1)) in acpi_check_resource_conflict()
1478 return -EBUSY; in acpi_check_resource_conflict()
1510 handler_obj = region_obj->region.handler; in acpi_deactivate_mem_region()
1514 if (region_obj->region.space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY) in acpi_deactivate_mem_region()
1517 if (!(region_obj->region.flags & AOPOBJ_SETUP_COMPLETE)) in acpi_deactivate_mem_region()
1524 mem_ctx = (void *)&region_obj2->extra.region_context; in acpi_deactivate_mem_region()
1526 if (!(mem_ctx[0]->address >= res->start && in acpi_deactivate_mem_region()
1527 mem_ctx[0]->address < res->end)) in acpi_deactivate_mem_region()
1530 status = handler_obj->address_space.setup(region_obj, in acpi_deactivate_mem_region()
1534 region_obj->region.flags &= ~(AOPOBJ_SETUP_COMPLETE); in acpi_deactivate_mem_region()
1540 * acpi_release_memory - Release any mappings done to a memory region
1550 * safely map the region as non-cached memory.
1560 if (!(res->flags & IORESOURCE_MEM)) in acpi_release_memory()
1628 * PARAMETERS: name - Ascii name for the cache
1629 * size - Size of each cached object
1630 * depth - Maximum depth of the cache (in objects) <ignored>
1631 * cache - Where the new cache object is returned
1653 * PARAMETERS: Cache - Handle to cache object
1671 * PARAMETERS: Cache - Handle to cache object
1690 * PARAMETERS: Cache - Handle to cache object
1691 * Object - The object to be released
1739 * Use acpi_os_map_generic_address to pre-map the reset in acpi_os_initialize()