Deleted Added
full compact
exprep.c (77424) exprep.c (78986)
1
2/******************************************************************************
3 *
4 * Module Name: exprep - ACPI AML (p-code) execution - field prep utilities
1
2/******************************************************************************
3 *
4 * Module Name: exprep - ACPI AML (p-code) execution - field prep utilities
5 * $Revision: 89 $
5 * $Revision: 90 $
6 *
7 *****************************************************************************/
8
9/******************************************************************************
10 *
11 * 1. Copyright Notice
12 *
13 * Some or all of this work - Copyright (c) 1999, 2000, 2001, Intel Corp.

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

255 AccessBitWidth = AcpiExDecodeFieldAccessType (
256 ((FieldFlags & ACCESS_TYPE_MASK) >> ACCESS_TYPE_SHIFT),
257 ObjDesc->Field.BitLength);
258 if (!AccessBitWidth)
259 {
260 return_ACPI_STATUS (AE_AML_OPERAND_VALUE);
261 }
262
6 *
7 *****************************************************************************/
8
9/******************************************************************************
10 *
11 * 1. Copyright Notice
12 *
13 * Some or all of this work - Copyright (c) 1999, 2000, 2001, Intel Corp.

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

255 AccessBitWidth = AcpiExDecodeFieldAccessType (
256 ((FieldFlags & ACCESS_TYPE_MASK) >> ACCESS_TYPE_SHIFT),
257 ObjDesc->Field.BitLength);
258 if (!AccessBitWidth)
259 {
260 return_ACPI_STATUS (AE_AML_OPERAND_VALUE);
261 }
262
263 /* Setup granularity-based fields */
263 /* Setup width (access granularity) fields */
264
265 ObjDesc->CommonField.AccessBitWidth = (UINT8) AccessBitWidth; /* 8, 16, 32, 64 */
266 ObjDesc->CommonField.AccessByteWidth = (UINT8) DIV_8 (AccessBitWidth); /* 1, 2, 4, 8 */
267
268 if (ObjDesc->Common.Type == ACPI_TYPE_BUFFER_FIELD)
269 {
270 /*
271 * BufferField access can be on any byte boundary, so the
272 * granularity is always 8
273 */
274 AccessBitWidth = 8;
275 }
276
264
265 ObjDesc->CommonField.AccessBitWidth = (UINT8) AccessBitWidth; /* 8, 16, 32, 64 */
266 ObjDesc->CommonField.AccessByteWidth = (UINT8) DIV_8 (AccessBitWidth); /* 1, 2, 4, 8 */
267
268 if (ObjDesc->Common.Type == ACPI_TYPE_BUFFER_FIELD)
269 {
270 /*
271 * BufferField access can be on any byte boundary, so the
272 * granularity is always 8
273 */
274 AccessBitWidth = 8;
275 }
276
277
277 /*
278 * BaseByteOffset is the address of the start of the field within the region. It is
279 * the byte address of the first *datum* (field-width data unit) of the field.
280 * (i.e., the first datum that contains at least the first *bit* of the field.)
281 */
282 NearestByteAddress = ROUND_BITS_DOWN_TO_BYTES (FieldBitPosition);
283 ObjDesc->CommonField.BaseByteOffset = ROUND_DOWN (NearestByteAddress,
278 /*
279 * BaseByteOffset is the address of the start of the field within the region. It is
280 * the byte address of the first *datum* (field-width data unit) of the field.
281 * (i.e., the first datum that contains at least the first *bit* of the field.)
282 */
283 NearestByteAddress = ROUND_BITS_DOWN_TO_BYTES (FieldBitPosition);
284 ObjDesc->CommonField.BaseByteOffset = ROUND_DOWN (NearestByteAddress,
284 ObjDesc->CommonField.AccessByteWidth);
285 DIV_8 (AccessBitWidth));
285
286 /*
287 * StartFieldBitOffset is the offset of the first bit of the field within a field datum.
288 * This is calculated as the number of bits from the BaseByteOffset. In other words,
289 * the start of the field is relative to a byte address, regardless of the access type
290 * of the field.
291 */
292 ObjDesc->CommonField.StartFieldBitOffset = (UINT8) (MOD_8 (FieldBitPosition));

--- 332 unchanged lines hidden ---
286
287 /*
288 * StartFieldBitOffset is the offset of the first bit of the field within a field datum.
289 * This is calculated as the number of bits from the BaseByteOffset. In other words,
290 * the start of the field is relative to a byte address, regardless of the access type
291 * of the field.
292 */
293 ObjDesc->CommonField.StartFieldBitOffset = (UINT8) (MOD_8 (FieldBitPosition));

--- 332 unchanged lines hidden ---