def mcfg.addr
import bend-osdev-acpi@0.1.1.0/mcfg.bend as Mcfgimport Base
import bend-osdev-word64@0.1.1.0/word64.bend as W
73def mcfg.addr(+e: AcpiMcfgEntry, +bus: U32, +dev: U32, +fun: U32, +reg: U32) -> W.W64:
74 match e:
75 case AcpiMcfgEntry{b, s, lo, hi}:
76 W.W64.add(b, W.W64.from_u32(U32.or(U32.shln(U32.and(bus, 255), 20n), U32.or(U32.shln(U32.and(dev, 31), 15n), U32.or(U32.shln(U32.and(fun, 7), 12n), U32.and(reg, 4095))))))