Skip to main content

Module system

Module system 

Source
Expand description

Resolving the .fis declarations: channels, structs, consts and the System = composition, into the Env. Memory regions and protection domains name nothing, so Env holds the AST’s own nodes for them.

Each declaration is validated as it resolves, by validation.rs’s rules; once the structs are in, the walk checks none contains itself.

A channel names its endpoint PDs and its buffer’s region by id, and each endpoint carries its channel id in that PD, which mkids.rs allocated. A buffer is declared with its channel, and so are its mappings, one at each end, built into Env::mappings as the channel is; vaddr.rs gives them their vaddrs once every program is resolved. A mapping is one node whether a channel’s buffer implies it or a program writes it (Mapping, base’s), and program.rs adds the written ones to the same arena after.