Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) // SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  * Module Name: utaddress - op_region address range check
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  * Copyright (C) 2000 - 2020, Intel Corp.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  *****************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) #include <acpi/acpi.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #include "accommon.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #include "acnamesp.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #define _COMPONENT          ACPI_UTILITIES
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) ACPI_MODULE_NAME("utaddress")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19)  * FUNCTION:    acpi_ut_add_address_range
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21)  * PARAMETERS:  space_id            - Address space ID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22)  *              address             - op_region start address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23)  *              length              - op_region length
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24)  *              region_node         - op_region namespace node
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26)  * RETURN:      Status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28)  * DESCRIPTION: Add the Operation Region address range to the global list.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29)  *              The only supported Space IDs are Memory and I/O. Called when
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30)  *              the op_region address/length operands are fully evaluated.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32)  * MUTEX:       Locks the namespace
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34)  * NOTE: Because this interface is only called when an op_region argument
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35)  * list is evaluated, there cannot be any duplicate region_nodes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36)  * Duplicate Address/Length values are allowed, however, so that multiple
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37)  * address conflicts can be detected.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) acpi_ut_add_address_range(acpi_adr_space_type space_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 			  acpi_physical_address address,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 			  u32 length, struct acpi_namespace_node *region_node)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 	struct acpi_address_range *range_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 	ACPI_FUNCTION_TRACE(ut_add_address_range);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 	if ((space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY) &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 	    (space_id != ACPI_ADR_SPACE_SYSTEM_IO)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 		return_ACPI_STATUS(AE_OK);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 	/* Allocate/init a new info block, add it to the appropriate list */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 	range_info = ACPI_ALLOCATE(sizeof(struct acpi_address_range));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 	if (!range_info) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 		return_ACPI_STATUS(AE_NO_MEMORY);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	range_info->start_address = address;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 	range_info->end_address = (address + length - 1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 	range_info->region_node = region_node;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 	range_info->next = acpi_gbl_address_range_list[space_id];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 	acpi_gbl_address_range_list[space_id] = range_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 	ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 			  "\nAdded [%4.4s] address range: 0x%8.8X%8.8X-0x%8.8X%8.8X\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 			  acpi_ut_get_node_name(range_info->region_node),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 			  ACPI_FORMAT_UINT64(address),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 			  ACPI_FORMAT_UINT64(range_info->end_address)));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 	return_ACPI_STATUS(AE_OK);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79)  * FUNCTION:    acpi_ut_remove_address_range
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81)  * PARAMETERS:  space_id            - Address space ID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82)  *              region_node         - op_region namespace node
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84)  * RETURN:      None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86)  * DESCRIPTION: Remove the Operation Region from the global list. The only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87)  *              supported Space IDs are Memory and I/O. Called when an
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88)  *              op_region is deleted.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90)  * MUTEX:       Assumes the namespace is locked
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) acpi_ut_remove_address_range(acpi_adr_space_type space_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 			     struct acpi_namespace_node *region_node)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 	struct acpi_address_range *range_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 	struct acpi_address_range *prev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 	ACPI_FUNCTION_TRACE(ut_remove_address_range);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 	if ((space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY) &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 	    (space_id != ACPI_ADR_SPACE_SYSTEM_IO)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 		return_VOID;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 	/* Get the appropriate list head and check the list */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 	range_info = prev = acpi_gbl_address_range_list[space_id];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 	while (range_info) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 		if (range_info->region_node == region_node) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 			if (range_info == prev) {	/* Found at list head */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 				acpi_gbl_address_range_list[space_id] =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 				    range_info->next;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 			} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 				prev->next = range_info->next;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 			ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 					  "\nRemoved [%4.4s] address range: 0x%8.8X%8.8X-0x%8.8X%8.8X\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 					  acpi_ut_get_node_name(range_info->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 								region_node),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 					  ACPI_FORMAT_UINT64(range_info->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 							     start_address),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 					  ACPI_FORMAT_UINT64(range_info->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 							     end_address)));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 			ACPI_FREE(range_info);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 			return_VOID;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 		prev = range_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 		range_info = range_info->next;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 	return_VOID;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142)  * FUNCTION:    acpi_ut_check_address_range
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144)  * PARAMETERS:  space_id            - Address space ID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145)  *              address             - Start address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146)  *              length              - Length of address range
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147)  *              warn                - TRUE if warning on overlap desired
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149)  * RETURN:      Count of the number of conflicts detected. Zero is always
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150)  *              returned for Space IDs other than Memory or I/O.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152)  * DESCRIPTION: Check if the input address range overlaps any of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153)  *              ASL operation region address ranges. The only supported
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154)  *              Space IDs are Memory and I/O.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156)  * MUTEX:       Assumes the namespace is locked.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) acpi_ut_check_address_range(acpi_adr_space_type space_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 			    acpi_physical_address address, u32 length, u8 warn)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 	struct acpi_address_range *range_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 	acpi_physical_address end_address;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 	char *pathname;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 	u32 overlap_count = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	ACPI_FUNCTION_TRACE(ut_check_address_range);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 	if ((space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY) &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 	    (space_id != ACPI_ADR_SPACE_SYSTEM_IO)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 		return_UINT32(0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 	range_info = acpi_gbl_address_range_list[space_id];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 	end_address = address + length - 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 	/* Check entire list for all possible conflicts */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 	while (range_info) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 		/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 		 * Check if the requested address/length overlaps this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 		 * address range. There are four cases to consider:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 		 *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 		 * 1) Input address/length is contained completely in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 		 *    address range
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 		 * 2) Input address/length overlaps range at the range start
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 		 * 3) Input address/length overlaps range at the range end
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 		 * 4) Input address/length completely encompasses the range
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 		 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 		if ((address <= range_info->end_address) &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 		    (end_address >= range_info->start_address)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 			/* Found an address range overlap */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 			overlap_count++;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 			if (warn) {	/* Optional warning message */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 				pathname =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 				    acpi_ns_get_normalized_pathname(range_info->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 								    region_node,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 								    TRUE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 				ACPI_WARNING((AE_INFO,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 					      "%s range 0x%8.8X%8.8X-0x%8.8X%8.8X conflicts with OpRegion 0x%8.8X%8.8X-0x%8.8X%8.8X (%s)",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 					      acpi_ut_get_region_name(space_id),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 					      ACPI_FORMAT_UINT64(address),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 					      ACPI_FORMAT_UINT64(end_address),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 					      ACPI_FORMAT_UINT64(range_info->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 								 start_address),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 					      ACPI_FORMAT_UINT64(range_info->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 								 end_address),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 					      pathname));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 				ACPI_FREE(pathname);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 		range_info = range_info->next;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 	return_UINT32(overlap_count);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226)  * FUNCTION:    acpi_ut_delete_address_lists
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228)  * PARAMETERS:  None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230)  * RETURN:      None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232)  * DESCRIPTION: Delete all global address range lists (called during
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233)  *              subsystem shutdown).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) void acpi_ut_delete_address_lists(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 	struct acpi_address_range *next;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) 	struct acpi_address_range *range_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) 	int i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) 	/* Delete all elements in all address range lists */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) 	for (i = 0; i < ACPI_ADDRESS_RANGE_MAX; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) 		next = acpi_gbl_address_range_list[i];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) 		while (next) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) 			range_info = next;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) 			next = range_info->next;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) 			ACPI_FREE(range_info);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) 		acpi_gbl_address_range_list[i] = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) }