def err

bend-osdev-acpi@0.1.1.0 · check.bend:29

import bend-osdev-acpi@0.1.1.0/check.bend as Check
import Base
import bend-osdev-word64@0.1.1.0/word64.bend as W
import bend-osdev-bytes@0.1.1.0/bytes.bend as B
import bend-osdev-acpi@0.1.1.0/error.bend as E

29def err(e: E.AcpiError) -> String:
30  match e:
31    case E.AcpiTooShort{n, g}:
32      "too short " ++ Nat.show(n) ++ " " ++ Nat.show(g)
33    case E.AcpiBadSignature{s}:
34      "bad signature " ++ B.Octets.to_string(s)
35    case E.AcpiBadLength{l}:
36      "bad length " ++ U32.show(l)
37    case E.AcpiBadChecksum{s}:
38      "bad checksum " ++ U32.show(s)
39    case E.AcpiRsdpBadChecksum{s}:
40      "bad RSDP checksum " ++ U32.show(s)
41    case E.AcpiNotMapped{a}:
42      "not mapped " ++ W.W64.show_hex(a)
43    case E.AcpiAmlUndefined{p}:
44      "undefined " ++ p
45    case E.AcpiAmlStepLimit{}:
46      "step limit"
47    case E.AcpiAmlBadOpcode{c}:
48      "bad opcode " ++ U32.show(c)
49    case E.AcpiAmlBadOperand{c}:
50      "bad operand " ++ U32.show(c)
51    case E.AcpiAmlBadType{s}:
52      "bad type " ++ s
53    case E.AcpiAmlDuplicate{p}:
54      "duplicate " ++ p
55    case E.AcpiAmlUnsupported{s}:
56      "unsupported " ++ s
57    case E.AcpiAmlTruncated{}:
58      "truncated"
59    case E.AcpiAmlRange{}:
60      "range"
61    case _:
62      "error"

Uses (7)

Used by (14)