AmlField.fld.keep: def of bend-osdev-acpi@0.1.1.0 Import: import bend-osdev-acpi@0.1.1.0/aml_field.bend as AmlField Lines 171-184 of bend-osdev-acpi@0.1.1.0/aml_field.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-acpi@0.1.1.0/aml_field.bend&start_line=171&end_line=184 import Base import bend-osdev-word64@0.1.1.0/word64.bend as W import bend-osdev-acpi@0.1.1.0/error.bend as E import bend-osdev-acpi@0.1.1.0/aml_host.bend as Hs # the unit's bits that are not the field's, by the update rule: read # (Preserve), all ones, all zeros def fld.keep(~H: Data, ~io: H -> Hs.AmlHostOp -> Result<&2, &2, E.AcpiError, Hs.AmlHostAns>, whole: Bool, rule: Nat, h: H, +a: Hs.AmlAccess) -> Result<&2, &2, E.AcpiError, Hs.AmlHostAns>: match whole: case True{}: Done{Hs.AmlHostAns{h, W.W64.zero()}} case False{}: match rule: case 1n: Done{Hs.AmlHostAns{h, W.W64.max()}} case 2n: Done{Hs.AmlHostAns{h, W.W64.zero()}} case _: io(h, Hs.AmlHRead{a}) Uses (9): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=bend-osdev-acpi@0.1.1.0/aml_host.bend&name=AmlAccess https://jend.leeeet.dev/definition.txt?path=bend-osdev-acpi@0.1.1.0/aml_host.bend&name=AmlHostAns https://jend.leeeet.dev/definition.txt?path=bend-osdev-acpi@0.1.1.0/aml_host.bend&name=AmlHostOp https://jend.leeeet.dev/definition.txt?path=bend-osdev-acpi@0.1.1.0/error.bend&name=AcpiError https://jend.leeeet.dev/definition.txt?path=bend-osdev-word64@0.1.1.0/word64.bend&name=W64.max https://jend.leeeet.dev/definition.txt?path=bend-osdev-word64@0.1.1.0/word64.bend&name=W64.zero