aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/executer/exregion.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/executer/exregion.c')
-rw-r--r--drivers/acpi/executer/exregion.c32
1 files changed, 14 insertions, 18 deletions
diff --git a/drivers/acpi/executer/exregion.c b/drivers/acpi/executer/exregion.c
index 9a2f5bea3afe..82983575cca6 100644
--- a/drivers/acpi/executer/exregion.c
+++ b/drivers/acpi/executer/exregion.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2005, R. Byron Moore 9 * Copyright (C) 2000 - 2006, R. Byron Moore
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
@@ -77,7 +77,7 @@ acpi_ex_system_memory_space_handler(u32 function,
77 struct acpi_mem_space_context *mem_info = region_context; 77 struct acpi_mem_space_context *mem_info = region_context;
78 u32 length; 78 u32 length;
79 acpi_size window_size; 79 acpi_size window_size;
80#ifndef ACPI_MISALIGNED_TRANSFERS 80#ifdef ACPI_MISALIGNMENT_NOT_SUPPORTED
81 u32 remainder; 81 u32 remainder;
82#endif 82#endif
83 83
@@ -103,13 +103,12 @@ acpi_ex_system_memory_space_handler(u32 function,
103 break; 103 break;
104 104
105 default: 105 default:
106 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 106 ACPI_REPORT_ERROR(("Invalid system_memory width %d\n",
107 "Invalid system_memory width %d\n", 107 bit_width));
108 bit_width));
109 return_ACPI_STATUS(AE_AML_OPERAND_VALUE); 108 return_ACPI_STATUS(AE_AML_OPERAND_VALUE);
110 } 109 }
111 110
112#ifndef ACPI_MISALIGNED_TRANSFERS 111#ifdef ACPI_MISALIGNMENT_NOT_SUPPORTED
113 /* 112 /*
114 * Hardware does not support non-aligned data transfers, we must verify 113 * Hardware does not support non-aligned data transfers, we must verify
115 * the request. 114 * the request.
@@ -159,10 +158,7 @@ acpi_ex_system_memory_space_handler(u32 function,
159 (void **)&mem_info-> 158 (void **)&mem_info->
160 mapped_logical_address); 159 mapped_logical_address);
161 if (ACPI_FAILURE(status)) { 160 if (ACPI_FAILURE(status)) {
162 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 161 ACPI_REPORT_ERROR(("Could not map memory at %8.8X%8.8X, size %X\n", ACPI_FORMAT_UINT64(address), (u32) window_size));
163 "Could not map memory at %8.8X%8.8X, size %X\n",
164 ACPI_FORMAT_UINT64(address),
165 (u32) window_size));
166 mem_info->mapped_length = 0; 162 mem_info->mapped_length = 0;
167 return_ACPI_STATUS(status); 163 return_ACPI_STATUS(status);
168 } 164 }
@@ -199,20 +195,20 @@ acpi_ex_system_memory_space_handler(u32 function,
199 *value = 0; 195 *value = 0;
200 switch (bit_width) { 196 switch (bit_width) {
201 case 8: 197 case 8:
202 *value = (acpi_integer) * ((u8 *) logical_addr_ptr); 198 *value = (acpi_integer) ACPI_GET8(logical_addr_ptr);
203 break; 199 break;
204 200
205 case 16: 201 case 16:
206 *value = (acpi_integer) * ((u16 *) logical_addr_ptr); 202 *value = (acpi_integer) ACPI_GET16(logical_addr_ptr);
207 break; 203 break;
208 204
209 case 32: 205 case 32:
210 *value = (acpi_integer) * ((u32 *) logical_addr_ptr); 206 *value = (acpi_integer) ACPI_GET32(logical_addr_ptr);
211 break; 207 break;
212 208
213#if ACPI_MACHINE_WIDTH != 16 209#if ACPI_MACHINE_WIDTH != 16
214 case 64: 210 case 64:
215 *value = (acpi_integer) * ((u64 *) logical_addr_ptr); 211 *value = (acpi_integer) ACPI_GET64(logical_addr_ptr);
216 break; 212 break;
217#endif 213#endif
218 default: 214 default:
@@ -225,20 +221,20 @@ acpi_ex_system_memory_space_handler(u32 function,
225 221
226 switch (bit_width) { 222 switch (bit_width) {
227 case 8: 223 case 8:
228 *(u8 *) logical_addr_ptr = (u8) * value; 224 ACPI_SET8(logical_addr_ptr) = (u8) * value;
229 break; 225 break;
230 226
231 case 16: 227 case 16:
232 *(u16 *) logical_addr_ptr = (u16) * value; 228 ACPI_SET16(logical_addr_ptr) = (u16) * value;
233 break; 229 break;
234 230
235 case 32: 231 case 32:
236 *(u32 *) logical_addr_ptr = (u32) * value; 232 ACPI_SET32(logical_addr_ptr) = (u32) * value;
237 break; 233 break;
238 234
239#if ACPI_MACHINE_WIDTH != 16 235#if ACPI_MACHINE_WIDTH != 16
240 case 64: 236 case 64:
241 *(u64 *) logical_addr_ptr = (u64) * value; 237 ACPI_SET64(logical_addr_ptr) = (u64) * value;
242 break; 238 break;
243#endif 239#endif
244 240