blob: cbc67884454f33c7320564ba326bc0e4226b2ae6 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001
2/******************************************************************************
3 *
4 * Module Name: exregion - ACPI default op_region (address space) handlers
5 *
6 *****************************************************************************/
7
8/*
Bob Moore6c9deb72007-02-02 19:48:24 +03009 * Copyright (C) 2000 - 2007, R. Byron Moore
Linus Torvalds1da177e2005-04-16 15:20:36 -070010 * All rights reserved.
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
14 * are met:
15 * 1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions, and the following disclaimer,
17 * without modification.
18 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
19 * substantially similar to the "NO WARRANTY" disclaimer below
20 * ("Disclaimer") and any redistribution must be conditioned upon
21 * including a substantially similar Disclaimer requirement for further
22 * binary redistribution.
23 * 3. Neither the names of the above-listed copyright holders nor the names
24 * of any contributors may be used to endorse or promote products derived
25 * from this software without specific prior written permission.
26 *
27 * Alternatively, this software may be distributed under the terms of the
28 * GNU General Public License ("GPL") version 2 as published by the Free
29 * Software Foundation.
30 *
31 * NO WARRANTY
32 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
33 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
34 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
35 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
36 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
37 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
38 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
39 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
40 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
41 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
42 * POSSIBILITY OF SUCH DAMAGES.
43 */
44
Linus Torvalds1da177e2005-04-16 15:20:36 -070045#include <acpi/acpi.h>
46#include <acpi/acinterp.h>
47
Linus Torvalds1da177e2005-04-16 15:20:36 -070048#define _COMPONENT ACPI_EXECUTER
Len Brown4be44fc2005-08-05 00:44:28 -040049ACPI_MODULE_NAME("exregion")
Linus Torvalds1da177e2005-04-16 15:20:36 -070050
51/*******************************************************************************
52 *
53 * FUNCTION: acpi_ex_system_memory_space_handler
54 *
55 * PARAMETERS: Function - Read or Write operation
56 * Address - Where in the space to read or write
57 * bit_width - Field width in bits (8, 16, or 32)
58 * Value - Pointer to in or out value
59 * handler_context - Pointer to Handler's context
60 * region_context - Pointer to context specific to the
61 * accessed region
62 *
63 * RETURN: Status
64 *
65 * DESCRIPTION: Handler for the System Memory address space (Op Region)
66 *
67 ******************************************************************************/
Linus Torvalds1da177e2005-04-16 15:20:36 -070068acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -040069acpi_ex_system_memory_space_handler(u32 function,
70 acpi_physical_address address,
71 u32 bit_width,
72 acpi_integer * value,
73 void *handler_context, void *region_context)
Linus Torvalds1da177e2005-04-16 15:20:36 -070074{
Len Brown4be44fc2005-08-05 00:44:28 -040075 acpi_status status = AE_OK;
76 void *logical_addr_ptr = NULL;
77 struct acpi_mem_space_context *mem_info = region_context;
78 u32 length;
79 acpi_size window_size;
Bob Moore08978312005-10-21 00:00:00 -040080#ifdef ACPI_MISALIGNMENT_NOT_SUPPORTED
Len Brown4be44fc2005-08-05 00:44:28 -040081 u32 remainder;
Linus Torvalds1da177e2005-04-16 15:20:36 -070082#endif
83
Bob Mooreb229cf92006-04-21 17:15:00 -040084 ACPI_FUNCTION_TRACE(ex_system_memory_space_handler);
Linus Torvalds1da177e2005-04-16 15:20:36 -070085
86 /* Validate and translate the bit width */
87
88 switch (bit_width) {
89 case 8:
90 length = 1;
91 break;
92
93 case 16:
94 length = 2;
95 break;
96
97 case 32:
98 length = 4;
99 break;
100
101 case 64:
102 length = 8;
103 break;
104
105 default:
Bob Mooreb229cf92006-04-21 17:15:00 -0400106 ACPI_ERROR((AE_INFO, "Invalid SystemMemory width %d",
Bob Mooreb8e4d892006-01-27 16:43:00 -0500107 bit_width));
Len Brown4be44fc2005-08-05 00:44:28 -0400108 return_ACPI_STATUS(AE_AML_OPERAND_VALUE);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700109 }
110
Bob Moore08978312005-10-21 00:00:00 -0400111#ifdef ACPI_MISALIGNMENT_NOT_SUPPORTED
Linus Torvalds1da177e2005-04-16 15:20:36 -0700112 /*
113 * Hardware does not support non-aligned data transfers, we must verify
114 * the request.
115 */
Len Brown4be44fc2005-08-05 00:44:28 -0400116 (void)acpi_ut_short_divide((acpi_integer) address, length, NULL,
117 &remainder);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700118 if (remainder != 0) {
Len Brown4be44fc2005-08-05 00:44:28 -0400119 return_ACPI_STATUS(AE_AML_ALIGNMENT);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700120 }
121#endif
122
123 /*
124 * Does the request fit into the cached memory mapping?
125 * Is 1) Address below the current mapping? OR
126 * 2) Address beyond the current mapping?
127 */
128 if ((address < mem_info->mapped_physical_address) ||
Len Brown4be44fc2005-08-05 00:44:28 -0400129 (((acpi_integer) address + length) > ((acpi_integer)
130 mem_info->
131 mapped_physical_address +
132 mem_info->mapped_length))) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700133 /*
134 * The request cannot be resolved by the current memory mapping;
135 * Delete the existing mapping and create a new one.
136 */
137 if (mem_info->mapped_length) {
Bob Moore52fc0b02006-10-02 00:00:00 -0400138
Linus Torvalds1da177e2005-04-16 15:20:36 -0700139 /* Valid mapping, delete it */
140
Len Brown4be44fc2005-08-05 00:44:28 -0400141 acpi_os_unmap_memory(mem_info->mapped_logical_address,
142 mem_info->mapped_length);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700143 }
144
145 /*
146 * Don't attempt to map memory beyond the end of the region, and
147 * constrain the maximum mapping size to something reasonable.
148 */
Robert Moore44f6c012005-04-18 22:49:35 -0400149 window_size = (acpi_size)
Len Brown4be44fc2005-08-05 00:44:28 -0400150 ((mem_info->address + mem_info->length) - address);
Robert Moore44f6c012005-04-18 22:49:35 -0400151
Linus Torvalds1da177e2005-04-16 15:20:36 -0700152 if (window_size > ACPI_SYSMEM_REGION_WINDOW_SIZE) {
153 window_size = ACPI_SYSMEM_REGION_WINDOW_SIZE;
154 }
155
156 /* Create a new mapping starting at the address given */
157
Bob Mooref3d2e782007-02-02 19:48:18 +0300158 mem_info->mapped_logical_address =
159 acpi_os_map_memory((acpi_native_uint) address, window_size);
160 if (!mem_info->mapped_logical_address) {
Bob Mooreb8e4d892006-01-27 16:43:00 -0500161 ACPI_ERROR((AE_INFO,
162 "Could not map memory at %8.8X%8.8X, size %X",
Bob Mooreb7f9f042008-04-10 19:06:40 +0400163 ACPI_FORMAT_NATIVE_UINT(address),
Bob Mooreb8e4d892006-01-27 16:43:00 -0500164 (u32) window_size));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700165 mem_info->mapped_length = 0;
Bob Mooref3d2e782007-02-02 19:48:18 +0300166 return_ACPI_STATUS(AE_NO_MEMORY);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700167 }
168
169 /* Save the physical address and mapping size */
170
171 mem_info->mapped_physical_address = address;
172 mem_info->mapped_length = window_size;
173 }
174
175 /*
176 * Generate a logical pointer corresponding to the address we want to
177 * access
178 */
179 logical_addr_ptr = mem_info->mapped_logical_address +
Len Brown4be44fc2005-08-05 00:44:28 -0400180 ((acpi_integer) address -
181 (acpi_integer) mem_info->mapped_physical_address);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700182
Len Brown4be44fc2005-08-05 00:44:28 -0400183 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
Bob Moore83135242006-10-03 00:00:00 -0400184 "System-Memory (width %d) R/W %d Address=%8.8X%8.8X\n",
Bob Mooreb7f9f042008-04-10 19:06:40 +0400185 bit_width, function,
186 ACPI_FORMAT_NATIVE_UINT(address)));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700187
Len Brown4be44fc2005-08-05 00:44:28 -0400188 /*
189 * Perform the memory read or write
190 *
191 * Note: For machines that do not support non-aligned transfers, the target
192 * address was checked for alignment above. We do not attempt to break the
193 * transfer up into smaller (byte-size) chunks because the AML specifically
194 * asked for a transfer width that the hardware may require.
195 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700196 switch (function) {
197 case ACPI_READ:
198
199 *value = 0;
200 switch (bit_width) {
201 case 8:
Bob Moorec51a4de2005-11-17 13:07:00 -0500202 *value = (acpi_integer) ACPI_GET8(logical_addr_ptr);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700203 break;
204
205 case 16:
Bob Moorec51a4de2005-11-17 13:07:00 -0500206 *value = (acpi_integer) ACPI_GET16(logical_addr_ptr);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700207 break;
208
209 case 32:
Bob Moorec51a4de2005-11-17 13:07:00 -0500210 *value = (acpi_integer) ACPI_GET32(logical_addr_ptr);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700211 break;
212
Linus Torvalds1da177e2005-04-16 15:20:36 -0700213 case 64:
Bob Moorec51a4de2005-11-17 13:07:00 -0500214 *value = (acpi_integer) ACPI_GET64(logical_addr_ptr);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700215 break;
Bob Moore59fa8502007-02-02 19:48:23 +0300216
Linus Torvalds1da177e2005-04-16 15:20:36 -0700217 default:
218 /* bit_width was already validated */
219 break;
220 }
221 break;
222
223 case ACPI_WRITE:
224
225 switch (bit_width) {
226 case 8:
Bob Moorec51a4de2005-11-17 13:07:00 -0500227 ACPI_SET8(logical_addr_ptr) = (u8) * value;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700228 break;
229
230 case 16:
Bob Moorec51a4de2005-11-17 13:07:00 -0500231 ACPI_SET16(logical_addr_ptr) = (u16) * value;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700232 break;
233
234 case 32:
Bob Moorec51a4de2005-11-17 13:07:00 -0500235 ACPI_SET32(logical_addr_ptr) = (u32) * value;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700236 break;
237
Linus Torvalds1da177e2005-04-16 15:20:36 -0700238 case 64:
Bob Moorec51a4de2005-11-17 13:07:00 -0500239 ACPI_SET64(logical_addr_ptr) = (u64) * value;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700240 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700241
242 default:
243 /* bit_width was already validated */
244 break;
245 }
246 break;
247
248 default:
249 status = AE_BAD_PARAMETER;
250 break;
251 }
252
Len Brown4be44fc2005-08-05 00:44:28 -0400253 return_ACPI_STATUS(status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700254}
255
Linus Torvalds1da177e2005-04-16 15:20:36 -0700256/*******************************************************************************
257 *
258 * FUNCTION: acpi_ex_system_io_space_handler
259 *
260 * PARAMETERS: Function - Read or Write operation
261 * Address - Where in the space to read or write
262 * bit_width - Field width in bits (8, 16, or 32)
263 * Value - Pointer to in or out value
264 * handler_context - Pointer to Handler's context
265 * region_context - Pointer to context specific to the
266 * accessed region
267 *
268 * RETURN: Status
269 *
270 * DESCRIPTION: Handler for the System IO address space (Op Region)
271 *
272 ******************************************************************************/
273
274acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -0400275acpi_ex_system_io_space_handler(u32 function,
276 acpi_physical_address address,
277 u32 bit_width,
278 acpi_integer * value,
279 void *handler_context, void *region_context)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700280{
Len Brown4be44fc2005-08-05 00:44:28 -0400281 acpi_status status = AE_OK;
282 u32 value32;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700283
Bob Mooreb229cf92006-04-21 17:15:00 -0400284 ACPI_FUNCTION_TRACE(ex_system_io_space_handler);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700285
Len Brown4be44fc2005-08-05 00:44:28 -0400286 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
Bob Moore83135242006-10-03 00:00:00 -0400287 "System-IO (width %d) R/W %d Address=%8.8X%8.8X\n",
Bob Mooreb7f9f042008-04-10 19:06:40 +0400288 bit_width, function,
289 ACPI_FORMAT_NATIVE_UINT(address)));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700290
291 /* Decode the function parameter */
292
293 switch (function) {
294 case ACPI_READ:
295
Len Brown4be44fc2005-08-05 00:44:28 -0400296 status = acpi_os_read_port((acpi_io_address) address,
297 &value32, bit_width);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700298 *value = value32;
299 break;
300
301 case ACPI_WRITE:
302
Len Brown4be44fc2005-08-05 00:44:28 -0400303 status = acpi_os_write_port((acpi_io_address) address,
304 (u32) * value, bit_width);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700305 break;
306
307 default:
308 status = AE_BAD_PARAMETER;
309 break;
310 }
311
Len Brown4be44fc2005-08-05 00:44:28 -0400312 return_ACPI_STATUS(status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700313}
314
Linus Torvalds1da177e2005-04-16 15:20:36 -0700315/*******************************************************************************
316 *
317 * FUNCTION: acpi_ex_pci_config_space_handler
318 *
319 * PARAMETERS: Function - Read or Write operation
320 * Address - Where in the space to read or write
321 * bit_width - Field width in bits (8, 16, or 32)
322 * Value - Pointer to in or out value
323 * handler_context - Pointer to Handler's context
324 * region_context - Pointer to context specific to the
325 * accessed region
326 *
327 * RETURN: Status
328 *
329 * DESCRIPTION: Handler for the PCI Config address space (Op Region)
330 *
331 ******************************************************************************/
332
333acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -0400334acpi_ex_pci_config_space_handler(u32 function,
335 acpi_physical_address address,
336 u32 bit_width,
337 acpi_integer * value,
338 void *handler_context, void *region_context)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700339{
Len Brown4be44fc2005-08-05 00:44:28 -0400340 acpi_status status = AE_OK;
341 struct acpi_pci_id *pci_id;
342 u16 pci_register;
Ming Lin11869742008-02-21 02:01:30 -0500343 u32 value32;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700344
Bob Mooreb229cf92006-04-21 17:15:00 -0400345 ACPI_FUNCTION_TRACE(ex_pci_config_space_handler);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700346
347 /*
348 * The arguments to acpi_os(Read|Write)pci_configuration are:
349 *
350 * pci_segment is the PCI bus segment range 0-31
351 * pci_bus is the PCI bus number range 0-255
352 * pci_device is the PCI device number range 0-31
353 * pci_function is the PCI device function number
354 * pci_register is the Config space register range 0-255 bytes
355 *
356 * Value - input value for write, output address for read
357 *
358 */
Len Brown4be44fc2005-08-05 00:44:28 -0400359 pci_id = (struct acpi_pci_id *)region_context;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700360 pci_register = (u16) (u32) address;
361
Len Brown4be44fc2005-08-05 00:44:28 -0400362 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
Bob Moore83135242006-10-03 00:00:00 -0400363 "Pci-Config %d (%d) Seg(%04x) Bus(%04x) Dev(%04x) Func(%04x) Reg(%04x)\n",
Len Brown4be44fc2005-08-05 00:44:28 -0400364 function, bit_width, pci_id->segment, pci_id->bus,
365 pci_id->device, pci_id->function, pci_register));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700366
367 switch (function) {
368 case ACPI_READ:
369
Len Brown4be44fc2005-08-05 00:44:28 -0400370 status = acpi_os_read_pci_configuration(pci_id, pci_register,
Ming Lin11869742008-02-21 02:01:30 -0500371 &value32, bit_width);
372 *value = value32;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700373 break;
374
375 case ACPI_WRITE:
376
Len Brown4be44fc2005-08-05 00:44:28 -0400377 status = acpi_os_write_pci_configuration(pci_id, pci_register,
378 *value, bit_width);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700379 break;
380
381 default:
382
383 status = AE_BAD_PARAMETER;
384 break;
385 }
386
Len Brown4be44fc2005-08-05 00:44:28 -0400387 return_ACPI_STATUS(status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700388}
389
Linus Torvalds1da177e2005-04-16 15:20:36 -0700390/*******************************************************************************
391 *
392 * FUNCTION: acpi_ex_cmos_space_handler
393 *
394 * PARAMETERS: Function - Read or Write operation
395 * Address - Where in the space to read or write
396 * bit_width - Field width in bits (8, 16, or 32)
397 * Value - Pointer to in or out value
398 * handler_context - Pointer to Handler's context
399 * region_context - Pointer to context specific to the
400 * accessed region
401 *
402 * RETURN: Status
403 *
404 * DESCRIPTION: Handler for the CMOS address space (Op Region)
405 *
406 ******************************************************************************/
407
408acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -0400409acpi_ex_cmos_space_handler(u32 function,
410 acpi_physical_address address,
411 u32 bit_width,
412 acpi_integer * value,
413 void *handler_context, void *region_context)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700414{
Len Brown4be44fc2005-08-05 00:44:28 -0400415 acpi_status status = AE_OK;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700416
Bob Mooreb229cf92006-04-21 17:15:00 -0400417 ACPI_FUNCTION_TRACE(ex_cmos_space_handler);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700418
Len Brown4be44fc2005-08-05 00:44:28 -0400419 return_ACPI_STATUS(status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700420}
421
Linus Torvalds1da177e2005-04-16 15:20:36 -0700422/*******************************************************************************
423 *
424 * FUNCTION: acpi_ex_pci_bar_space_handler
425 *
426 * PARAMETERS: Function - Read or Write operation
427 * Address - Where in the space to read or write
428 * bit_width - Field width in bits (8, 16, or 32)
429 * Value - Pointer to in or out value
430 * handler_context - Pointer to Handler's context
431 * region_context - Pointer to context specific to the
432 * accessed region
433 *
434 * RETURN: Status
435 *
436 * DESCRIPTION: Handler for the PCI bar_target address space (Op Region)
437 *
438 ******************************************************************************/
439
440acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -0400441acpi_ex_pci_bar_space_handler(u32 function,
442 acpi_physical_address address,
443 u32 bit_width,
444 acpi_integer * value,
445 void *handler_context, void *region_context)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700446{
Len Brown4be44fc2005-08-05 00:44:28 -0400447 acpi_status status = AE_OK;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700448
Bob Mooreb229cf92006-04-21 17:15:00 -0400449 ACPI_FUNCTION_TRACE(ex_pci_bar_space_handler);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700450
Len Brown4be44fc2005-08-05 00:44:28 -0400451 return_ACPI_STATUS(status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700452}
453
Linus Torvalds1da177e2005-04-16 15:20:36 -0700454/*******************************************************************************
455 *
456 * FUNCTION: acpi_ex_data_table_space_handler
457 *
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
464 * accessed region
465 *
466 * RETURN: Status
467 *
468 * DESCRIPTION: Handler for the Data Table address space (Op Region)
469 *
470 ******************************************************************************/
471
472acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -0400473acpi_ex_data_table_space_handler(u32 function,
474 acpi_physical_address address,
475 u32 bit_width,
476 acpi_integer * value,
477 void *handler_context, void *region_context)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700478{
Bob Mooreb229cf92006-04-21 17:15:00 -0400479 ACPI_FUNCTION_TRACE(ex_data_table_space_handler);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700480
Robert Moore44f6c012005-04-18 22:49:35 -0400481 /* Perform the memory read or write */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700482
483 switch (function) {
484 case ACPI_READ:
485
Bob Moore41195322006-05-26 16:36:00 -0400486 ACPI_MEMCPY(ACPI_CAST_PTR(char, value),
487 ACPI_PHYSADDR_TO_PTR(address),
488 ACPI_DIV_8(bit_width));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700489 break;
490
491 case ACPI_WRITE:
492 default:
493
Len Brown4be44fc2005-08-05 00:44:28 -0400494 return_ACPI_STATUS(AE_SUPPORT);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700495 }
496
Bob Moore41195322006-05-26 16:36:00 -0400497 return_ACPI_STATUS(AE_OK);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700498}