Skip to content

Add BufferField support for Increment/Decrement. - #351

Open
dewyatt wants to merge 1 commit into
rust-osdev:mainfrom
dewyatt:dewyatt-increment-decrement-bufferfield
Open

dewyatt wants to merge 1 commit into
rust-osdev:mainfrom
dewyatt:dewyatt-increment-decrement-bufferfield

Conversation

@dewyatt

@dewyatt dewyatt commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Feedback welcome, probably room for improvement here (new to the codebase).

The PCI bus _CRS on my machine requires this in a couple places like:

                CreateDWordField (RES0, 0xB4, GSLN)
                GSMN = ^VLVC.BDSM /* \_SB_.PCI0.VLVC.BDSM */
                GSMX = (^VLVC.TOLD & 0xFFFFF000)
                GSMX--
                GSLN = ((GSMX - GSMN) + One)

    0F63: 8A 52 45 53 30 0A B4 47 53 4C 4E 70 5E 2E 56 4C  // .RES0..GSLNp^.VL
    0F73: 56 43 42 44 53 4D 47 53 4D 4E 7B 5E 2E 56 4C 56  // VCBDSMGSMN{^.VLV
    0F83: 43 54 4F 4C 44 0C 00 F0 FF FF 47 53 4D 58 76 47  // CTOLD.....GSMXvG
    0F93: 53 4D 58 72 74 47 53 4D 58 47 53 4D 4E 00 01 47  // SMXrtGSMXGSMN..G
    0FA3: 53 4C 4E                                         // SLN

(full tables here)

@martin-hughes

Copy link
Copy Markdown
Contributor

Looks all good so far. Would you mind adding a test case for it? I don't think you could just write a ASL file for it, because aml-tester returns all reads as zero. Instead I think you probably need to copy one of the integration-style tests. The easiest examples to base it on are probably in tests/normal_fields.rs.

Take a look at the "standard handler" in that file - you'll need to provide values for the reads and checked values for the writes, but the test harness will assert that everything is correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants