def AmlValue.type
import bend-osdev-acpi@0.1.1.0/aml_value.bend as AmlValueimport Base
37# ObjectType codes (chapter 19, ObjectType): 0 uninitialized, 1 integer,
38# 2 string, 3 buffer, 4 package, 5 field unit, 6 device, 7 event, 8 method,
39# 9 mutex, 10 operation region, 11 power resource, 12 processor, 13 thermal
40# zone, 14 buffer field, 16 debug object
41def AmlValue.type(v: AmlValue) -> U32:
42 match v:
43 case AmlUninit{}:
44 0
45 case AmlInt{x}:
46 1
47 case AmlStr{s}:
48 2
49 case AmlBuf{b}:
50 3
51 case AmlPkg{xs}:
52 4
53 case AmlRef{l}:
54 0
55 case AmlObj{p, k}:
56 k