diff options
| author | Jung-uk Kim <jkim@FreeBSD.org> | 2019-12-13 16:51:08 +0000 |
|---|---|---|
| committer | Jung-uk Kim <jkim@FreeBSD.org> | 2019-12-13 16:51:08 +0000 |
| commit | 856462eaaec9052a60d62b66076257e7fad337c7 (patch) | |
| tree | f331b79154052fd6dc5f70c176975966370af8d9 /source/components/executer | |
| parent | 858f47305dae045d81f39451ade697ba99b3266f (diff) | |
Notes
Diffstat (limited to 'source/components/executer')
| -rw-r--r-- | source/components/executer/exfield.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/components/executer/exfield.c b/source/components/executer/exfield.c index b35e6a4ef4ae..dc97d40450eb 100644 --- a/source/components/executer/exfield.c +++ b/source/components/executer/exfield.c @@ -246,7 +246,8 @@ AcpiExGetProtocolBufferLength ( * RETURN: Status * * DESCRIPTION: Read from a named field. Returns either an Integer or a - * Buffer, depending on the size of the field. + * Buffer, depending on the size of the field and whether if a + * field is created by the CreateField() operator. * ******************************************************************************/ @@ -310,12 +311,17 @@ AcpiExReadDataFromField ( * the use of arithmetic operators on the returned value if the * field size is equal or smaller than an Integer. * + * However, all buffer fields created by CreateField operator needs to + * remain as a buffer to match other AML interpreter implementations. + * * Note: Field.length is in bits. */ BufferLength = (ACPI_SIZE) ACPI_ROUND_BITS_UP_TO_BYTES ( ObjDesc->Field.BitLength); - if (BufferLength > AcpiGbl_IntegerByteWidth) + if (BufferLength > AcpiGbl_IntegerByteWidth || + (ObjDesc->Common.Type == ACPI_TYPE_BUFFER_FIELD && + ObjDesc->BufferField.IsCreateField)) { /* Field is too large for an Integer, create a Buffer instead */ |
