BufferField implicit conversion not supported in OperationRegion command

Open
#273 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
65/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
rust

Research direction

Start by reproducing the failing ASL snippet and trace the OperationRegion command handling, especially the DerefOf expression that yields a BufferField. Read the existing AML value-conversion rules and related tests, if present. Done means this OperationRegion parses successfully with the expected integer address, with regression coverage for the snippet.

Written by the indexing model from the issue text.

Description

NB: This issue repros only if #272 is worked around, otherwise that hits first.

My machine has an ASL block that simplifies down the snippet at below. The crate can't parse the OperationRegion command - ObjectNotOfExpectedType { expected: Integer, got: BufferField }.

I think BufferField should be implicitly converted to Integer here (and possibly other places too)?

Failing snippet

DefinitionBlock ("", "SSDT", 2, "AMD", "AmdTable", 0x00000002)
{
    Scope (\_SB)
    {
        Name (ADAT, Buffer (0x0010) //keep
        {
            /* 0000 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // ........
            /* 0008 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // ........

        })

        Device (AWR0)
        {
            Name (_HID, EisaId ("PNP0C02") /* PNP Motherboard Resources */)  // _HID: Hardware ID
            Name (_UID, 0x90)  // _UID: Unique ID
            Device (ABR0)
            {
                Name (_HID, EisaId ("PNP0C02") /* PNP Motherboard Resources */)  // _HID: Hardware ID
                Name (_UID, 0x80)  // _UID: Unique ID
                OperationRegion (A053, SystemMemory, (DerefOf (\_SB.ADAT [(0x04)])), 0x1000) // <--- this line fails
                Field (A053, ByteAcc, NoLock, Preserve)
                {
                    Offset (0x18),
                    A, 8
                }
            }
        }
    }
}

Quite happy to take a look if you give me a summary of how this is intended to work.

Dominant language
Rust
Stars
249
Forks
102
Avg merge
4d 18h
Merged PRs (30d)
6

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rust-osdev/acpi

All issues in rust-osdev/acpi

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.