~/bend-docscommunity

src/fdt/fdt.bend checks

raw source on the hub · import 0x639131b76babbe4fca33020574c2b0dd/src/fdt/fdt.bend as Fdt

3 imports
import Base
import ../lib/u64.bend as U
import ../lib/bytes.bend as B

Types

type Prop source · line 16 · raw

Data

type Node source · line 19 · raw

Data

Definitions

def Prop.empty source · line 22 · raw

@name:String -> Prop

def Prop.u32 source · line 25 · raw

@name:String -> @v:U32 -> Prop

def Prop.u64 source · line 28 · raw

@name:String -> @v:0x639131b76babbe4fca33020574c2b0dd/src/lib/u64.U64 -> Prop

def Fdt.cells source · line 31 · raw

@vs:List<&2, U32> -> List<&2, U32>

def Prop.cells source · line 39 · raw

@name:String -> @vs:List<&2, U32> -> Prop

A list of 32-bit cells.

def Prop.str source · line 42 · raw

@name:String -> @s:String -> Prop

def Fdt.cstrings source · line 45 · raw

@ss:List<&2, String> -> List<&2, U32>

def Prop.strs source · line 53 · raw

@name:String -> @ss:List<&2, String> -> Prop

A string list: each string NUL-terminated, concatenated.

def Fdt.prop_names source · line 56 · raw

@ps:List<&2, Prop> -> List<&2, String>

def Fdt.names source · line 65 · raw

@ns:List<&2, Node> -> List<&2, String>

Every property name of a forest, depth first (a node's props, then its children, then its siblings), duplicates kept.

def Fdt.has source · line 72 · raw

@ss:List<&2, String> -> @+s:String -> Bool

def Fdt.dedup.add source · line 79 · raw

@seen:Bool -> @n:String -> @acc:List<&2, String> -> List<&2, String>

def Fdt.dedup source · line 87 · raw

@ss:List<&2, String> -> @+acc:List<&2, String> -> List<&2, String>

Each name once, at its first appearance (acc holds the names kept so far).

def Fdt.table source · line 95 · raw

@root:Node -> List<&2, String>

The names of the strings block, in order.

def Fdt.strings source · line 100 · raw

@root:Node -> List<&2, U32>

The strings block for a tree: each distinct property name once, NUL-terminated, in depth-first order of first appearance.

def Fdt.word source · line 103 · raw

@x:U32 -> List<&2, U32>

def Fdt.len source · line 106 · raw

@bs:List<&2, U32> -> U32

def Fdt.offset.fin source · line 109 · raw

@hit:Bool -> @here:U32 -> @later:U32 -> U32

def Fdt.offset source · line 117 · raw

@ss:List<&2, String> -> @+s:String -> U32

The offset of name s in the strings block of table ss.

def Fdt.prop source · line 125 · raw

@+tab:List<&2, String> -> @p:Prop -> List<&2, U32>

FDT_PROP: token, value length, name offset, value padded to 4.

def Fdt.props source · line 131 · raw

@+tab:List<&2, String> -> @ps:List<&2, Prop> -> List<&2, U32>

def Fdt.size source · line 139 · raw

@ns:List<&2, Node> -> Nat

Nodes in a forest.

def Fdt.ser source · line 152 · raw

@fuel:Nat -> @+tab:List<&2, String> -> @ns:List<&2, Node> -> List<&2, U32>

The structure block of a forest. A single node is FDT_BEGIN_NODE, its name padded to 4, its props, its children, FDT_END_NODE. Two or more siblings split in halves that serialize in parallel: name offsets come from the finished strings table, so no half depends on the other. Each call spends one unit of fuel; 2 * Fdt.size(ns) always suffices (a forest of k nodes needs at most 2k - 1).

def Fdt.header source · line 172 · raw

@+total:U32 -> @+off_strings:U32 -> @cpu:U32 -> @size_strings:U32 -> @size_struct:U32 -> List<&2, U32>

def Fdt.build source · line 177 · raw

@root:Node -> @boot_cpuid:U32 -> List<&2, U32>

The complete DTB blob.