aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/exregion.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/acpica/exregion.c')
-rw-r--r--drivers/acpi/acpica/exregion.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/drivers/acpi/acpica/exregion.c b/drivers/acpi/acpica/exregion.c
index 1db2c0bfde0b..182abaf045e1 100644
--- a/drivers/acpi/acpica/exregion.c
+++ b/drivers/acpi/acpica/exregion.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2012, Intel Corp. 8 * Copyright (C) 2000 - 2013, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -142,9 +142,9 @@ acpi_ex_system_memory_space_handler(u32 function,
142 } 142 }
143 143
144 /* 144 /*
145 * Attempt to map from the requested address to the end of the region. 145 * October 2009: Attempt to map from the requested address to the
146 * However, we will never map more than one page, nor will we cross 146 * end of the region. However, we will never map more than one
147 * a page boundary. 147 * page, nor will we cross a page boundary.
148 */ 148 */
149 map_length = (acpi_size) 149 map_length = (acpi_size)
150 ((mem_info->address + mem_info->length) - address); 150 ((mem_info->address + mem_info->length) - address);
@@ -154,12 +154,15 @@ acpi_ex_system_memory_space_handler(u32 function,
154 * a page boundary, just map up to the page boundary, do not cross. 154 * a page boundary, just map up to the page boundary, do not cross.
155 * On some systems, crossing a page boundary while mapping regions 155 * On some systems, crossing a page boundary while mapping regions
156 * can cause warnings if the pages have different attributes 156 * can cause warnings if the pages have different attributes
157 * due to resource management 157 * due to resource management.
158 *
159 * This has the added benefit of constraining a single mapping to
160 * one page, which is similar to the original code that used a 4k
161 * maximum window.
158 */ 162 */
159 page_boundary_map_length = 163 page_boundary_map_length =
160 ACPI_ROUND_UP(address, ACPI_DEFAULT_PAGE_SIZE) - address; 164 ACPI_ROUND_UP(address, ACPI_DEFAULT_PAGE_SIZE) - address;
161 165 if (page_boundary_map_length == 0) {
162 if (!page_boundary_map_length) {
163 page_boundary_map_length = ACPI_DEFAULT_PAGE_SIZE; 166 page_boundary_map_length = ACPI_DEFAULT_PAGE_SIZE;
164 } 167 }
165 168
@@ -236,19 +239,19 @@ acpi_ex_system_memory_space_handler(u32 function,
236 239
237 switch (bit_width) { 240 switch (bit_width) {
238 case 8: 241 case 8:
239 ACPI_SET8(logical_addr_ptr) = (u8) * value; 242 ACPI_SET8(logical_addr_ptr, *value);
240 break; 243 break;
241 244
242 case 16: 245 case 16:
243 ACPI_SET16(logical_addr_ptr) = (u16) * value; 246 ACPI_SET16(logical_addr_ptr, *value);
244 break; 247 break;
245 248
246 case 32: 249 case 32:
247 ACPI_SET32(logical_addr_ptr) = (u32) * value; 250 ACPI_SET32(logical_addr_ptr, *value);
248 break; 251 break;
249 252
250 case 64: 253 case 64:
251 ACPI_SET64(logical_addr_ptr) = (u64) * value; 254 ACPI_SET64(logical_addr_ptr, *value);
252 break; 255 break;
253 256
254 default: 257 default: