Lines Matching +full:address +full:- +full:width

1 // SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
4 * Module Name: exregion - ACPI default op_region (address space) handlers
6 * Copyright (C) 2000 - 2022, Intel Corp.
21 * PARAMETERS: function - Read or Write operation
22 * address - Where in the space to read or write
23 * bit_width - Field width in bits (8, 16, or 32)
24 * value - Pointer to in or out value
25 * handler_context - Pointer to Handler's context
26 * region_context - Pointer to context specific to the
31 * DESCRIPTION: Handler for the System Memory address space (Op Region)
36 acpi_physical_address address, in acpi_ex_system_memory_space_handler() argument
44 struct acpi_mem_mapping *mm = mem_info->cur_mm; in acpi_ex_system_memory_space_handler()
54 /* Validate and translate the bit width */ in acpi_ex_system_memory_space_handler()
79 ACPI_ERROR((AE_INFO, "Invalid SystemMemory width %u", in acpi_ex_system_memory_space_handler()
86 * Hardware does not support non-aligned data transfers, we must verify in acpi_ex_system_memory_space_handler()
89 (void)acpi_ut_short_divide((u64) address, length, NULL, &remainder); in acpi_ex_system_memory_space_handler()
97 * Is 1) Address below the current mapping? OR in acpi_ex_system_memory_space_handler()
98 * 2) Address beyond the current mapping? in acpi_ex_system_memory_space_handler()
100 if (!mm || (address < mm->physical_address) || in acpi_ex_system_memory_space_handler()
101 ((u64) address + length > (u64) mm->physical_address + mm->length)) { in acpi_ex_system_memory_space_handler()
105 * Look for an existing saved mapping covering the address range in acpi_ex_system_memory_space_handler()
109 for (mm = mem_info->first_mm; mm; mm = mm->next_mm) { in acpi_ex_system_memory_space_handler()
110 if (mm == mem_info->cur_mm) in acpi_ex_system_memory_space_handler()
113 if (address < mm->physical_address) in acpi_ex_system_memory_space_handler()
116 if ((u64) address + length > in acpi_ex_system_memory_space_handler()
117 (u64) mm->physical_address + mm->length) in acpi_ex_system_memory_space_handler()
120 mem_info->cur_mm = mm; in acpi_ex_system_memory_space_handler()
129 ACPI_FORMAT_UINT64(address), length)); in acpi_ex_system_memory_space_handler()
134 * October 2009: Attempt to map from the requested address to the in acpi_ex_system_memory_space_handler()
139 ((mem_info->address + mem_info->length) - address); in acpi_ex_system_memory_space_handler()
153 (ACPI_ROUND_UP(address, ACPI_DEFAULT_PAGE_SIZE) - address); in acpi_ex_system_memory_space_handler()
162 /* Create a new mapping starting at the address given */ in acpi_ex_system_memory_space_handler()
164 logical_addr_ptr = acpi_os_map_memory(address, map_length); in acpi_ex_system_memory_space_handler()
168 ACPI_FORMAT_UINT64(address), in acpi_ex_system_memory_space_handler()
174 /* Save the physical address and mapping size */ in acpi_ex_system_memory_space_handler()
176 mm->logical_address = logical_addr_ptr; in acpi_ex_system_memory_space_handler()
177 mm->physical_address = address; in acpi_ex_system_memory_space_handler()
178 mm->length = map_length; in acpi_ex_system_memory_space_handler()
184 mm->next_mm = mem_info->first_mm; in acpi_ex_system_memory_space_handler()
185 mem_info->first_mm = mm; in acpi_ex_system_memory_space_handler()
187 mem_info->cur_mm = mm; in acpi_ex_system_memory_space_handler()
192 * Generate a logical pointer corresponding to the address we want to in acpi_ex_system_memory_space_handler()
195 logical_addr_ptr = mm->logical_address + in acpi_ex_system_memory_space_handler()
196 ((u64) address - (u64) mm->physical_address); in acpi_ex_system_memory_space_handler()
199 "System-Memory (width %u) R/W %u Address=%8.8X%8.8X\n", in acpi_ex_system_memory_space_handler()
200 bit_width, function, ACPI_FORMAT_UINT64(address))); in acpi_ex_system_memory_space_handler()
205 * Note: For machines that do not support non-aligned transfers, the target in acpi_ex_system_memory_space_handler()
206 * address was checked for alignment above. We do not attempt to break the in acpi_ex_system_memory_space_handler()
207 * transfer up into smaller (byte-size) chunks because the AML specifically in acpi_ex_system_memory_space_handler()
208 * asked for a transfer width that the hardware may require. in acpi_ex_system_memory_space_handler()
287 * PARAMETERS: function - Read or Write operation
288 * address - Where in the space to read or write
289 * bit_width - Field width in bits (8, 16, or 32)
290 * value - Pointer to in or out value
291 * handler_context - Pointer to Handler's context
292 * region_context - Pointer to context specific to the
297 * DESCRIPTION: Handler for the System IO address space (Op Region)
303 acpi_physical_address address, in acpi_ex_system_io_space_handler() argument
314 "System-IO (width %u) R/W %u Address=%8.8X%8.8X\n", in acpi_ex_system_io_space_handler()
315 bit_width, function, ACPI_FORMAT_UINT64(address))); in acpi_ex_system_io_space_handler()
322 status = acpi_hw_read_port((acpi_io_address)address, in acpi_ex_system_io_space_handler()
329 status = acpi_hw_write_port((acpi_io_address)address, in acpi_ex_system_io_space_handler()
347 * PARAMETERS: function - Read or Write operation
348 * address - Where in the space to read or write
349 * bit_width - Field width in bits (8, 16, or 32)
350 * value - Pointer to in or out value
351 * handler_context - Pointer to Handler's context
352 * region_context - Pointer to context specific to the
357 * DESCRIPTION: Handler for the PCI Config address space (Op Region)
363 acpi_physical_address address, in acpi_ex_pci_config_space_handler() argument
377 * pci_segment is the PCI bus segment range 0-31 in acpi_ex_pci_config_space_handler()
378 * pci_bus is the PCI bus number range 0-255 in acpi_ex_pci_config_space_handler()
379 * pci_device is the PCI device number range 0-31 in acpi_ex_pci_config_space_handler()
381 * pci_register is the Config space register range 0-255 bytes in acpi_ex_pci_config_space_handler()
383 * value - input value for write, output address for read in acpi_ex_pci_config_space_handler()
387 pci_register = (u16) (u32) address; in acpi_ex_pci_config_space_handler()
390 "Pci-Config %u (%u) Seg(%04x) Bus(%04x) " in acpi_ex_pci_config_space_handler()
392 function, bit_width, pci_id->segment, pci_id->bus, in acpi_ex_pci_config_space_handler()
393 pci_id->device, pci_id->function, pci_register)); in acpi_ex_pci_config_space_handler()
425 * PARAMETERS: function - Read or Write operation
426 * address - Where in the space to read or write
427 * bit_width - Field width in bits (8, 16, or 32)
428 * value - Pointer to in or out value
429 * handler_context - Pointer to Handler's context
430 * region_context - Pointer to context specific to the
435 * DESCRIPTION: Handler for the CMOS address space (Op Region)
441 acpi_physical_address address, in acpi_ex_cmos_space_handler() argument
458 * PARAMETERS: function - Read or Write operation
459 * address - Where in the space to read or write
460 * bit_width - Field width in bits (8, 16, or 32)
461 * value - Pointer to in or out value
462 * handler_context - Pointer to Handler's context
463 * region_context - Pointer to context specific to the
468 * DESCRIPTION: Handler for the PCI bar_target address space (Op Region)
474 acpi_physical_address address, in acpi_ex_pci_bar_space_handler() argument
491 * PARAMETERS: function - Read or Write operation
492 * address - Where in the space to read or write
493 * bit_width - Field width in bits (8, 16, or 32)
494 * value - Pointer to in or out value
495 * handler_context - Pointer to Handler's context
496 * region_context - Pointer to context specific to the
501 * DESCRIPTION: Handler for the Data Table address space (Op Region)
507 acpi_physical_address address, in acpi_ex_data_table_space_handler() argument
518 pointer = ACPI_CAST_PTR(char, mapping->pointer) + in acpi_ex_data_table_space_handler()
519 (address - ACPI_PTR_TO_PHYSADDR(mapping->pointer)); in acpi_ex_data_table_space_handler()