Deleted Added
full compact
exregion.c (67754) exregion.c (69450)
1
2/******************************************************************************
3 *
4 * Module Name: amregion - ACPI default OpRegion (address space) handlers
1
2/******************************************************************************
3 *
4 * Module Name: amregion - ACPI default OpRegion (address space) handlers
5 * $Revision: 36 $
5 * $Revision: 40 $
6 *
7 *****************************************************************************/
8
9/******************************************************************************
10 *
11 * 1. Copyright Notice
12 *
13 * Some or all of this work - Copyright (c) 1999, Intel Corp. All rights

--- 132 unchanged lines hidden (view full) ---

146 *
147 * DESCRIPTION: Handler for the System Memory address space (Op Region)
148 *
149 ******************************************************************************/
150
151ACPI_STATUS
152AcpiAmlSystemMemorySpaceHandler (
153 UINT32 Function,
6 *
7 *****************************************************************************/
8
9/******************************************************************************
10 *
11 * 1. Copyright Notice
12 *
13 * Some or all of this work - Copyright (c) 1999, Intel Corp. All rights

--- 132 unchanged lines hidden (view full) ---

146 *
147 * DESCRIPTION: Handler for the System Memory address space (Op Region)
148 *
149 ******************************************************************************/
150
151ACPI_STATUS
152AcpiAmlSystemMemorySpaceHandler (
153 UINT32 Function,
154 ACPI_INTEGER Address,
154 ACPI_PHYSICAL_ADDRESS Address,
155 UINT32 BitWidth,
156 UINT32 *Value,
157 void *HandlerContext,
158 void *RegionContext)
159{
160 ACPI_STATUS Status = AE_OK;
161 void *LogicalAddrPtr = NULL;
162 MEM_HANDLER_CONTEXT *MemInfo = RegionContext;

--- 29 unchanged lines hidden (view full) ---

192
193
194 /*
195 * Does the request fit into the cached memory mapping?
196 * Is 1) Address below the current mapping? OR
197 * 2) Address beyond the current mapping?
198 */
199
155 UINT32 BitWidth,
156 UINT32 *Value,
157 void *HandlerContext,
158 void *RegionContext)
159{
160 ACPI_STATUS Status = AE_OK;
161 void *LogicalAddrPtr = NULL;
162 MEM_HANDLER_CONTEXT *MemInfo = RegionContext;

--- 29 unchanged lines hidden (view full) ---

192
193
194 /*
195 * Does the request fit into the cached memory mapping?
196 * Is 1) Address below the current mapping? OR
197 * 2) Address beyond the current mapping?
198 */
199
200 if ((Address < (ACPI_INTEGER) MemInfo->MappedPhysicalAddress) ||
200 if ((Address < MemInfo->MappedPhysicalAddress) ||
201 ((Address + Length) >
201 ((Address + Length) >
202 (ACPI_INTEGER) (MemInfo->MappedPhysicalAddress + MemInfo->MappedLength)))
202 (MemInfo->MappedPhysicalAddress + MemInfo->MappedLength)))
203 {
204 /*
205 * The request cannot be resolved by the current memory mapping;
206 * Delete the existing mapping and create a new one.
207 */
208
209 if (MemInfo->MappedLength)
210 {
211 /* Valid mapping, delete it */
212
213 AcpiOsUnmapMemory (MemInfo->MappedLogicalAddress,
214 MemInfo->MappedLength);
215 }
216
217 MemInfo->MappedLength = 0; /* In case of failure below */
218
219 /* Create a new mapping starting at the address given */
220
203 {
204 /*
205 * The request cannot be resolved by the current memory mapping;
206 * Delete the existing mapping and create a new one.
207 */
208
209 if (MemInfo->MappedLength)
210 {
211 /* Valid mapping, delete it */
212
213 AcpiOsUnmapMemory (MemInfo->MappedLogicalAddress,
214 MemInfo->MappedLength);
215 }
216
217 MemInfo->MappedLength = 0; /* In case of failure below */
218
219 /* Create a new mapping starting at the address given */
220
221 Status = AcpiOsMapMemory ((void *) (UINT32) Address, SYSMEM_REGION_WINDOW_SIZE,
221 Status = AcpiOsMapMemory (Address, SYSMEM_REGION_WINDOW_SIZE,
222 (void **) &MemInfo->MappedLogicalAddress);
223 if (ACPI_FAILURE (Status))
224 {
225 return_ACPI_STATUS (Status);
226 }
227
228 /* TBD: should these pointers go to 64-bit in all cases ? */
229
222 (void **) &MemInfo->MappedLogicalAddress);
223 if (ACPI_FAILURE (Status))
224 {
225 return_ACPI_STATUS (Status);
226 }
227
228 /* TBD: should these pointers go to 64-bit in all cases ? */
229
230 MemInfo->MappedPhysicalAddress = (UINT8 *) (UINT32) Address;
230 MemInfo->MappedPhysicalAddress = Address;
231 MemInfo->MappedLength = SYSMEM_REGION_WINDOW_SIZE;
232 }
233
234
235 /*
236 * Generate a logical pointer corresponding to the address we want to
237 * access
238 */
239
240 /* TBD: should these pointers go to 64-bit in all cases ? */
241
242 LogicalAddrPtr = MemInfo->MappedLogicalAddress +
231 MemInfo->MappedLength = SYSMEM_REGION_WINDOW_SIZE;
232 }
233
234
235 /*
236 * Generate a logical pointer corresponding to the address we want to
237 * access
238 */
239
240 /* TBD: should these pointers go to 64-bit in all cases ? */
241
242 LogicalAddrPtr = MemInfo->MappedLogicalAddress +
243 ((UINT8 *) (UINT32) Address - MemInfo->MappedPhysicalAddress);
243 (Address - MemInfo->MappedPhysicalAddress);
244
245 /* Perform the memory read or write */
246
247 switch (Function)
248 {
249
250 case ADDRESS_SPACE_READ:
251

--- 67 unchanged lines hidden (view full) ---

319 *
320 * DESCRIPTION: Handler for the System IO address space (Op Region)
321 *
322 ******************************************************************************/
323
324ACPI_STATUS
325AcpiAmlSystemIoSpaceHandler (
326 UINT32 Function,
244
245 /* Perform the memory read or write */
246
247 switch (Function)
248 {
249
250 case ADDRESS_SPACE_READ:
251

--- 67 unchanged lines hidden (view full) ---

319 *
320 * DESCRIPTION: Handler for the System IO address space (Op Region)
321 *
322 ******************************************************************************/
323
324ACPI_STATUS
325AcpiAmlSystemIoSpaceHandler (
326 UINT32 Function,
327 ACPI_INTEGER Address,
327 ACPI_PHYSICAL_ADDRESS Address,
328 UINT32 BitWidth,
329 UINT32 *Value,
330 void *HandlerContext,
331 void *RegionContext)
332{
333 ACPI_STATUS Status = AE_OK;
334
335

--- 91 unchanged lines hidden (view full) ---

427 *
428 * DESCRIPTION: Handler for the PCI Config address space (Op Region)
429 *
430 ******************************************************************************/
431
432ACPI_STATUS
433AcpiAmlPciConfigSpaceHandler (
434 UINT32 Function,
328 UINT32 BitWidth,
329 UINT32 *Value,
330 void *HandlerContext,
331 void *RegionContext)
332{
333 ACPI_STATUS Status = AE_OK;
334
335

--- 91 unchanged lines hidden (view full) ---

427 *
428 * DESCRIPTION: Handler for the PCI Config address space (Op Region)
429 *
430 ******************************************************************************/
431
432ACPI_STATUS
433AcpiAmlPciConfigSpaceHandler (
434 UINT32 Function,
435 ACPI_INTEGER Address,
435 ACPI_PHYSICAL_ADDRESS Address,
436 UINT32 BitWidth,
437 UINT32 *Value,
438 void *HandlerContext,
439 void *RegionContext)
440{
441 ACPI_STATUS Status = AE_OK;
442 UINT32 PciBus;
443 UINT32 DevFunc;

--- 118 unchanged lines hidden ---
436 UINT32 BitWidth,
437 UINT32 *Value,
438 void *HandlerContext,
439 void *RegionContext)
440{
441 ACPI_STATUS Status = AE_OK;
442 UINT32 PciBus;
443 UINT32 DevFunc;

--- 118 unchanged lines hidden ---